Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2001 09:48:26 +0930
From:      Greg Lewis <glewis@eyesbeyond.com>
To:        Alexander Litvin <archer@whichever.org>
Cc:        Greg Lewis <glewis@eyesbeyond.com>, freebsd-java@FreeBSD.ORG
Subject:   Re: FreeBSD JDK1.2.2 Patchset 11???
Message-ID:  <20010821094826.B12799@misty.eyesbeyond.com>
In-Reply-To: <200108200354.f7K3sjd43713@unknown.whichever.org>; from archer@whichever.org on Sun, Aug 19, 2001 at 11:54:45PM -0400
References:  <20010814043950.A7631@misty.eyesbeyond.com> <200108200354.f7K3sjd43713@unknown.whichever.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010821094826.B12799>