# HG changeset patch # User rehn # Date 1552045896 -3600 # Node ID 07540197d0fd7718a6bffffcddb5d3a3c223edfe # Parent ac09c2498c6452f050ca3f07e06f17b1b319b7b3 8220173: assert(_handle_mark_nesting > 1) failed: memory leak: allocating handle outside HandleMark Reviewed-by: dcubed, redestad diff -r ac09c2498c64 -r 07540197d0fd src/hotspot/share/runtime/handshake.cpp --- a/src/hotspot/share/runtime/handshake.cpp Fri Mar 08 12:01:43 2019 +0100 +++ b/src/hotspot/share/runtime/handshake.cpp Fri Mar 08 12:51:36 2019 +0100 @@ -288,13 +288,14 @@ assert(Thread::current() == thread, "should call from thread"); assert(!thread->is_terminated(), "should not be a terminated thread"); - CautiouslyPreserveExceptionMark pem(thread); ThreadInVMForHandshake tivm(thread); if (!_semaphore.trywait()) { _semaphore.wait_with_safepoint_check(thread); } HandshakeOperation* op = OrderAccess::load_acquire(&_operation); if (op != NULL) { + HandleMark hm(thread); + CautiouslyPreserveExceptionMark pem(thread); // Disarm before execute the operation clear_handshake(thread); op->do_handshake(thread);