NetworkInterface problem (Re: [kaffe] freebsd 5.3 failed regression)

2005-04-24 Thread Ito Kazumitsu
> From: Riccardo <[EMAIL PROTECTED]>
> Subject: [kaffe] freebsd 5.3 failed regression
> Date: Fri, 22 Apr 2005 11:38:06 + (UTC)
> 
> > on 18 april, freebsd 5.3 passed all tests, today it fails one:
> 
> In my case, also on FreeBSD 5.3-RELEASE, compilation failes
> before going to the regression test.

Now Kaffe's CVS version compiles fine, and I am experiencing
the same problem reported by Riccardo.

The problem seems to appear when a network interface has more than
one addresses.

Attached is a program copied from test/regression/NetworkInterfaceTest.java.
According to this,

  (1) NetworkInterface returned by NetworkInterface.getNetworkInterfaces()
  contains all addresses of that interface.

  (2) NetworkInterface returned by NetworkInterface.getByName(name) or
  NetworkInterface.getByInetAddress(addr) contains only one of the
  addresses of that interface.

Test program:
import java.util.Enumeration;

import java.net.InetAddress;
import java.net.SocketException;
import java.net.NetworkInterface;

public class TestNetworkInterface
{

private static void showNetworkInterface(NetworkInterface ni)
{
System.out.println("  showNetworkInterface: " + ni + "{");
System.out.println("  Name: " + ni.getName());
System.out.println("  Display Name: "
   + ni.getDisplayName());
Enumeration ips = ni.getInetAddresses();
while( ips.hasMoreElements() )
{
InetAddress ia;
ia = (InetAddress)ips.nextElement();
System.out.println("  Address: " + ia);
}
System.out.println("  }");
}


public static void main(String args[])
{
try
{
Enumeration enum;
int lpc;

enum = NetworkInterface.getNetworkInterfaces();
for( lpc = 0; enum.hasMoreElements(); lpc++ )
{
NetworkInterface ni, ni2;
Enumeration ips;

ni = (NetworkInterface)enum.nextElement();
System.out.println("Detected interface #" + lpc);
showNetworkInterface(ni);

ni2 = NetworkInterface.getByName(ni.getName());
System.out.println("getByName(" + ni.getName() + ")");
showNetworkInterface(ni2);

ips = ni.getInetAddresses();
while( ips.hasMoreElements() )
{
InetAddress ia;

ia = (InetAddress)ips.nextElement();
System.out.println("getByInetAddress(" + ia + ")");
ni2 = NetworkInterface.getByInetAddress(ia);
showNetworkInterface(ni2);
}
}
}
catch(SocketException e)
{
e.printStackTrace();
System.exit(77);
}
catch(kaffe.util.NotImplemented e)
{
e.printStackTrace();
System.exit(77);
}
}
}

Result:
Detected interface #0
  showNetworkInterface: name: lo0 (lo0) addresses:
127.0.0.1/127.0.0.1;
::1/0:0:0:0:0:0:0:1;
fe80:3::1/fe80:3:0:0:0:0:0:1;
{
  Name: lo0
  Display Name: lo0
  Address: 127.0.0.1/127.0.0.1
  Address: ::1/0:0:0:0:0:0:0:1
  Address: fe80:3::1/fe80:3:0:0:0:0:0:1
  }
getByName(lo0)
  showNetworkInterface: name: lo0 (lo0) addresses:
127.0.0.1/127.0.0.1;
{
  Name: lo0
  Display Name: lo0
  Address: 127.0.0.1/127.0.0.1
  }
getByInetAddress(127.0.0.1/127.0.0.1)
  showNetworkInterface: name: lo0 (lo0) addresses:
127.0.0.1/127.0.0.1;
{
  Name: lo0
  Display Name: lo0
  Address: 127.0.0.1/127.0.0.1
  }
getByInetAddress(::1/0:0:0:0:0:0:0:1)
  showNetworkInterface: name: lo0 (lo0) addresses:
::1/0:0:0:0:0:0:0:1;
{
  Name: lo0
  Display Name: lo0
  Address: ::1/0:0:0:0:0:0:0:1
  }
getByInetAddress(fe80:3::1/fe80:3:0:0:0:0:0:1)
  showNetworkInterface: name: lo0 (lo0) addresses:
fe80:3::1/fe80:3:0:0:0:0:0:1;
{
  Name: lo0
  Display Name: lo0
  Address: fe80:3::1/fe80:3:0:0:0:0:0:1
  }
Detected interface #1
  showNetworkInterface: name: fxp0 (fxp0) addresses:
192.168.0.3/192.168.0.3;
fe80:1::202:55ff:feec:ab05/fe80:1:0:0:202:55ff:feec:ab05;
{
  Name: fxp0
  Display Name: fxp0
  Address: 192.168.0.3/192.168.0.3
  Address: fe80:1::202:55ff:feec:ab05/fe80:1:0:0:202:55ff:feec:ab05
  }
getByName(fxp0)
  showNetworkInterface: name: fxp0 (fxp0) addresses:
