You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Eugene S. Ostrovsky (JIRA)" <ji...@apache.org> on 2007/03/13 13:03:11 UTC

[jira] Created: (HARMONY-3381) [drlvm][shutdown] unsafe termination of daemon threads

[drlvm][shutdown] unsafe termination of daemon threads
------------------------------------------------------

                 Key: HARMONY-3381
                 URL: https://issues.apache.org/jira/browse/HARMONY-3381
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
            Reporter: Eugene S. Ostrovsky


vm_shutdown_stop_java_threads() function tries to terminate daemon threads by setting TheadDeath exception to them and interrupting in infinite loop.
1. There's a race condition in this algorithm: No one can guarantee that continuous setting TheadDeath exception to a thread will force it to terminate.
2. TheadDeath is throwing in the points that may not be safe for exception throwing. This may lead to vm crash (or assertion). 
( Such crash was reproduced on win/ia32 on gc.Mark smoke test with the patch from HARMONY-3297)

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


[jira] Assigned: (HARMONY-3381) [drlvm][shutdown] unsafe termination of daemon threads

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky reassigned HARMONY-3381:
------------------------------------------

    Assignee: Gregory Shimansky

> [drlvm][shutdown] unsafe termination of daemon threads
> ------------------------------------------------------
>
>                 Key: HARMONY-3381
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3381
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Eugene S. Ostrovsky
>         Assigned To: Gregory Shimansky
>         Attachments: changing-shutdown-to-exit-threads-instead-of-throwing-exception.patch
>
>
> vm_shutdown_stop_java_threads() function tries to terminate daemon threads by setting TheadDeath exception to them and interrupting in infinite loop.
> 1. There's a race condition in this algorithm: No one can guarantee that continuous setting TheadDeath exception to a thread will force it to terminate.
> 2. TheadDeath is throwing in the points that may not be safe for exception throwing. This may lead to vm crash (or assertion). 
> ( Such crash was reproduced on win/ia32 on gc.Mark smoke test with the patch from HARMONY-3297)

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


[jira] Updated: (HARMONY-3381) [drlvm][shutdown] unsafe termination of daemon threads

Posted by "Eugene S. Ostrovsky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugene S. Ostrovsky updated HARMONY-3381:
-----------------------------------------

    Attachment: H-3381-code-style-fix.patch

Applied good.

Found out that code style is wrong.
Please commit the fix:
H-3381-code-style-fix.patch

> [drlvm][shutdown] unsafe termination of daemon threads
> ------------------------------------------------------
>
>                 Key: HARMONY-3381
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3381
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Eugene S. Ostrovsky
>         Assigned To: Gregory Shimansky
>         Attachments: changing-shutdown-to-exit-threads-instead-of-throwing-exception.patch, H-3381-code-style-fix.patch
>
>
> vm_shutdown_stop_java_threads() function tries to terminate daemon threads by setting TheadDeath exception to them and interrupting in infinite loop.
> 1. There's a race condition in this algorithm: No one can guarantee that continuous setting TheadDeath exception to a thread will force it to terminate.
> 2. TheadDeath is throwing in the points that may not be safe for exception throwing. This may lead to vm crash (or assertion). 
> ( Such crash was reproduced on win/ia32 on gc.Mark smoke test with the patch from HARMONY-3297)

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


[jira] Resolved: (HARMONY-3381) [drlvm][shutdown] unsafe termination of daemon threads

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky resolved HARMONY-3381.
----------------------------------------

    Resolution: Fixed

Patch applied at 517777. Please check that it was applied as expected.

