This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcj/16662] IllegalMonitorStateException in EventQueue.getNextEvent(): possible hash synchronization bug?
- From: "Hans dot Boehm at hp dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Aug 2004 18:30:05 -0000
- Subject: [Bug libgcj/16662] IllegalMonitorStateException in EventQueue.getNextEvent(): possible hash synchronization bug?
- References: <20040721214713.16662.mckinlay@redhat.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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