Harmony
  1. Harmony
  2. HARMONY-1669

Classlib test tests/api/java/io/PipedInputStreamTest hangs on Windows 2003

    Details

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

      Description

      Classlib test tests/api/java/io/PipedInputStreamTest hangs on
      2xXeon x64 (Woodcrest B, 2cores) / Bensley SDV, RAM: 4096MB, HDD: 120GB
      OS Windows 2003 32-bit SP1
      The test passes on my Windows XP.

      To reproduce the issue please run
      ant -Dtest.jre.home=%DRLVM_HOME% -Dbuild.module=luni -Dtest.case=tests.api.java.io.PipedInputStreamTest test

      NOTE: sometimes test passes.

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

      1. win32cyclic_suspend.patch
        2 kB
        Artem Aliev
      2. TestPipedInput1.java
        2 kB
        Elena Semukhina

        Activity

        Alexey Varlamov made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Alexey Varlamov added a comment -

        I cleaned the patch as suggested and applied at r476121.
        Please verify.

        Show
        Alexey Varlamov added a comment - I cleaned the patch as suggested and applied at r476121. Please verify.
        Hide
        Artem Aliev added a comment -

        > Regarding the style, I'd prefer to declare pointer to critical section as static right there it is used, rather than juggle with initialization flags.
        I do not know how to initialize static fields in the portlib at startup.
        Suggestion?

        > Also, convert_priority() looks like a complete bogus - why didn't you just drop it?
        There is no convert_priority() in the patch. Could you file a separate issue for this question.

        Show
        Artem Aliev added a comment - > Regarding the style, I'd prefer to declare pointer to critical section as static right there it is used, rather than juggle with initialization flags. I do not know how to initialize static fields in the portlib at startup. Suggestion? > Also, convert_priority() looks like a complete bogus - why didn't you just drop it? There is no convert_priority() in the patch. Could you file a separate issue for this question.
        Hide
        Alexey Varlamov added a comment -

        Yep, technically the solution looks rigth.
        Regarding the style, I'd prefer to declare pointer to critical section as static right there it is used, rather than juggle with initialization flags. Also, convert_priority() looks like a complete bogus - why didn't you just drop it?

        Show
        Alexey Varlamov added a comment - Yep, technically the solution looks rigth. Regarding the style, I'd prefer to declare pointer to critical section as static right there it is used, rather than juggle with initialization flags. Also, convert_priority() looks like a complete bogus - why didn't you just drop it?
        Alexey Varlamov made changes -
        Assignee Alexey Varlamov [ varlax ]
        Elena Semukhina made changes -
        Patch Info [Patch Available]
        Hide
        Alexei Fedotov added a comment -

        I was a bit surprised to find the following in text MSDN
        http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/profilerwp.asp

        Problem 2: While you suspend the target thread, the target thread tries to suspend you.
        You might say, "That can't happen!" Believe it or not, it can, if:

        Your application runs on a multiprocessor box, and
        Thread A runs on one processor and Thread B runs on another, and
        Thread A tries to suspend Thread B while Thread B tries to suspend Thread A.

        I like Windows* This validates the patch.

        Show
        Alexei Fedotov added a comment - I was a bit surprised to find the following in text MSDN http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/profilerwp.asp Problem 2: While you suspend the target thread, the target thread tries to suspend you. You might say, "That can't happen!" Believe it or not, it can, if: Your application runs on a multiprocessor box, and Thread A runs on one processor and Thread B runs on another, and Thread A tries to suspend Thread B while Thread B tries to suspend Thread A. I like Windows* This validates the patch.
        Hide
        Alexei Fedotov added a comment -
        Show
        Alexei Fedotov added a comment - [drlvm] [unit] Blocks http://wiki.apache.org/harmony/Unit_Tests_Pass_on_DRLVM
        Artem Aliev made changes -
        Attachment win32cyclic_suspend.patch [ 12342452 ]
        Hide
        Artem Aliev added a comment -

        The win32 SuspendThread has cyclic suspend problem (as we have recently)
        I add synchronization to solve the problem.
        The test passed.

        Show
        Artem Aliev added a comment - The win32 SuspendThread has cyclic suspend problem (as we have recently) I add synchronization to solve the problem. The test passed.
        Hide
        Alexei Fedotov added a comment -

        My quick guess is that server likely has more processor power, so it is a better candidate for any race condition.

        Show
        Alexei Fedotov added a comment - My quick guess is that server likely has more processor power, so it is a better candidate for any race condition.
        Hide
        Elena Semukhina added a comment -

        Could not reproduce on XP. Neither on linux.

        Show
        Elena Semukhina added a comment - Could not reproduce on XP. Neither on linux.
        Hide
        Geir Magnusson Jr added a comment -

        onlyon 2003? Any time on XP?

        Show
        Geir Magnusson Jr added a comment - onlyon 2003? Any time on XP?
        Elena Semukhina made changes -
        Field Original Value New Value
        Attachment TestPipedInput1.java [ 12342172 ]
        Hide
        Elena Semukhina added a comment -

        the test attached.

        Show
        Elena Semukhina added a comment - the test attached.
        Elena Semukhina created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development