--- old/src/hotspot/share/prims/jni.cpp 2019-04-01 22:22:38.628488183 +0000 +++ new/src/hotspot/share/prims/jni.cpp 2019-04-01 22:22:37.928471738 +0000 @@ -4166,7 +4166,7 @@ if (attach_failed) { // Added missing cleanup - thread->cleanup_failed_attach_current_thread(); + thread->cleanup_failed_attach_current_thread(daemon); return JNI_ERR; }