Harmony
  1. Harmony
  2. HARMONY-1648

ThreadGroup.stop() does not stop suspended group.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DRLVM
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      If a ThreadGroup contains a few threads and is suspended, then ThreadGroup.stop() does not stop this group.

      The classlib test org.apache.harmony.luni.tests.java.lang.ThreadGroupTest.test_suspend can be used for verification of this bug after HARMONY-1625 is committed.

      To start working on this bug fixing, I'll attach a standalone test.

      1. stop.patch
        8 kB
        Nikolay Kuznetsov
      2. ThreadSuspend.java
        1 kB

        Issue Links

          Activity

          Hide
          Elena Semukhina added a comment -

          I attached the test which reproduces the issue. ThreadGroup.stop() does not stop a suspended group with waiting threads in it.

          HARMONY-1625 fixes classlib luni ThreadGroupTest.test_suspend() so that it does correct cleanup. Then that test will fail due to this issue.

          Show
          Elena Semukhina added a comment - I attached the test which reproduces the issue. ThreadGroup.stop() does not stop a suspended group with waiting threads in it. HARMONY-1625 fixes classlib luni ThreadGroupTest.test_suspend() so that it does correct cleanup. Then that test will fail due to this issue.
          Hide
          Nikolay Kuznetsov added a comment -

          Attached is a cumulative patch for recent Thread.stop issues and includes:
          1) incorrect assertions removal (incorrect hysem_post error handling)
          2) additional exception processing(interpreter exception processing)
          3) synchronized start (start was made synchronous, i.e. when method thread.start exits it's guaranteed that both threads are running)

          Last change is probably should have been made in separate issue(according to j.l.Thread.start specification this method should be synchronous), but since this problem has implication on stop I also included this fix to the patch.

          Since Thread.stop functionality is kind of risky I'd appreciate if reporters make some preliminary testing on this patch.

          Show
          Nikolay Kuznetsov added a comment - Attached is a cumulative patch for recent Thread.stop issues and includes: 1) incorrect assertions removal (incorrect hysem_post error handling) 2) additional exception processing(interpreter exception processing) 3) synchronized start (start was made synchronous, i.e. when method thread.start exits it's guaranteed that both threads are running) Last change is probably should have been made in separate issue(according to j.l.Thread.start specification this method should be synchronous), but since this problem has implication on stop I also included this fix to the patch. Since Thread.stop functionality is kind of risky I'd appreciate if reporters make some preliminary testing on this patch.
          Hide
          Geir Magnusson Jr added a comment -

          r471005

          Ubuntu 6 - smoke, c-unit, ~kernel, test case

          Show
          Geir Magnusson Jr added a comment - r471005 Ubuntu 6 - smoke, c-unit, ~kernel, test case

            People

            • Assignee:
              Geir Magnusson Jr
              Reporter:
              Elena Semukhina
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development