Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-1741

Classlib test org.apache.harmony.luni.tests.java.lang.ThreadTest.test_suspend() hangs

    Details

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

      Description

      Hangs on windows/linux.

      I expected that itis fixed with H-1519 but it is not.

      I'll attach a standalone test to reproduce the issue.

      1. TestSuspend.java
        0.6 kB
        Elena Semukhina
      2. unsync_suspend.patch
        1 kB
        Artem Aliev

        Activity

        Hide
        elena Elena Semukhina added a comment -

        test to reproduce attached.

        Show
        elena Elena Semukhina added a comment - test to reproduce attached.
        Hide
        leshik Alexei Fedotov added a comment -

        [drlvm][unit] Blocks http://wiki.apache.org/harmony/Unit_Tests_Pass_on_DRLVM

        This issue could be related to http://issues.apache.org/jira/browse/HARMONY-1669. Although, the fix from that issue doesn't fix anything on Linux.

        Show
        leshik Alexei Fedotov added a comment - [drlvm] [unit] Blocks http://wiki.apache.org/harmony/Unit_Tests_Pass_on_DRLVM This issue could be related to http://issues.apache.org/jira/browse/HARMONY-1669 . Although, the fix from that issue doesn't fix anything on Linux.
        Hide
        artem.aliev Artem Aliev added a comment -

        Methods suspend() and resume() were synchronized in j.l.Thread,
        so if thread suspends itself, it were suspended under lock, so no one could resumes it or calls other methods. Attached patch removes the synchronization from resume() and suspend(). The synchronization is already done in hythread calls.

        Show
        artem.aliev Artem Aliev added a comment - Methods suspend() and resume() were synchronized in j.l.Thread, so if thread suspends itself, it were suspended under lock, so no one could resumes it or calls other methods. Attached patch removes the synchronization from resume() and suspend(). The synchronization is already done in hythread calls.
        Hide
        elena Elena Semukhina added a comment -

        I tried the patch, TestSuspend passes; classlib test ThreadTest.test_suspend() passes; cunit, smoke, kernel tests as expected.

        Show
        elena Elena Semukhina added a comment - I tried the patch, TestSuspend passes; classlib test ThreadTest.test_suspend() passes; cunit, smoke, kernel tests as expected.
        Hide
        varlax Alexey Varlamov added a comment -

        I wonder if we should remove synchronization blocks from some other methods as well - like stop() or interrupt(). I do not grok why these synchronizations needed.

        Show
        varlax Alexey Varlamov added a comment - I wonder if we should remove synchronization blocks from some other methods as well - like stop() or interrupt(). I do not grok why these synchronizations needed.
        Hide
        geir Geir Magnusson Jr added a comment -

        r464715

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

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

        Before I resolve, can someone agree that current failres in kernel j.u.ThreadTest not realted to this fix

        Show
        geir Geir Magnusson Jr added a comment - Before I resolve, can someone agree that current failres in kernel j.u.ThreadTest not realted to this fix
        Hide
        hindessm Mark Hindess added a comment -

        Closing as this test works for me now.

        Show
        hindessm Mark Hindess added a comment - Closing as this test works for me now.

          People

          • Assignee:
            Unassigned
            Reporter:
            elena Elena Semukhina
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development