You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ivan Popov (JIRA)" <ji...@apache.org> on 2007/06/05 14:49:26 UTC

[jira] Created: (HARMONY-4046) [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest

[jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
-------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-4046
                 URL: https://issues.apache.org/jira/browse/HARMONY-4046
             Project: Harmony
          Issue Type: Bug
          Components: JDK
         Environment: Windows/x86, harmony-jdk-r544417
            Reporter: Ivan Popov


After HARMONY-3314 was fixed, I noticed that one particular JDWP test

    org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest

intermittently fails on Windows/x86, especially on a slow single-cpu WinXP machine and T41p laptop.

The failure symptoms are similar to HARMONY-3314 - debuggee VM process hangs on exit and test throws exception:

org.apache.harmony.jpda.tests.framework.TestErrorException: Debuggee process did not finish during timeout   
 at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:212)   
 at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
 at org.apache.harmony.jpda.tests.jdwp.share.JDWPTestCase.internalTearDown(JDWPTestCase.java:84)   
 at org.apache.harmony.jpda.tests.jdwp.share.JDWPSyncTestCase.internalTearDown(JDWPSyncTestCase.java:75)   
 at org.apache.harmony.jpda.tests.jdwp.share.JDWPRawTestCase.tearDown(JDWPRawTestCase.java:110)   
Caused by: java.lang.IllegalThreadStateException: process has not exited   
 at java.lang.Runtime$SubProcess.exitValue(Runtime.java:357)   
 at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:207)   
 at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
 ... 13 more 

However, Java stack is different. I could not to print it with MSVC debugger, but I was able to reconstruct it from interpreter frames (the test fails with both JIT and interpreter). Java stack looks like the following:

    VMThreadManager.wait()
    Object.wait()
    InterruptDebuggee.run()
    Debuggee.runDebuggee()
    InterruptDebiggee.main()

It shows that debuggee VM is actually waiting on a monitor in method run() of the tested class InterruptDebuggee:

    public void run() {
        DebuggeeThread thrd = new DebuggeeThread(TESTED_THREAD,
                logWriter, synchronizer); 
        
        synchronized(waitForStart){
            thrd.start();
            try {
                waitForStart.wait();
            } catch (InterruptedException e) {
            }
        }

        synchronized(waitForFinish){
            logWriter.println("thread is finished");
        }
    }

It's strange result, because waitForStart.wait() should be completed by notification from the started thread in its run() method:

        public void run() {
            synchronized(InterruptDebuggee.waitForFinish){
                synchronized(InterruptDebuggee.waitForStart){
                    InterruptDebuggee.waitForStart.notifyAll();
                    <...>
                }
            }
        }

It seems like race condition in implementation of Object.wait().


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


[jira] Reopened: (HARMONY-4046) [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest

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

Gregory Shimansky reopened HARMONY-4046:
----------------------------------------


Oops, I shouldn't have closed the bug since the patch is just an exclusion of the test. So the issue is reopened.

> [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4046
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4046
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, harmony-jdk-r544417
>            Reporter: Ivan Popov
>            Assignee: Gregory Shimansky
>         Attachments: jpda_test_exclude.patch
>
>
> After HARMONY-3314 was fixed, I noticed that one particular JDWP test
>     org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> intermittently fails on Windows/x86, especially on a slow single-cpu WinXP machine and T41p laptop.
> The failure symptoms are similar to HARMONY-3314 - debuggee VM process hangs on exit and test throws exception:
> org.apache.harmony.jpda.tests.framework.TestErrorException: Debuggee process did not finish during timeout   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:212)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPTestCase.internalTearDown(JDWPTestCase.java:84)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPSyncTestCase.internalTearDown(JDWPSyncTestCase.java:75)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPRawTestCase.tearDown(JDWPRawTestCase.java:110)   
> Caused by: java.lang.IllegalThreadStateException: process has not exited   
>  at java.lang.Runtime$SubProcess.exitValue(Runtime.java:357)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:207)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  ... 13 more 
> However, Java stack is different. I could not to print it with MSVC debugger, but I was able to reconstruct it from interpreter frames (the test fails with both JIT and interpreter). Java stack looks like the following:
>     VMThreadManager.wait()
>     Object.wait()
>     InterruptDebuggee.run()
>     Debuggee.runDebuggee()
>     InterruptDebiggee.main()
> It shows that debuggee VM is actually waiting on a monitor in method run() of the tested class InterruptDebuggee:
>     public void run() {
>         DebuggeeThread thrd = new DebuggeeThread(TESTED_THREAD,
>                 logWriter, synchronizer); 
>         
>         synchronized(waitForStart){
>             thrd.start();
>             try {
>                 waitForStart.wait();
>             } catch (InterruptedException e) {
>             }
>         }
>         synchronized(waitForFinish){
>             logWriter.println("thread is finished");
>         }
>     }
> It's strange result, because waitForStart.wait() should be completed by notification from the started thread in its run() method:
>         public void run() {
>             synchronized(InterruptDebuggee.waitForFinish){
>                 synchronized(InterruptDebuggee.waitForStart){
>                     InterruptDebuggee.waitForStart.notifyAll();
>                     <...>
>                 }
>             }
>         }
> It seems like race condition in implementation of Object.wait().

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


