You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Sean Qiu (JIRA)" <ji...@apache.org> on 2008/10/30 09:45:44 UTC

[jira] Resolved: (HARMONY-6004) [classlib] [luni] System.exec() gets interruption will cause InternalError

     [ https://issues.apache.org/jira/browse/HARMONY-6004?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Qiu resolved HARMONY-6004.
-------------------------------

    Resolution: Fixed

Path applied at revision r709116.
Thank you very much for the patch.

Please verify if it works as you expected.

> [classlib] [luni] System.exec() gets interruption will cause InternalError
> --------------------------------------------------------------------------
>
>                 Key: HARMONY-6004
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6004
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M7
>            Reporter: Kevin Zhou
>            Assignee: Sean Qiu
>             Fix For: 5.0M8
>
>         Attachments: HARMONY-6004.diff
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> Conduct a test case [1] on HY5 and RI. 
> Modify the final part of Support_Exec from [2] to [3].
> RI works well while HY5 throws InternalError.
> [1]. SystemProcessTest
>  public void test_interrupt() throws Exception {
>         Object[] execArgs = null;
>         Process process = null;
>         try {
>             Thread.currentThread().interrupt();
>             execArgs = Support_Exec.execJava2(
>                     new String[] { "tests.support.Support_AvailTest" }, null,
>                     true);
>             process = (Process) execArgs[0];
>             OutputStream os = process.getOutputStream();
>             os.write("10 5 abcde".getBytes());
>             os.close();
>             process.waitFor();
>             fail("Should throw InterruptedException");
>         } catch (InterruptedException e) {
>             // Expected
>         }
>         try {
>             Thread.sleep(1000);
>         } catch (InterruptedException e) {
>             // Ignored
>         }        
>         process.waitFor();
>         Support_Exec.checkStderr(execArgs);
>         process.destroy();
>     }
> [2]. 
> synchronized (proc) {
>     errThread.start();
>     // wait for errThread to start
>     proc.wait();
> [3].
> synchronized (proc) {
>     errThread.start();
>     // wait for errThread to start
>     int count = 0;
>     boolean isFinished = false;
>     while(!isFinished) {
>         try {
>             proc.wait();
>             isFinished = true;
>         } catch (InterruptedException e) {
>             if(++count == 2) {
>                 throw e;
>             }
>         }
>     }
>     if(count > 0) {
>         Thread.currentThread().interrupt();
>     }
> }

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