From owner-freebsd-java@FreeBSD.ORG Sun Dec 7 11:29:17 2003 Return-Path: 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 BDE5216A4CE for ; Sun, 7 Dec 2003 11:29:17 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00DF243FAF for ; Sun, 7 Dec 2003 11:29:16 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hB7JTFml002734; Sun, 7 Dec 2003 14:29:15 -0500 (EST) Date: Sun, 7 Dec 2003 14:29:14 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Nick Johnson In-Reply-To: <20031207085003.J24955@turing.morons.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-java@freebsd.org Subject: Re: fatal exception in 1.4.2-p5 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2003 19:29:17 -0000 On Sun, 7 Dec 2003, Nick Johnson wrote: > Here's a bit more information; when the fatal exception occurrs, the > process starts chewing up a huge amount of CPU, but doing a thread dump on > it reveals that none of the threads is actually doing anything. > > Also, it looks like getservent isn't threadsafe; libc_r does not provide > its own implementation and getservent uses some static buffers... this in > turn means that getaddrinfo isn't threadsafe. Indeed, the man page says > as much under "BUGS". > > So either some locking needs to be added to > /j2se/src/solaris/native/java/net/Inet6AddressImpl.c and net_util_md.c or > getaddrinfo needs to be fixed to be threadsafe. I'd supply a patch to do > the locking except I can't figure out a good place to init a mutex. If all else fails, you can use pthread_once(3) or initially set the mutex to PTHREAD_MUTEX_INITIALIZER. -- Dan Eischen