[jira] Resolved: (HARMONY-4046) [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest

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

Gregory Shimansky resolved HARMONY-4046.
----------------------------------------

    Resolution: Fixed

I've applied test improvement at 548714. I think we can resolve this particular issue because Andrey has opened a separate bug on VM with a test to reproduce it.

> [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4046
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4046
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, harmony-jdk-r544417
>            Reporter: Ivan Popov
>            Assignee: Gregory Shimansky
>         Attachments: 4046.patch, jpda_test_exclude.patch
>
>
> After HARMONY-3314 was fixed, I noticed that one particular JDWP test
>     org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> intermittently fails on Windows/x86, especially on a slow single-cpu WinXP machine and T41p laptop.
> The failure symptoms are similar to HARMONY-3314 - debuggee VM process hangs on exit and test throws exception:
> org.apache.harmony.jpda.tests.framework.TestErrorException: Debuggee process did not finish during timeout   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:212)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPTestCase.internalTearDown(JDWPTestCase.java:84)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPSyncTestCase.internalTearDown(JDWPSyncTestCase.java:75)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPRawTestCase.tearDown(JDWPRawTestCase.java:110)   
> Caused by: java.lang.IllegalThreadStateException: process has not exited   
>  at java.lang.Runtime$SubProcess.exitValue(Runtime.java:357)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:207)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  ... 13 more 
> However, Java stack is different. I could not to print it with MSVC debugger, but I was able to reconstruct it from interpreter frames (the test fails with both JIT and interpreter). Java stack looks like the following:
>     VMThreadManager.wait()
>     Object.wait()
>     InterruptDebuggee.run()
>     Debuggee.runDebuggee()
>     InterruptDebiggee.main()
> It shows that debuggee VM is actually waiting on a monitor in method run() of the tested class InterruptDebuggee:
>     public void run() {
>         DebuggeeThread thrd = new DebuggeeThread(TESTED_THREAD,
>                 logWriter, synchronizer); 
>         
>         synchronized(waitForStart){
>             thrd.start();
>             try {
>                 waitForStart.wait();
>             } catch (InterruptedException e) {
>             }
>         }
>         synchronized(waitForFinish){
>             logWriter.println("thread is finished");
>         }
>     }
> It's strange result, because waitForStart.wait() should be completed by notification from the started thread in its run() method:
>         public void run() {
>             synchronized(InterruptDebuggee.waitForFinish){
>                 synchronized(InterruptDebuggee.waitForStart){
>                     InterruptDebuggee.waitForStart.notifyAll();
>                     <...>
>                 }
>             }
>         }
> It seems like race condition in implementation of Object.wait().

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


