From owner-freebsd-java Fri Feb 7 19:39: 7 2003 Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 32F4237B401 for ; Fri, 7 Feb 2003 19:39:04 -0800 (PST) Received: from habanero.hesketh.net (habanero.hesketh.net [66.45.6.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC2C443FA3 for ; Fri, 7 Feb 2003 19:39:03 -0800 (PST) (envelope-from brent@mutt.rcfile.org) Received: from mutt.rcfile.org (rdu57-229-060.nc.rr.com [66.57.229.60]) by habanero.hesketh.net (8.12.6/8.12.6) with ESMTP id h183cmfx009204; Fri, 7 Feb 2003 22:38:49 -0500 X-Received-From: brent@mutt.rcfile.org X-Delivered-To: freebsd-java@FreeBSD.ORG X-Spam-Filter: check_local@habanero.hesketh.net by digitalanswers.org Received: from mutt.rcfile.org (localhost [127.0.0.1]) by mutt.rcfile.org (8.12.6/8.12.6) with ESMTP id h183d2XD005986; Fri, 7 Feb 2003 22:39:02 -0500 (EST) (envelope-from brent@mutt.rcfile.org) Received: (from brent@localhost) by mutt.rcfile.org (8.12.6/8.12.6/Submit) id h183d2wA005985; Fri, 7 Feb 2003 22:39:02 -0500 (EST) Date: Fri, 7 Feb 2003 22:39:02 -0500 From: Brent Verner To: freebsd-java@FreeBSD.ORG Cc: William Holt Subject: Re: problem and workaround for java/tomcat on -current Message-ID: <20030208033902.GA5841@rcfile.org> References: <20030203105027.GA86700@rcfile.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030203105027.GA86700@rcfile.org> X-muttrc: $Id: .muttrc,v 1.9 2002/01/02 07:04:49 brent Exp $ X-uname: FreeBSD 4.7-STABLE #32: Tue Feb 4 11:04:18 EST 2003 root@mutt.rcfile.org:/usr/obj/usr/src/sys/MUTTS User-Agent: Mutt/1.5.3i Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org To follow up on this, it appears (if I can trust gdb w/java), that Java_java_net_InetAddressImpl_getHostByAddr calls the gethostbyaddr_r in libc.so.5 instead of the one provided in native/java/net/InetAddressImpl.c, leaving hp == -1, which gives us the bus error -> abort. the system gethostbyaddr_r has a prototype of int gethostbyaddr_r(const char *, int len, int type, struct hostent *, struct hostent_data *) I've simply renamed the gethostby...._r to l_gethostby...._r, and am rebuilding now to verify this theory. I'll let yall know what the outcome is. Q: why would the locally provided gethostby...._r be named to conflict with a libc function? Q: what is the _right_ way to solve this if gdb showed me the truth, and the problem was an libc conflict? I'd think it would be best to continue to use the local gethostby...._r functions (especially considering that the ones in libc specifically note non-reentrancy). btw, is there a "correct" way to run the jvm under gdb? I ended up having to "jump" over a read() call that was hanging... thanks. b [2003-02-03 05:50] Brent Verner said: | Sometime after Jan 20, -current has been unable to run tomcat | (and other things, such as the Jetty issue William Holt reported). | I took his CrashBSD.java prog, and further determined that only | the "0.0.0.0" caused the bus error -> abort problem. | | import java.net.*; | public class CrashBSD | { | static public void main( String args[] ) | { | try | { | InetAddress a = InetAddress.getByName("127.0.0.1"); | ServerSocket sa = new ServerSocket(0,10,a); | System.out.println(sa); | InetAddress b = InetAddress.getByName("0.0.0.0"); | ServerSocket sb = new ServerSocket(0,10,b); | System.out.println(sb); | } | catch ( Exception e ) | { | System.out.println( e ); | System.exit( 1 ); | } | } | } | | You'll notice that the 127.0.0.1 InetAddress works just fine, but | the "0.0.0.0" addr causes the error. I dug a bit further into | what change since 20 Jan is causing this, but had no luck. However, | the problem can be worked around by adding a line in the /etc/hosts | for the "0" ip. | | 0.0.0.0 all.interfaces.on.this.machine | | What strange effects might this cause? I have no clue :-), but | tomcat seems to be happy again... | | hth, | brent | | | To Unsubscribe: send mail to majordomo@FreeBSD.org | with "unsubscribe freebsd-java" in the body of the message -- "Develop your talent, man, and leave the world something. Records are really gifts from people. To think that an artist would love you enough to share his music with anyone is a beautiful thing." -- Duane Allman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message