[Bug libgcj/16662] IllegalMonitorStateException in EventQueue.getNextEvent(): possible hash synchronization bug?

Hans dot Boehm at hp dot com gcc-bugzilla@gcc.gnu.org
Tue Aug 10 18:30:00 GMT 2004


------- Additional Comments From Hans dot Boehm at hp dot com  2004-08-10 18:30 -------
I managed to get a run with logging to fail. 

I believe the failure scenario is the following:

1) _Jv_MonitorEnter initially sees an address field which is locked.
This causes the (address & ~(HEAVY | REQUEST_CONVERSION) == addr) test to fail.

2) In the meantime another thread unlocks the address field.

3) _Jv_MonitorEnter's compare_and_swap to acquire the LOCKED bit succeeds 
(unexpectedly).

4) The following code assumes incorrectly that the address corresponds to a 
different object and acquires the heavyweight lock.

5) The lightweight lock is still held by another thread.  bad.

I'll post a patch once I've done a bit of testing.

Hans

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16662



More information about the Java-prs mailing list