[jira] Updated: (HARMONY-4046) [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest

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

Ivan Popov updated HARMONY-4046:
--------------------------------

    Attachment: jpda_test_exclude.patch

I'm attaching patch 'jpda_test_exclude.patch' to exclude this test from CC runs until the problem is identified and fixed.

> [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4046
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4046
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, harmony-jdk-r544417
>            Reporter: Ivan Popov
>         Attachments: jpda_test_exclude.patch
>
>
> After HARMONY-3314 was fixed, I noticed that one particular JDWP test
>     org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> intermittently fails on Windows/x86, especially on a slow single-cpu WinXP machine and T41p laptop.
> The failure symptoms are similar to HARMONY-3314 - debuggee VM process hangs on exit and test throws exception:
> org.apache.harmony.jpda.tests.framework.TestErrorException: Debuggee process did not finish during timeout   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:212)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPTestCase.internalTearDown(JDWPTestCase.java:84)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPSyncTestCase.internalTearDown(JDWPSyncTestCase.java:75)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPRawTestCase.tearDown(JDWPRawTestCase.java:110)   
> Caused by: java.lang.IllegalThreadStateException: process has not exited   
>  at java.lang.Runtime$SubProcess.exitValue(Runtime.java:357)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:207)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  ... 13 more 
> However, Java stack is different. I could not to print it with MSVC debugger, but I was able to reconstruct it from interpreter frames (the test fails with both JIT and interpreter). Java stack looks like the following:
>     VMThreadManager.wait()
>     Object.wait()
>     InterruptDebuggee.run()
>     Debuggee.runDebuggee()
>     InterruptDebiggee.main()
> It shows that debuggee VM is actually waiting on a monitor in method run() of the tested class InterruptDebuggee:
>     public void run() {
>         DebuggeeThread thrd = new DebuggeeThread(TESTED_THREAD,
>                 logWriter, synchronizer); 
>         
>         synchronized(waitForStart){
>             thrd.start();
>             try {
>                 waitForStart.wait();
>             } catch (InterruptedException e) {
>             }
>         }
>         synchronized(waitForFinish){
>             logWriter.println("thread is finished");
>         }
>     }
> It's strange result, because waitForStart.wait() should be completed by notification from the started thread in its run() method:
>         public void run() {
>             synchronized(InterruptDebuggee.waitForFinish){
>                 synchronized(InterruptDebuggee.waitForStart){
>                     InterruptDebuggee.waitForStart.notifyAll();
>                     <...>
>                 }
>             }
>         }
> It seems like race condition in implementation of Object.wait().

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


[jira] Assigned: (HARMONY-4046) [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest

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

Gregory Shimansky reassigned HARMONY-4046:
------------------------------------------

    Assignee: Gregory Shimansky

> [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4046
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4046
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, harmony-jdk-r544417
>            Reporter: Ivan Popov
>            Assignee: Gregory Shimansky
>         Attachments: jpda_test_exclude.patch
>
>
> After HARMONY-3314 was fixed, I noticed that one particular JDWP test
>     org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> intermittently fails on Windows/x86, especially on a slow single-cpu WinXP machine and T41p laptop.
> The failure symptoms are similar to HARMONY-3314 - debuggee VM process hangs on exit and test throws exception:
> org.apache.harmony.jpda.tests.framework.TestErrorException: Debuggee process did not finish during timeout   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:212)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPTestCase.internalTearDown(JDWPTestCase.java:84)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPSyncTestCase.internalTearDown(JDWPSyncTestCase.java:75)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPRawTestCase.tearDown(JDWPRawTestCase.java:110)   
> Caused by: java.lang.IllegalThreadStateException: process has not exited   
>  at java.lang.Runtime$SubProcess.exitValue(Runtime.java:357)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:207)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  ... 13 more 
> However, Java stack is different. I could not to print it with MSVC debugger, but I was able to reconstruct it from interpreter frames (the test fails with both JIT and interpreter). Java stack looks like the following:
>     VMThreadManager.wait()
>     Object.wait()
>     InterruptDebuggee.run()
>     Debuggee.runDebuggee()
>     InterruptDebiggee.main()
> It shows that debuggee VM is actually waiting on a monitor in method run() of the tested class InterruptDebuggee:
>     public void run() {
>         DebuggeeThread thrd = new DebuggeeThread(TESTED_THREAD,
>                 logWriter, synchronizer); 
>         
>         synchronized(waitForStart){
>             thrd.start();
>             try {
>                 waitForStart.wait();
>             } catch (InterruptedException e) {
>             }
>         }
>         synchronized(waitForFinish){
>             logWriter.println("thread is finished");
>         }
>     }
> It's strange result, because waitForStart.wait() should be completed by notification from the started thread in its run() method:
>         public void run() {
>             synchronized(InterruptDebuggee.waitForFinish){
>                 synchronized(InterruptDebuggee.waitForStart){
>                     InterruptDebuggee.waitForStart.notifyAll();
>                     <...>
>                 }
>             }
>         }
> It seems like race condition in implementation of Object.wait().

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


