The problem is in thread 8. I doubt it has been fixed,
but I didn't check.
Basically we have
_Jv_MonitorEnter
acquires lock bit on lightweight lock entry
notices it needs to allocate heavyweight lock
calls eventually alloc_heavy.
alloc_heavy call GC_local_gcj_malloc
GC_local_gcj_malloc is out of free list entries AND
is first allocation to run since GC, which
results in a call to
FinalizerThread.finalizerReady, which is currently
unrestricted Java code. It then calls
_Jv_MonitorEnter
which tries to acquire the same lock table
entry it already owns ==>
deadlock
Is it hard to make FinalizerThread.finalizerReady a small piece
of C++ code, which does not
acquire Java locks, e.g. by just doing a pthread_cond_signal
equivalent?