Name: clC74495 Date: 12/09/98
I ran into this problem running the RSA Jsafe code which
creates a thread and counts 'yields' over a fixed time
interval to generate random numbers.
The finalizer thread sets the variable inBeingFinalized
to itself and then exits the FINALME lock. At this point
another thread of higher priority in the system wants
this lock so we preempt (YIELD).
The Thread that now has the finalizer lock blocks in a synchronous
call to run finalization from the gc. This happens because
we need to synchornously call the gc during a heap allocation
failure. We wait on a condition variable. This thread is
trying to allocaton an Exception object to kill a thread
(Thread.stop)
At this point, all that is left to run in the JVM is a
"spinner" thread that is in a while (1) Thread.yield() loop
The finalizer never gets to run again, and the system is
hung because the spinner thread would normally get killed
by the second thread which is blocked waiting for the finalizer
to run.
In a system that honors real thread priorities, the spinner
thread will continue to run forever and the finalizer thread
will never run.
(Review ID: 47617)
======================================================================
- duplicates
-
JDK-4091873 (refs) Calling a synchronized method from finalize() can lock VM
-
- Closed
-