[jira] Closed: (HARMONY-4046) [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest

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

Ivan Popov closed HARMONY-4046.
-------------------------------


Thanks, Andrey, Gregory.
Verified in harmony-jdk-r548946, closing this issue.

> [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4046
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4046
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, harmony-jdk-r544417
>            Reporter: Ivan Popov
>            Assignee: Gregory Shimansky
>         Attachments: 4046.patch, jpda_test_exclude.patch
>
>
> After HARMONY-3314 was fixed, I noticed that one particular JDWP test
>     org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> intermittently fails on Windows/x86, especially on a slow single-cpu WinXP machine and T41p laptop.
> The failure symptoms are similar to HARMONY-3314 - debuggee VM process hangs on exit and test throws exception:
> org.apache.harmony.jpda.tests.framework.TestErrorException: Debuggee process did not finish during timeout   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:212)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPTestCase.internalTearDown(JDWPTestCase.java:84)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPSyncTestCase.internalTearDown(JDWPSyncTestCase.java:75)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPRawTestCase.tearDown(JDWPRawTestCase.java:110)   
> Caused by: java.lang.IllegalThreadStateException: process has not exited   
>  at java.lang.Runtime$SubProcess.exitValue(Runtime.java:357)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:207)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  ... 13 more 
> However, Java stack is different. I could not to print it with MSVC debugger, but I was able to reconstruct it from interpreter frames (the test fails with both JIT and interpreter). Java stack looks like the following:
>     VMThreadManager.wait()
>     Object.wait()
>     InterruptDebuggee.run()
>     Debuggee.runDebuggee()
>     InterruptDebiggee.main()
> It shows that debuggee VM is actually waiting on a monitor in method run() of the tested class InterruptDebuggee:
>     public void run() {
>         DebuggeeThread thrd = new DebuggeeThread(TESTED_THREAD,
>                 logWriter, synchronizer); 
>         
>         synchronized(waitForStart){
>             thrd.start();
>             try {
>                 waitForStart.wait();
>             } catch (InterruptedException e) {
>             }
>         }
>         synchronized(waitForFinish){
>             logWriter.println("thread is finished");
>         }
>     }
> It's strange result, because waitForStart.wait() should be completed by notification from the started thread in its run() method:
>         public void run() {
>             synchronized(InterruptDebuggee.waitForFinish){
>                 synchronized(InterruptDebuggee.waitForStart){
>                     InterruptDebuggee.waitForStart.notifyAll();
>                     <...>
>                 }
>             }
>         }
> It seems like race condition in implementation of Object.wait().

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


[jira] Closed: (HARMONY-4046) [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest

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

Gregory Shimansky closed HARMONY-4046.
--------------------------------------

    Resolution: Fixed

Patch has been applied at 544813.

> [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4046
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4046
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, harmony-jdk-r544417
>            Reporter: Ivan Popov
>            Assignee: Gregory Shimansky
>         Attachments: jpda_test_exclude.patch
>
>
> After HARMONY-3314 was fixed, I noticed that one particular JDWP test
>     org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> intermittently fails on Windows/x86, especially on a slow single-cpu WinXP machine and T41p laptop.
> The failure symptoms are similar to HARMONY-3314 - debuggee VM process hangs on exit and test throws exception:
> org.apache.harmony.jpda.tests.framework.TestErrorException: Debuggee process did not finish during timeout   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:212)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPTestCase.internalTearDown(JDWPTestCase.java:84)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPSyncTestCase.internalTearDown(JDWPSyncTestCase.java:75)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPRawTestCase.tearDown(JDWPRawTestCase.java:110)   
> Caused by: java.lang.IllegalThreadStateException: process has not exited   
>  at java.lang.Runtime$SubProcess.exitValue(Runtime.java:357)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:207)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  ... 13 more 
> However, Java stack is different. I could not to print it with MSVC debugger, but I was able to reconstruct it from interpreter frames (the test fails with both JIT and interpreter). Java stack looks like the following:
>     VMThreadManager.wait()
>     Object.wait()
>     InterruptDebuggee.run()
>     Debuggee.runDebuggee()
>     InterruptDebiggee.main()
> It shows that debuggee VM is actually waiting on a monitor in method run() of the tested class InterruptDebuggee:
>     public void run() {
>         DebuggeeThread thrd = new DebuggeeThread(TESTED_THREAD,
>                 logWriter, synchronizer); 
>         
>         synchronized(waitForStart){
>             thrd.start();
>             try {
>                 waitForStart.wait();
>             } catch (InterruptedException e) {
>             }
>         }
>         synchronized(waitForFinish){
>             logWriter.println("thread is finished");
>         }
>     }
> It's strange result, because waitForStart.wait() should be completed by notification from the started thread in its run() method:
>         public void run() {
>             synchronized(InterruptDebuggee.waitForFinish){
>                 synchronized(InterruptDebuggee.waitForStart){
>                     InterruptDebuggee.waitForStart.notifyAll();
>                     <...>
>                 }
>             }
>         }
> It seems like race condition in implementation of Object.wait().

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


