RFR (XS) 8199012: JVM crash during LevelDB JNI access

David Holmes david.holmes at oracle.com
Wed Mar 7 06:40:09 UTC 2018


Thanks Thomas!

David

On 7/03/2018 4:09 PM, Thomas Stüfe wrote:
> Looks obvious and fine.
> 
> Thanks, Thomas
> 
> On Wed, Mar 7, 2018 at 12:31 AM, David Holmes <david.holmes at oracle.com 
> <mailto:david.holmes at oracle.com>> wrote:
> 
>     webrev: http://cr.openjdk.java.net/~dholmes/8199012/webrev/
>     <http://cr.openjdk.java.net/~dholmes/8199012/webrev/>
>     bug: https://bugs.openjdk.java.net/browse/JDK-8199012
>     <https://bugs.openjdk.java.net/browse/JDK-8199012>
> 
>     JNI DetachCurrentThread is defined as a no-op if called by a thread
>     that is not attached. But the check for that was occurring after we
>     called VM_Exit::block_if_vm_exited(). If the thread was not in fact
>     attached then we have a NULL current thread and that can cause in
>     crash in VM_Exit::block_if_vm_exited() if we actually need to block
>     - which explains the scenario reported in the bug.
> 
>     Simple, obvious, fix is to do the "not attached" check first.
> 
>     Testing:
>        - Mach5 CI equivalent testing (tier1/2)
>        - internal JNI tests
> 
>     I marked this noreg-hard as a regression test is difficult to set up
>     due to the need to coordinate with a VM shutdown.
> 
>     Thanks,
>     David
> 
> 


More information about the hotspot-runtime-dev mailing list