> [drlvm][shutdown] unsafe termination of daemon threads
> ------------------------------------------------------
>
>                 Key: HARMONY-3381
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3381
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Eugene S. Ostrovsky
>         Assigned To: Gregory Shimansky
>         Attachments: changing-shutdown-to-exit-threads-instead-of-throwing-exception.patch
>
>
> vm_shutdown_stop_java_threads() function tries to terminate daemon threads by setting TheadDeath exception to them and interrupting in infinite loop.
> 1. There's a race condition in this algorithm: No one can guarantee that continuous setting TheadDeath exception to a thread will force it to terminate.
> 2. TheadDeath is throwing in the points that may not be safe for exception throwing. This may lead to vm crash (or assertion). 
> ( Such crash was reproduced on win/ia32 on gc.Mark smoke test with the patch from HARMONY-3297)

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


[jira] Updated: (HARMONY-3381) [drlvm][shutdown] unsafe termination of daemon threads

Posted by "Eugene S. Ostrovsky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugene S. Ostrovsky updated HARMONY-3381:
-----------------------------------------

    Attachment: changing-shutdown-to-exit-threads-instead-of-throwing-exception.patch

Added patch:
  changing-shutdown-to-exit-threads-instead-of-throwing-exception.patch

Implements new daemon threads termination approach:
1. running threads exit in safe points
2. blocked threads are cancelled

> [drlvm][shutdown] unsafe termination of daemon threads
> ------------------------------------------------------
>
>                 Key: HARMONY-3381
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3381
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Eugene S. Ostrovsky
>         Attachments: changing-shutdown-to-exit-threads-instead-of-throwing-exception.patch
>
>
> vm_shutdown_stop_java_threads() function tries to terminate daemon threads by setting TheadDeath exception to them and interrupting in infinite loop.
> 1. There's a race condition in this algorithm: No one can guarantee that continuous setting TheadDeath exception to a thread will force it to terminate.
> 2. TheadDeath is throwing in the points that may not be safe for exception throwing. This may lead to vm crash (or assertion). 
> ( Such crash was reproduced on win/ia32 on gc.Mark smoke test with the patch from HARMONY-3297)

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


[jira] Closed: (HARMONY-3381) [drlvm][shutdown] unsafe termination of daemon threads

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky closed HARMONY-3381.
--------------------------------------


2nd patch applied at 518178. Closing as verified.

> [drlvm][shutdown] unsafe termination of daemon threads
> ------------------------------------------------------
>
>                 Key: HARMONY-3381
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3381
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Eugene S. Ostrovsky
>         Assigned To: Gregory Shimansky
>         Attachments: changing-shutdown-to-exit-threads-instead-of-throwing-exception.patch, H-3381-code-style-fix.patch
>
>
> vm_shutdown_stop_java_threads() function tries to terminate daemon threads by setting TheadDeath exception to them and interrupting in infinite loop.
> 1. There's a race condition in this algorithm: No one can guarantee that continuous setting TheadDeath exception to a thread will force it to terminate.
> 2. TheadDeath is throwing in the points that may not be safe for exception throwing. This may lead to vm crash (or assertion). 
> ( Such crash was reproduced on win/ia32 on gc.Mark smoke test with the patch from HARMONY-3297)

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


[jira] Updated: (HARMONY-3381) [drlvm][shutdown] unsafe termination of daemon threads

Posted by "Eugene S. Ostrovsky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugene S. Ostrovsky updated HARMONY-3381:
-----------------------------------------

    Patch Info: [Patch Available]

> [drlvm][shutdown] unsafe termination of daemon threads
> ------------------------------------------------------
>
>                 Key: HARMONY-3381
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3381
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Eugene S. Ostrovsky
>         Attachments: changing-shutdown-to-exit-threads-instead-of-throwing-exception.patch
>
>
> vm_shutdown_stop_java_threads() function tries to terminate daemon threads by setting TheadDeath exception to them and interrupting in infinite loop.
> 1. There's a race condition in this algorithm: No one can guarantee that continuous setting TheadDeath exception to a thread will force it to terminate.
> 2. TheadDeath is throwing in the points that may not be safe for exception throwing. This may lead to vm crash (or assertion). 
> ( Such crash was reproduced on win/ia32 on gc.Mark smoke test with the patch from HARMONY-3297)

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