[drlvm] Throw exception outside of HWE handler to avoid deadlocks on Windows XP
-------------------------------------------------------------------------------
Key: HARMONY-2320
URL: http://issues.apache.org/jira/browse/HARMONY-2320
Project: Harmony
Issue Type: Sub-task
Environment: Windows XP
Reporter: Salikh Zakirov
The reason of hang of gc.LOS is deadlock on a thread suspension:
Assume thread A handles NPE:
A1) segfault occured
A2) grab "system hwe lock" and call vectored_exception_handler
A3) instantiate NullPointerException object
A4) set up throwing NullPointerExceptionObject in the register snapshot
A5) return from vectored_exception_handler release "system hwe lock"
Let's next assume that garbage collection was started exactly when thread A
was in progress of running NullPointerException constructor (A3). Then, thread A
will be suspended while still holding "system hwe lock".
Another thread B at that moment have just perfomed access to null pointer (B1),
and then it is blocked on a "system hwe lock" (B2),
Since this lock is system and not known to Thread Manager, the thread C which tries to start
garbage
collection and so requested suspension of all threads, and then waits forever for thread B
to reach a safepoint,
while B is waiting for thread A to release "system hwe lock", and thread A was already suspended
and waits
for thread C to resume it.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|