RFR (XS) JDK-8010389 - After fix for 7107135 a failed dlopen() call results in a VM crash

David Holmes david.holmes at oracle.com
Wed Mar 20 22:13:15 PDT 2013


On 21/03/2013 2:21 PM, Ioi Lam wrote:
> Please review:
>
> http://cr.openjdk.java.net/~iklam/8010389/dlopen_crash_001/
> <http://cr.openjdk.java.net/%7Eiklam/8010389/dlopen_crash_001/>
>
> Bug: After fix for 7107135 a failed dlopen() call results in a VM crash
>
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8010389
> https://jbs.oracle.com/bugs/browse/JDK-8010389
>
>      (The bugs.sun.com page may be unavailable for a couple of days)
>
> Summary of fix:
>
> Previously, if dlopen() fails inside the VM Thread, the Java thread
> would call dlerror() to try to find out what happened, but would get
> a NULL return instead. Attempts to use this NULL value causes the JVM
> to crash.

That is interesting and annoying. POSIX does not require ::dlerror() to 
be thread-safe. Linux does not specify that it is per-thread either. Is 
the problem that this occurs in a different thread, or simply that there 
may be an interleaving dl*() call that clears dlerror() ?

David
-----

>
>      The fix is to read dlerror() in the VM Thread when necessary.
>
> To Christian:
>
>      I integrated your test into jtreg, but I needed to write a shell
> test to set
>      the LD_LIBRARY_PATH. Is there a way to avoid the shell test?
>
> Tests executed:
>
>      * JPRT (linux only)
>      * UTE (vm.quick.testlist)
>      * JTREG
>
> Thanks,
> Ioi
>


More information about the hotspot-runtime-dev mailing list