From owner-freebsd-java Mon Aug 20 17:18:37 2001 Delivered-To: freebsd-java@freebsd.org Received: from mgr2.xmission.com (mgr2.xmission.com [198.60.22.202]) by hub.freebsd.org (Postfix) with ESMTP id 5EEE037B40A for ; Mon, 20 Aug 2001 17:18:31 -0700 (PDT) (envelope-from glewis@misty.eyesbeyond.com) Received: from [166.70.6.178] (helo=misty.eyesbeyond.com) by mgr2.xmission.com with esmtp (Exim 3.22 #1) id 15YzFV-0004Sx-00; Mon, 20 Aug 2001 18:18:30 -0600 Received: (from glewis@localhost) by misty.eyesbeyond.com (8.11.3/8.11.3) id f7L0IQ812953; Tue, 21 Aug 2001 09:48:26 +0930 (CST) (envelope-from glewis) Date: Tue, 21 Aug 2001 09:48:26 +0930 From: Greg Lewis To: Alexander Litvin Cc: Greg Lewis , freebsd-java@FreeBSD.ORG Subject: Re: FreeBSD JDK1.2.2 Patchset 11??? Message-ID: <20010821094826.B12799@misty.eyesbeyond.com> References: <20010814043950.A7631@misty.eyesbeyond.com> <200108200354.f7K3sjd43713@unknown.whichever.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200108200354.f7K3sjd43713@unknown.whichever.org>; from archer@whichever.org on Sun, Aug 19, 2001 at 11:54:45PM -0400 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 On Sun, Aug 19, 2001 at 11:54:45PM -0400, Alexander Litvin wrote: > I started experiencing this problem at some time when I > upgraded my CURRENT. Not exactly sure at what point did that > happen (which means that I don't use java on freebsd extensively ;) > > This is with FreeBSD-CURRENT as of beginning of August, > jdk-1.2.2b10 from ports, green threads, no jit. > > Anyway, the problem was that whenever I do some DNS stuff from > java (like InetAddress.getByName()), interpreter dumps core. > > I could probably provide the stack trace, but unfortunately > right now I have some custom libc as well as a bit modified > libhpi.so and libjvm.so (modified as a part of investigation > of the problem), and to revert it all to standard will take > couple of days. > > But I have better then the stack trace -- I have the cause why > it happens. Here's it: > > 1. InetAddress.getByName() eventually ends up calling > gethostbyname_r(), which is implemented inside libhpi for > green threads. > > 2. gethostbyname_r() calls gethostbyname(3) from libc, which > in turn (simplified) calls res_ functions, which in turn > end up calling syscalls (like socket(), connect(), sendto(), > etc). > > 4. res_ functions call most of the syscalls directly (that > is, like _socket(), _connect(), _sendto()). But there's > one exclusion: res_send() calls send(). > > 5. And there's a reason: at some point send(2) syscall was > eliminated from CURRENT. Rather, send() is implemented > inside libc as _sendto(,,,,NULL,0). I'm not quite sure > if the same can happen to STABLE. The source code for stable does precisely the same thing. I haven't looked up what revision this occurred for, but that is definitely how send() is implemented on 4.3 RELEASE. > 6. When res_send() calls send(), it ends up not in the libc's > implementation, but in libhpi's wrapper. Which is not ready > at all (because other things like socket() and connect() > were called from res_send() directly as syscalls, that is as > _socket() and _connect()). send hasn't become a weak symbol in your libc for some strange reason has it? -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Phone : (801) 765 1887 Information Technology Web : http://www.eyesbeyond.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message