harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Salikh Zakirov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2648) [drlvm][threading] Potential race condition in safe-point callback implementation
Date Mon, 19 Feb 2007 17:26:05 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-2648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474236
] 

Salikh Zakirov commented on HARMONY-2648:
-----------------------------------------

As was discovered recently, the current suspend safepoint architecture is fundamentally broken
to use it for running callbacks.
Currently, there are following users of the thread callback:
1) Thread.stop()
2) JVMTI PopFrame
3) Thread shutdown, which boils down to the same code as Thread.stop()

The above users need to throw exception, or modify the thread stack in a similar way (PopFrame).
However, there many suspension safepoints in the VM code, which explicitly prohibit throwing
an exception
(to make sure native locks are released properly), and are equally unprepared to get an exception
object set in TLS.

The number of safepoints which really are prepared to throw an exception is limited:
- back-branch polling sites
- helpers which do push_m2n have an exception-safe point just before pop_m2n
- JNI method invocation stubs have an exception-safe point just before pop_m2n

For the reasons above there is no sense in fixing the model where thread callback is coupled
with thread suspension, because in reality thread callback
has nothing to do with thread suspension (except that stopping a thread may implicitly resume
it). 

Thus I would suggest to close this issue as 'will not fix'

> [drlvm][threading] Potential race condition in safe-point callback implementation
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-2648
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2648
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: All
>            Reporter: Evgueni Brevnov
>         Assigned To: weldon washburn
>         Attachments: safe_point_callback.patch
>
>
> Please read the following thread to understand the problem. Attached patch fixes possible
race conditions but one classlib's test starts to fail org.apache.harmony.luni.tests.java.lang.ThreadGroupTest.test_suspend.
So the patch should be improved to handle this test case correctly.
> Thanks
> Evgueni

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message