Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2047730 | 1.4.1 | Daniel Daugherty | P4 | Resolved | Fixed | hopper |
Name: dd4877 Date: 10/03/2001
daniel.daugherty@sun 2001-10-03
One of my profiling stress runs crashed on the following assertion
failure:
This run crashed on the following assertion failure:
# assert(state == _thread_in_Java || state == _thread_new_trans
# || state == _thread_in_native || state == _thread_in_native_trans,
# "a suspended thread should have thread state in_native, in_Java, or just start
ed")
#
# Error ID: baseline-stress/src/share/vm/runtime/safepoint.cpp, 438 [ Patched ]
While the VMThread was calling SafepointSynchronize::begin(),
examine_state_of_thread() found a suspended thread with an unexpected
thread state value. This was caused by a race between JNI
DestroyJavaVM() and safepointing.
Here is the scenario:
- JNI DestroyJavaVM() has been called
- it queues up a VM_SuspendDaemons operation
- it is waiting in VMThread::wait_for_vm_thread_exit()
- VMThread
- processes the VM_SuspendDaemons operation which is defined as an
"evaluate at safepoint" operation
- JavaThread (daemon)
- coming out of an Object.wait()
- sees that there is a pending safepoint
- blocks in the thread state transition from _thread_blocked to
_thread_in_vm (state now _thread_blocked_trans)
- gets suspended by the VMThread
- VMThread
- does another safepoint (we have SafepointALot set)
- fails the assertion
======================================================================
- backported by
-
JDK-2047730 race between JNI DestroyJavaVM() and safepoint hits too tight assertion
-
- Resolved
-