192.168.0.3/192.168.0.3;
{
  Name: fxp0
  Display Name: fxp0
  Address: 192.168.0.3/192.168.0.3
  }
getByInetAddress(192.168.0.3/192.168.0.3)
  showNetworkInterface: name: fxp0 (fxp0) addresses:
192.168.0.3/192.168.0.3;
{
  Name: fxp0
  Display Name: fxp0
  Address: 192.168.0.3/192.168.0.3
  }
getByInetAddress(fe80:1::202:55ff:feec:ab05/fe80:1:0:0:202:55ff:feec:ab05)
  showNetworkInterface: name: fxp0 (fxp0) addresses

Re: [kaffe] freebsd 5.3 failed regression

2005-04-22 Thread Ito Kazumitsu
From: Riccardo <[EMAIL PROTECTED]>
Subject: [kaffe] freebsd 5.3 failed regression
Date: Fri, 22 Apr 2005 11:38:06 + (UTC)

> on 18 april, freebsd 5.3 passed all tests, today it fails one:

In my case, also on FreeBSD 5.3-RELEASE, compilation failes
before going to the regression test.

 gcc -DHAVE_CONFIG_H -I. -I. -I../../../config -I../../../include/kaffe -I../../
../kaffe -I../../../include -I../../../kaffe/kaffevm/jni -I/disk/kaz/work/kaffe-
make-current/kaffe/./kaffe/kaffevm -I/disk/kaz/work/kaffe-make-current/kaffe/./k
affe/kaffevm/jit3 -I/disk/kaz/work/kaffe-make-current/kaffe/./kaffe/kaffevm/syst
ems/unix-pthreads -I../../../replace -I../../../binreloc -I../../../config -I../
../../include -I/usr/local/include -DKAFFE_VMDEBUG -D_REENTRANT -g -O2 -Wall -D_
THREAD_SAFE -pthread -MT libnet_la-PlainDatagramSocketImpl.lo -MD -MP -MF .deps/
libnet_la-PlainDatagramSocketImpl.Tpo -c PlainDatagramSocketImpl.c  -fPIC -DPIC 
-o .libs/libnet_la-PlainDatagramSocketImpl.o
PlainDatagramSocketImpl.c:23:39: java_net_NetworkInterface.h: No such file or di
rectory
In file included from PlainDatagramSocketImpl.c:25:
../../../include/gnu_java_net_PlainDatagramSocketImpl.h:37: warning: "struct Hja
va_net_NetworkInterface" declared inside parameter list
../../../include/gnu_java_net_PlainDatagramSocketImpl.h:37: warning: its scope i
s only this definition or declaration, which is probably not what you want
../../../include/gnu_java_net_PlainDatagramSocketImpl.h:38: warning: "struct Hja
va_net_NetworkInterface" declared inside parameter list
PlainDatagramSocketImpl.c:27:34: java_net_InetAddress.h: No such file or directo
ry
PlainDatagramSocketImpl.c: In function `gnu_java_net_PlainDatagramSocketImpl_bin
d':
PlainDatagramSocketImpl.c:135: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c:144: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c:153: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c:162: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c: In function `gnu_java_net_PlainDatagramSocketImpl_sen
d0':
PlainDatagramSocketImpl.c:220: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c:229: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c:238: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c:247: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c: In function `gnu_java_net_PlainDatagramSocketImpl_pee
k':
PlainDatagramSocketImpl.c:290: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c:294: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c: In function `gnu_java_net_PlainDatagramSocketImpl_rec
eive0':
PlainDatagramSocketImpl.c:389: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c: In function `gnu_java_net_PlainDatagramSocketImpl_soc
ketSetOption':
PlainDatagramSocketImpl.c:449: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c: In function `gnu_java_net_PlainDatagramSocketImpl_joi
n':
PlainDatagramSocketImpl.c:547: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c: In function `gnu_java_net_PlainDatagramSocketImpl_lea
ve':
PlainDatagramSocketImpl.c:585: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c: At top level:
PlainDatagramSocketImpl.c:614: warning: "struct Hjava_net_NetworkInterface" decl
ared inside parameter list
PlainDatagramSocketImpl.c:615: error: conflicting types for 'gnu_java_net_PlainD
atagramSocketImpl_joinGroup'
../../../include/gnu_java_net_PlainDatagramSocketImpl.h:37: error: previous decl
aration of 'gnu_java_net_PlainDatagramSocketImpl_joinGroup' was here
PlainDatagramSocketImpl.c:615: error: conflicting types for 'gnu_java_net_PlainD
atagramSocketImpl_joinGroup'
../../../include/gnu_java_net_PlainDatagramSocketImpl.h:37: error: previous decl
aration of 'gnu_java_net_PlainDatagramSocketImpl_joinGroup' was here
PlainDatagramSocketImpl.c: In function `gnu_java_net_PlainDatagramSocketImpl_joi
nGroup':
PlainDatagramSocketImpl.c:626: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c:634: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c:637: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c:639: error: dereferencing pointer to incomplete type
PlainDatagramSocketImpl.c: At top level:
PlainDatagramSocketImpl.c:668: warning: "struct Hjava_net_NetworkInterface" decl
ared inside parameter list
PlainDatagramSocketImpl.c:669: error: conflicting types for 'gnu_java_net_PlainD
atagramSocketImpl_leaveGroup'
../../../include/gnu_java_net_PlainDatagramSocketImpl.h:38: error: previous decl
aration of 'gnu_java_net_PlainDatagramSocketImpl_leav

