This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]