Network related OpenJDK7 segfault
Phil Phillips
pphillips at experts-exchange.com
Wed Jan 16 18:57:37 UTC 2013
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
More information about the freebsd-java
mailing list