[jira] Updated: (HARMONY-4046) [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest

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

Andrey Yakushev updated HARMONY-4046:
-------------------------------------

    Attachment: 4046.patch

This test uses one lock object waitForStart for two purposes: threads synchronization and interrupt waiting. If two different objects are used (see the 4046.patch file attached), the hang disappear in my long testing run.

Of course the bug in drlvm remains. It seems like problems with handling the combination of notify and interrupt.

If suggested patch is applied, I will open the new bug for drlvm. Also I'm going to write simpler bug reproducer.


> [jdktools][jpda] JDWP test fails on Windows: org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4046
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4046
>             Project: Harmony
>          Issue Type: Bug
>          Components: JDK
>         Environment: Windows/x86, harmony-jdk-r544417
>            Reporter: Ivan Popov
>            Assignee: Gregory Shimansky
>         Attachments: 4046.patch, jpda_test_exclude.patch
>
>
> After HARMONY-3314 was fixed, I noticed that one particular JDWP test
>     org.apache.harmony.jpda.tests.jdwp.ThreadReference.InterruptTest
> intermittently fails on Windows/x86, especially on a slow single-cpu WinXP machine and T41p laptop.
> The failure symptoms are similar to HARMONY-3314 - debuggee VM process hangs on exit and test throws exception:
> org.apache.harmony.jpda.tests.framework.TestErrorException: Debuggee process did not finish during timeout   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:212)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPTestCase.internalTearDown(JDWPTestCase.java:84)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPSyncTestCase.internalTearDown(JDWPSyncTestCase.java:75)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPRawTestCase.tearDown(JDWPRawTestCase.java:110)   
> Caused by: java.lang.IllegalThreadStateException: process has not exited   
>  at java.lang.Runtime$SubProcess.exitValue(Runtime.java:357)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.WaitForProcessExit(JDWPUnitDebuggeeWrapper.java:207)   
>  at org.apache.harmony.jpda.tests.jdwp.share.JDWPUnitDebuggeeWrapper.stop(JDWPUnitDebuggeeWrapper.java:131)   
>  ... 13 more 
> However, Java stack is different. I could not to print it with MSVC debugger, but I was able to reconstruct it from interpreter frames (the test fails with both JIT and interpreter). Java stack looks like the following:
>     VMThreadManager.wait()
>     Object.wait()
>     InterruptDebuggee.run()
>     Debuggee.runDebuggee()
>     InterruptDebiggee.main()
> It shows that debuggee VM is actually waiting on a monitor in method run() of the tested class InterruptDebuggee:
>     public void run() {
>         DebuggeeThread thrd = new DebuggeeThread(TESTED_THREAD,
>                 logWriter, synchronizer); 
>         
>         synchronized(waitForStart){
>             thrd.start();
>             try {
>                 waitForStart.wait();
>             } catch (InterruptedException e) {
>             }
>         }
>         synchronized(waitForFinish){
>             logWriter.println("thread is finished");
>         }
>     }
> It's strange result, because waitForStart.wait() should be completed by notification from the started thread in its run() method:
>         public void run() {
>             synchronized(InterruptDebuggee.waitForFinish){
>                 synchronized(InterruptDebuggee.waitForStart){
>                     InterruptDebuggee.waitForStart.notifyAll();
>                     <...>
>                 }
>             }
>         }
> It seems like race condition in implementation of Object.wait().

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