Re: [kaffe] freebsd 5.3 failed regression

2005-04-22 Thread Dalibor Topic
Am Samstag, den 23.04.2005, 01:05 +0900 schrieb Ito Kazumitsu:
> From: Riccardo <[EMAIL PROTECTED]>
> Subject: [kaffe] freebsd 5.3 failed regression
> Date: Fri, 22 Apr 2005 11:38:06 + (UTC)
> 
> > on 18 april, freebsd 5.3 passed all tests, today it fails one:
> 
> In my case, also on FreeBSD 5.3-RELEASE, compilation failes
> before going to the regression test.
> 
>  gcc -DHAVE_CONFIG_H -I. -I. -I../../../config -I../../../include/kaffe 
> -I../../
> ../kaffe -I../../../include -I../../../kaffe/kaffevm/jni 
> -I/disk/kaz/work/kaffe-
> make-current/kaffe/./kaffe/kaffevm 
> -I/disk/kaz/work/kaffe-make-current/kaffe/./k
> affe/kaffevm/jit3 
> -I/disk/kaz/work/kaffe-make-current/kaffe/./kaffe/kaffevm/syst
> ems/unix-pthreads -I../../../replace -I../../../binreloc -I../../../config 
> -I../
> ../../include -I/usr/local/include -DKAFFE_VMDEBUG -D_REENTRANT -g -O2 -Wall 
> -D_
> THREAD_SAFE -pthread -MT libnet_la-PlainDatagramSocketImpl.lo -MD -MP -MF 
> .deps/
> libnet_la-PlainDatagramSocketImpl.Tpo -c PlainDatagramSocketImpl.c  -fPIC 
> -DPIC 
> -o .libs/libnet_la-PlainDatagramSocketImpl.o
> PlainDatagramSocketImpl.c:23:39: java_net_NetworkInterface.h: No such file or 
> di
> rectory

> gmake[2]: *** [libnet_la-PlainDatagramSocketImpl.lo] Error 1

Thanks Ito, I've checked in a fix into CVS.

cheers,
dalibor topic


___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


[kaffe] freebsd 5.3 failed regression

2005-04-22 Thread Riccardo
Hey,

on 18 april, freebsd 5.3 passed all tests, today it fails one:

cat NetworkInterfaceTest.fail
getByName failed: name: lo0 (lo0) addresses:
127.0.0.1/127.0.0.1;
::1/0:0:0:0:0:0:0:1;
fe80:3::1/fe80:3:0:0:0:0:0:1;
 != name: lo0 (lo0) addresses:
127.0.0.1/127.0.0.1;

getByInetAddress failed: name: lo0 (lo0) addresses:
127.0.0.1/127.0.0.1;
::1/0:0:0:0:0:0:0:1;
fe80:3::1/fe80:3:0:0:0:0:0:1;
 != name: lo0 (lo0) addresses:
127.0.0.1/127.0.0.1;

getByInetAddress failed: name: lo0 (lo0) addresses:
127.0.0.1/127.0.0.1;
::1/0:0:0:0:0:0:0:1;
fe80:3::1/fe80:3:0:0:0:0:0:1;
 != name: lo0 (lo0) addresses:
::1/0:0:0:0:0:0:0:1;

getByInetAddress failed: name: lo0 (lo0) addresses:
127.0.0.1/127.0.0.1;
::1/0:0:0:0:0:0:0:1;
fe80:3::1/fe80:3:0:0:0:0:0:1;
 != name: lo0 (lo0) addresses:
fe80:3::1/fe80:3:0:0:0:0:0:1;

getByName failed: name: xl0 (xl0) addresses:
192.168.1.53/192.168.1.53;
fe80:1::210:4bff:fe43:c5e1/fe80:1:0:0:210:4bff:fe43:c5e1;
 != name: xl0 (xl0) addresses:
192.168.1.53/192.168.1.53;

getByInetAddress failed: name: xl0 (xl0) addresses:
192.168.1.53/192.168.1.53;
fe80:1::210:4bff:fe43:c5e1/fe80:1:0:0:210:4bff:fe43:c5e1;
 != name: xl0 (xl0) addresses:
192.168.1.53/192.168.1.53;

getByInetAddress failed: name: xl0 (xl0) addresses:
192.168.1.53/192.168.1.53;
fe80:1::210:4bff:fe43:c5e1/fe80:1:0:0:210:4bff:fe43:c5e1;
 != name: xl0 (xl0) addresses:
fe80:1::210:4bff:fe43:c5e1/fe80:1:0:0:210:4bff:fe43:c5e1;

Done

-R


___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe