I was debugging a failure and introduced a problem that caused
jni_AttachCurrentThread to fail to attach a thread. This caused the assert
to fail with the following traceback.
[6] report_assertion_failure(file_name = 0xffffffff7e553eb8 "/net/gretch/disk2/ws/no_adapters/src/share/vm/runtime/handles.cpp", line_no = 14, message = 0xffffffff7e553efa "assert(_handle_mark_nesting > 1,"memory leak: allocating handle outside HandleMark")"), line 210 in "debug.cpp"
[7] HandleArea::allocate_handle(this = 0x100149dc8, obj = 0xffffffff110011a0), line 14 in "handles.cpp"
[8] Handle::Handle(0xffffffff7fffe288, 0xffffffff110011a0, 0x8, 0xffffffff37c00280, 0x0, 0x0), at 0xffffffff7e20a1d4
[9] KlassHandle::KlassHandle(this = 0xffffffff7fffe288, obj = 0xffffffff110011a0), line 109 in "handles.hpp"
=>[10] SharedHeap::fill_region_with_object(mr = CLASS), line 102 in "sharedHeap.cpp"
[11] ThreadLocalAllocBuffer::reset(this = 0x100149468), line 94 in "threadLocalAllocBuffer.cpp"
[12] ThreadLocalAllocBuffer::clear(this = 0x100149468), line 21 in "threadLocalAllocBuffer.cpp"
[13] JavaThread::cleanup_failed_attach_current_thread(this = 0x1001493f8), line 1536 in "thread.cpp"
[14] attach_current_thread(vm = 0xffffffff7e999e18, penv = 0xffffffff7fffe9f8, _args = 0xffffffff7fffe9e0, daemon = 0), line 2756 in "jni.cpp"
[15] jni_AttachCurrentThread(vm = 0xffffffff7e999e18, penv = 0xffffffff7fffe9f8, _args = 0xffffffff7fffe9e0), line 2793 in "jni.cpp"
[16] JavaVM_::AttachCurrentThread(this = 0xffffffff7e999e18, penv = 0xffffffff7fffe9f8, args = 0xffffffff7fffe9e0), line 1939 in "jni.h"
[17] jni_DestroyJavaVM(vm = 0xffffffff7e999e18), line 2674 in "jni.cpp"
[18] main(0x400, 0xffffffff7ffff468, 0xffffffff7ffff4c8, 0x0, 0x0, 0x100000000), at 0x10000223c
Looking at the code on this path it will indeed try and allocate a handle
without a handlemark. In fact the code in attach_current_thread specifically
tries to do the cleanup outside of the handle mark.
###@###.### 2005-1-28 18:16:43 GMT
jni_AttachCurrentThread to fail to attach a thread. This caused the assert
to fail with the following traceback.
[6] report_assertion_failure(file_name = 0xffffffff7e553eb8 "/net/gretch/disk2/ws/no_adapters/src/share/vm/runtime/handles.cpp", line_no = 14, message = 0xffffffff7e553efa "assert(_handle_mark_nesting > 1,"memory leak: allocating handle outside HandleMark")"), line 210 in "debug.cpp"
[7] HandleArea::allocate_handle(this = 0x100149dc8, obj = 0xffffffff110011a0), line 14 in "handles.cpp"
[8] Handle::Handle(0xffffffff7fffe288, 0xffffffff110011a0, 0x8, 0xffffffff37c00280, 0x0, 0x0), at 0xffffffff7e20a1d4
[9] KlassHandle::KlassHandle(this = 0xffffffff7fffe288, obj = 0xffffffff110011a0), line 109 in "handles.hpp"
=>[10] SharedHeap::fill_region_with_object(mr = CLASS), line 102 in "sharedHeap.cpp"
[11] ThreadLocalAllocBuffer::reset(this = 0x100149468), line 94 in "threadLocalAllocBuffer.cpp"
[12] ThreadLocalAllocBuffer::clear(this = 0x100149468), line 21 in "threadLocalAllocBuffer.cpp"
[13] JavaThread::cleanup_failed_attach_current_thread(this = 0x1001493f8), line 1536 in "thread.cpp"
[14] attach_current_thread(vm = 0xffffffff7e999e18, penv = 0xffffffff7fffe9f8, _args = 0xffffffff7fffe9e0, daemon = 0), line 2756 in "jni.cpp"
[15] jni_AttachCurrentThread(vm = 0xffffffff7e999e18, penv = 0xffffffff7fffe9f8, _args = 0xffffffff7fffe9e0), line 2793 in "jni.cpp"
[16] JavaVM_::AttachCurrentThread(this = 0xffffffff7e999e18, penv = 0xffffffff7fffe9f8, args = 0xffffffff7fffe9e0), line 1939 in "jni.h"
[17] jni_DestroyJavaVM(vm = 0xffffffff7e999e18), line 2674 in "jni.cpp"
[18] main(0x400, 0xffffffff7ffff468, 0xffffffff7ffff4c8, 0x0, 0x0, 0x100000000), at 0x10000223c
Looking at the code on this path it will indeed try and allocate a handle
without a handlemark. In fact the code in attach_current_thread specifically
tries to do the cleanup outside of the handle mark.
###@###.### 2005-1-28 18:16:43 GMT