Harmony
  1. Harmony
  2. HARMONY-5018

[drlvm][shutdown] org.apache.harmony.test.stress.vm.threads.StressJoinTest doesn't return correct exit status

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0M4
    • Component/s: VM
    • Labels:
      None
    • Environment:
      win 32, debug build

      Description

      The following test reports incorrect exit status on Harmony VM

      $ build/checkouts/hdk/target/hdk/jdk/jre/bin/java.exe -showversion -Dorg.apache.harmony.test.share.stress.ReliabilityRunner.timeToWork=30 -org.apache.harmony.test.share.stress.ReliabilityRunner.timeToAbort=30 -cp build/classes/stress/classes';build/results/stress/temp;build\classes\stress\classes;build\classes\stress\lib;build\libs\th.jar;build\libs\junit-3.8.2.jar' org.apache.harmony.test.stress.vm.threads.StressJoinTest -numThreads 100 -smallObjSize 500 -freeMem 1000 -sleepTime 3000 -oOMEr on -sOEr on -joinMthd leader logLevel INFO || echo $?
      128

      1. H-5018.patch
        26 kB
        Pavel Afremov
      2. H-5018.patch
        26 kB
        Pavel Afremov
      3. H-5018.patch
        9 kB
        Pavel Afremov

        Activity

        Hide
        Alexei Fedotov added a comment -

        The same shutdown problem appears in the following tests:

        stress.org.apache.harmony.test.stress.threads.StressInterruptTest.withOOME.withSOE.StressInterruptTest04
        stress.org.apache.harmony.test.stress.threads.StressJoinTest.chain.withOOME.withSOE.StressJoinTest04
        stress.org.apache.harmony.test.stress.threads.StressJoinTest.leader.withOOME.withSOE.StressJoinTest08
        stress.org.apache.harmony.test.stress.threads.StressSleepTest.withOOME.withSOE.StressSleepTest04
        stress.org.apache.harmony.test.stress.threads.StressSuspendTest.withOOME.withSOE.StressSuspendTest04
        stress.org.apache.harmony.test.stress.threads.StressSynchronizationTest.combination.withOOME.withSOE.StressSynchronizationTest12
        stress.org.apache.harmony.test.stress.threads.StressSynchronizationTest.synchronized.withOOME.withSOE.StressSynchronizationTest04
        stress.org.apache.harmony.test.stress.threads.StressSynchronizationTest.unsynchronized.withOOME.withSOE.StressSynchronizationTest08
        stress.org.apache.harmony.test.stress.threads.StressWaitNotifyTest.withOOME.withSOE.StressWaitNotifyTest04

        Show
        Alexei Fedotov added a comment - The same shutdown problem appears in the following tests: stress.org.apache.harmony.test.stress.threads.StressInterruptTest.withOOME.withSOE.StressInterruptTest04 stress.org.apache.harmony.test.stress.threads.StressJoinTest.chain.withOOME.withSOE.StressJoinTest04 stress.org.apache.harmony.test.stress.threads.StressJoinTest.leader.withOOME.withSOE.StressJoinTest08 stress.org.apache.harmony.test.stress.threads.StressSleepTest.withOOME.withSOE.StressSleepTest04 stress.org.apache.harmony.test.stress.threads.StressSuspendTest.withOOME.withSOE.StressSuspendTest04 stress.org.apache.harmony.test.stress.threads.StressSynchronizationTest.combination.withOOME.withSOE.StressSynchronizationTest12 stress.org.apache.harmony.test.stress.threads.StressSynchronizationTest.synchronized.withOOME.withSOE.StressSynchronizationTest04 stress.org.apache.harmony.test.stress.threads.StressSynchronizationTest.unsynchronized.withOOME.withSOE.StressSynchronizationTest08 stress.org.apache.harmony.test.stress.threads.StressWaitNotifyTest.withOOME.withSOE.StressWaitNotifyTest04
        Hide
        Pavel Afremov added a comment -

        Can't reproduce the bug.

        Show
        Pavel Afremov added a comment - Can't reproduce the bug.
        Hide
        Gregory Shimansky added a comment -

        Alexei, could you please retry the tests again? I am fairly sure that this bug could've been fixed as a result of other bugfixes in SOE area. In case tests don't fail any more please close this bug.

        Show
        Gregory Shimansky added a comment - Alexei, could you please retry the tests again? I am fairly sure that this bug could've been fixed as a result of other bugfixes in SOE area. In case tests don't fail any more please close this bug.
        Hide
        Pavel Pervov added a comment -

        Can't reproduce it either.

        Show
        Pavel Pervov added a comment - Can't reproduce it either.
        Hide
        Alexei Fedotov added a comment -

        The following tests report 128 at the last run (r599793):

        stress.org.apache.harmony.test.stress.jni.exceptions.ExceptionsTest11
        stress.org.apache.harmony.test.stress.jni.exceptions.ExceptionsTest12
        stress.org.apache.harmony.test.stress.jni.exceptions.ExceptionsTest15
        stress.org.apache.harmony.test.stress.jni.globalrefs.GlobalRefsTest3
        stress.org.apache.harmony.test.stress.jni.globalrefs.GlobalRefsTest4
        stress.org.apache.harmony.test.stress.jni.globalrefs.GlobalRefsTest7
        stress.org.apache.harmony.test.stress.jni.localrefs.LocalRefsTest3
        stress.org.apache.harmony.test.stress.jni.localrefs.LocalRefsTest4

        Show
        Alexei Fedotov added a comment - The following tests report 128 at the last run (r599793): stress.org.apache.harmony.test.stress.jni.exceptions.ExceptionsTest11 stress.org.apache.harmony.test.stress.jni.exceptions.ExceptionsTest12 stress.org.apache.harmony.test.stress.jni.exceptions.ExceptionsTest15 stress.org.apache.harmony.test.stress.jni.globalrefs.GlobalRefsTest3 stress.org.apache.harmony.test.stress.jni.globalrefs.GlobalRefsTest4 stress.org.apache.harmony.test.stress.jni.globalrefs.GlobalRefsTest7 stress.org.apache.harmony.test.stress.jni.localrefs.LocalRefsTest3 stress.org.apache.harmony.test.stress.jni.localrefs.LocalRefsTest4
        Hide
        Alexei Fedotov added a comment -

        I have tried to run the test manually and reproduced the bug crash on shutdown using -Dorg.apache.harmony.test.share.stress.ReliabilityRunner.params="org.apache.harmony.test.stress.jni.localrefs.LocalRefsTest3 {}"

        Show
        Alexei Fedotov added a comment - I have tried to run the test manually and reproduced the bug crash on shutdown using -Dorg.apache.harmony.test.share.stress.ReliabilityRunner.params="org.apache.harmony.test.stress.jni.localrefs.LocalRefsTest3 {}"
        Hide
        Pavel Afremov added a comment -

        I don't see any crash but incorrect exit code only. I'm evaluating it now.

        Show
        Pavel Afremov added a comment - I don't see any crash but incorrect exit code only. I'm evaluating it now.
        Hide
        Pavel Afremov added a comment -

        1. Test is incorrect. In its JNI part, test occupies all native memory and doesn't process OutOfMemoryError.
        2. It's not a regression. There is no revision where test works. I checked it on debug build of DRLVM revision 580985, which corresponds Apache Harmony 5.0M3.
        3. Minor bug in JNI implementation was found and fixed (see attached patch). But VM work is still unstable, because no free native memory exists, because test occupies and don't free native memory. To Fix this feature Native Memory Manager should be implemented.
        4. JRockit crashes on this test. The RI works incorrect too.
        It's Output is following:

        [debug] Stopping the test
        [debug] Cannot stop all threads, possibly deadlock occurs. VM will be aborted.

        In debug build DRLVM asserts and returns incorrect exit code (0x03). In release build DRLVM shows following output :

        [debug] Stopping the test
        Native code: NULL returned at i=2614418
        ....
        Native code: NULL returned at i=1840568
        [debug] Cannot stop all threads, possibly deadlock occurs. VM will be aborted.

        Output is the same as on RI. Exit code is correct.

        5. Evaluated feature doesn't match original bug description. So "3 exit code" issue is partly fixed, but "128 exit code" should be evaluated additionaly.

        Show
        Pavel Afremov added a comment - 1. Test is incorrect. In its JNI part, test occupies all native memory and doesn't process OutOfMemoryError. 2. It's not a regression. There is no revision where test works. I checked it on debug build of DRLVM revision 580985, which corresponds Apache Harmony 5.0M3. 3. Minor bug in JNI implementation was found and fixed (see attached patch). But VM work is still unstable, because no free native memory exists, because test occupies and don't free native memory. To Fix this feature Native Memory Manager should be implemented. 4. JRockit crashes on this test. The RI works incorrect too. It's Output is following: [debug] Stopping the test [debug] Cannot stop all threads, possibly deadlock occurs. VM will be aborted. In debug build DRLVM asserts and returns incorrect exit code (0x03). In release build DRLVM shows following output : [debug] Stopping the test Native code: NULL returned at i=2614418 .... Native code: NULL returned at i=1840568 [debug] Cannot stop all threads, possibly deadlock occurs. VM will be aborted. Output is the same as on RI. Exit code is correct. 5. Evaluated feature doesn't match original bug description. So "3 exit code" issue is partly fixed, but "128 exit code" should be evaluated additionaly.
        Hide
        Pavel Afremov added a comment -

        Improved fix.
        1. Debug build returns correct exit code.
        2. Reduced native heap usage for stack iterations
        3. Fixed found memory leaks.

        Show
        Pavel Afremov added a comment - Improved fix. 1. Debug build returns correct exit code. 2. Reduced native heap usage for stack iterations 3. Fixed found memory leaks.
        Hide
        Pavel Afremov added a comment -

        Fixed and tested on 4 platforms patch.

        Show
        Pavel Afremov added a comment - Fixed and tested on 4 platforms patch.
        Hide
        Gregory Shimansky added a comment -

        Patch is applied at 601774. Please check that the bug is fixed for you.

        Show
        Gregory Shimansky added a comment - Patch is applied at 601774. Please check that the bug is fixed for you.
        Hide
        Alexei Fedotov added a comment -

        Pavel, thank you for the fix. Only three tests continue to fail with crash error codes.

        Tests completed with exit code which is not recognized by harness as known test execution code
        1 TEST-stress.org.apache.harmony.test.stress.jni.exceptions.ExceptionsTest16.xml (128)
        2 TEST-stress.org.apache.harmony.test.stress.jni.globalrefs.GlobalRefsTest3.xml (3)
        3 TEST-stress.org.apache.harmony.test.stress.jni.globalrefs.GlobalRefsTest4.xml (3)

        Show
        Alexei Fedotov added a comment - Pavel, thank you for the fix. Only three tests continue to fail with crash error codes. Tests completed with exit code which is not recognized by harness as known test execution code 1 TEST-stress.org.apache.harmony.test.stress.jni.exceptions.ExceptionsTest16.xml (128) 2 TEST-stress.org.apache.harmony.test.stress.jni.globalrefs.GlobalRefsTest3.xml (3) 3 TEST-stress.org.apache.harmony.test.stress.jni.globalrefs.GlobalRefsTest4.xml (3)

          People

          • Assignee:
            Gregory Shimansky
            Reporter:
            Alexei Fedotov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development