From owner-freebsd-java@FreeBSD.ORG Wed Jan 16 18:57:37 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 0E45A302 for ; Wed, 16 Jan 2013 18:57:37 +0000 (UTC) (envelope-from pphillips@experts-exchange.com) Received: from mail.l3.redsrci.com (mail.pub.l3.redsrci.com [64.156.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id D84672EC for ; Wed, 16 Jan 2013 18:57:36 +0000 (UTC) Received: from mail.l3.redsrci.com (localhost [127.0.0.1]) by mail.l3.redsrci.com (Postfix) with ESMTP id 870957A1C59 for ; Wed, 16 Jan 2013 10:57:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= experts-exchange.com; h=content-type:content-type:in-reply-to :references:subject:subject:mime-version:user-agent:from:from :date:date:message-id:received:received; s=ee; t=1358362650; x= 1360177050; bh=Q6NqcdFmss+VjhqMxkE/d5f4fEkgN2omHCuEbyMjZ2s=; b=W TJuJ8FDXJqfAsNffHKyMfU21mGRpPmDMA2J9e23spSeWqCEwPie1M8CzMBM0kd4R J01AZEr4GDVrKyaT1QHXaWebLvhxh53kzO2dWe2w26TYjqmfEBfsh6YLzMD0is28 DdHwF4vR7FfY7bChC6lTj9uUMD9VJGVFQmYM9n4JnI= X-Virus-Scanned: amavisd-new at redsrci.com Received: from mail.l3.redsrci.com ([127.0.0.1]) by mail.l3.redsrci.com (mail.l3.redsrci.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uJKWI8RdG8Zk for ; Wed, 16 Jan 2013 10:57:30 -0800 (PST) Received: from [192.168.103.98] (fw1.pub.noc.redsrci.com [72.29.164.238]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: pphillips) by mail.l3.redsrci.com (Postfix) with ESMTPSA id 5B0BB7A1C57 for ; Wed, 16 Jan 2013 10:57:30 -0800 (PST) Message-ID: <50F6F81A.6090608@experts-exchange.com> Date: Wed, 16 Jan 2013 10:57:30 -0800 From: Phil Phillips User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: freebsd-java@freebsd.org Subject: Re: Network related OpenJDK7 segfault References: <50D24A41.4020909@experts-exchange.com> <50D24BB9.7090005@experts-exchange.com> <50DE1515.8090307@experts-exchange.com> In-Reply-To: <50DE1515.8090307@experts-exchange.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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: Wed, 16 Jan 2013 18:57:37 -0000 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(). Thanks, Phil