fatal exception in 1.4.2-p5

Alexey Zelkin phantom at freebsd.org
Sat Dec 13 13:32:37 PST 2003


hi,

On Sat, Dec 06, 2003 at 11:46:51PM -0800, Nick Johnson wrote:
> Getting some of this tonight:
> 
> An unexpected exception has been detected in native code outside the VM.
> Unexpected Signal : 11 occurred at PC=0x280C32AF
> Function=_flockfile_debug+0x2B
> Library=/usr/lib/libc_r.so.4
> 
> Current Java thread:
>         at java.net.Inet6AddressImpl.getLocalHostName(Native Method)
>         at java.net.InetAddress.getLocalHost(InetAddress.java:1178)

I'd be interesting if you'll try java with '-Djava.net.preferIPv4Stack=true'
command line switch.  And then try following patch:

Index: Inet6AddressImpl.c
===================================================================
RCS file: /home/jdk14-cvs/jdk142-src/j2se/src/solaris/native/java/net/Inet6AddressImpl.c,v
retrieving revision 1.2
diff -u -r1.2 Inet6AddressImpl.c
--- Inet6AddressImpl.c	16 Oct 2003 13:32:52 -0000	1.2
+++ Inet6AddressImpl.c	13 Dec 2003 21:32:30 -0000
@@ -49,8 +49,8 @@
 	/* Something went wrong, maybe networking is not setup? */
 	strcpy(hostname, "localhost");
     } else {
-#ifdef __linux__
-	/* On Linux gethostname() says "host.domain.sun.com".  On
+#if defined(__linux__) || defined(__FreeBSD__)
+	/* On Linux/FreeBSD gethostname() says "host.domain.sun.com".  On
 	 * Solaris gethostname() says "host", so extra work is needed.
 	 */
 #else
@@ -88,7 +88,7 @@
 	    }
 	}
 #endif /* AF_INET6 */
-#endif /* __linux__ */
+#endif /* __linux__ || __FreeBSD__ */
     }
     return (*env)->NewStringUTF(env, hostname);
 }


More information about the freebsd-java mailing list