From owner-freebsd-java@FreeBSD.ORG Fri Jan 18 04:51:47 2013 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8DC44877 for ; Fri, 18 Jan 2013 04:51:47 +0000 (UTC) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (gerbercreations.com [71.39.140.16]) by mx1.freebsd.org (Postfix) with ESMTP id 336F4CC4 for ; Fri, 18 Jan 2013 04:51:46 +0000 (UTC) Received: from misty.eyesbeyond.com (localhost.eyesbeyond.com [127.0.0.1]) by misty.eyesbeyond.com (8.14.5/8.14.5) with ESMTP id r0I4pgeM077035; Thu, 17 Jan 2013 20:51:42 -0800 (PST) (envelope-from glewis@eyesbeyond.com) Received: (from glewis@localhost) by misty.eyesbeyond.com (8.14.5/8.14.5/Submit) id r0I4pguA077034; Thu, 17 Jan 2013 20:51:42 -0800 (PST) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: glewis set sender to glewis@eyesbeyond.com using -f Date: Thu, 17 Jan 2013 20:51:42 -0800 From: Greg Lewis To: Phil Phillips Subject: Re: Network related OpenJDK7 segfault Message-ID: <20130118045142.GA76864@misty.eyesbeyond.com> References: <50D24A41.4020909@experts-exchange.com> <50D24BB9.7090005@experts-exchange.com> <50DE1515.8090307@experts-exchange.com> <50F6F81A.6090608@experts-exchange.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50F6F81A.6090608@experts-exchange.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-java@freebsd.org X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2013 04:51:47 -0000 On Wed, Jan 16, 2013 at 10:57:30AM -0800, Phil Phillips wrote: > On 12/28/2012 01:54 PM, Phil Phillips wrote: > > On 12/19/2012 03:20 PM, Phil Phillips wrote: > >> On 12/19/2012 03:14 PM, Phil Phillips wrote: > >>> Hello, > >>> > >>> I had some Java code running fine on OpenJDK6. I upgraded to > >>> OpenJDK7 and started getting a segmentation fault. I've been able > >>> to narrow down the problem and create a test case to reproduce the > >>> issue. It's definitely load related, since I couldn't get the crash > >>> with a single-threaded test (the test code is multi-threaded). > >>> Running the test case with OpenJDK6 is fine, but running with > >>> OpenJDK7 crashes. I tried the sample code on FreeBSD 7.4, 8.3, and > >>> 9.0 - all with the same result. > >>> > >>> Is this a bug with OpenJDK7, or is there something I need to configure? > >>> > >>> I have attached the test Java class and a sample error report. > >>> > >>> Thanks! > >> > >> Looks like my attachments got clobbered. Here are some links. > >> > >> Test Class: http://pastebin.mozilla.org/2006513 > >> Crash Report: http://pastebin.mozilla.org/2006530 > >> > >> Thanks again. > >> > >> -- > >> Phil Phillips > > > > In the sample code, a javax.naming.directory.DirContext is being used > > as part of the reverse lookup test used to reproduced the issue. We > > noticed that a new DirContext was being used each time. Closing or > > re-using the DirContext gets rid of the crash. > > > > It looks like this isn't too much of an issue then. The interesting > > bit though is that OpenJDK6 is able to handle the "bad" code with too > > many instances of DirContext, while OpenJDK7 isn't. FWIW, I wasn't > > able to reproduce the crash on a Linux build of OpenJDK7. > > > > -- > > Phil Phillips > > Hey all, > > I did a truss of a the crashing code with OpenJDK6 vs OpenJDK7. I > noticed that OpenJDK6 was using "poll()", while OpenJDK7 was using > "select()". This was apparently changed in OpenJDK7 to accommodate a > bug in Mac OSX: > http://mail.openjdk.java.net/pipermail/macosx-port-dev/2012-January/002424.html > > I rebuilt OpenJDK7 with that patch reverted, and I can no longer > reproduce the crash. Hopefully, this is just something wrong with how > select() is being used, and not some kind of bug in FreeBSD itself. > > I can open a PR if anyone else feels that the OpenJDK7 port should > include a patch to switch back to poll(). G'day Phil, Switching back to poll() seems like the right thing to do here, unless someone wants to take on debugging the select() implementation. Thanks for digging into this! -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org