JDK-8220173 : assert(_handle_mark_nesting > 1) failed: memory leak: allocating handle outside HandleMark
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,13
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-03-05
  • Updated: 2019-10-04
  • Resolved: 2019-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13
11.0.5Fixed 13 b12Fixed
Description
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xccd0cc]  HandleArea::allocate_handle(oop)+0x1dc
V  [libjvm.so+0x14122b3]  CautiouslyPreserveExceptionMark::CautiouslyPreserveExceptionMark(Thread*)+0xc3
V  [libjvm.so+0xccf2cb]  HandshakeState::process_self_inner(JavaThread*)+0xcb
V  [libjvm.so+0x14cae2b]  SafepointMechanism::block_if_requested_slow(JavaThread*)+0x5b
V  [libjvm.so+0x1645940]  JavaThread::check_safepoint_and_suspend_for_native_trans(JavaThread*)+0x240
V  [libjvm.so+0xe777ac]  ThreadStateTransition::transition_from_native(JavaThread*, JavaThreadState) [clone .constprop.239]+0x8c
V  [libjvm.so+0xe7b6b5]  jni_ExceptionOccurred+0xb5
C  [jni010+0x223d]
C  [jni010+0x1259]

Comments
Fix Request (11u) Simple fix to avoid memory leak. Applies cleanly to 11u, passes tier1, tier2.
02-07-2019

It will happen if we have an exception and that thread processes a handshake. It seem like we are just missing a HandleMark. http://cr.openjdk.java.net/~rehn/8220173/webrev/
07-03-2019

[~dcubed] As far as I know, it's only happned once, which was with Graal, but based on the assert, it seems unlikely to be related to Graal.
05-03-2019

Attached the hs_err_pid file with the hostname elided.
05-03-2019