You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vera Petrashkova (JIRA)" <ji...@apache.org> on 2006/10/13 14:11:35 UTC

[jira] Created: (HARMONY-1863) [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw

[classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw
-----------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-1863
                 URL: http://issues.apache.org/jira/browse/HARMONY-1863
             Project: Harmony
          Issue Type: Bug
         Environment: Windows
            Reporter: Vera Petrashkova
         Attachments: testExec2.zip

java.lang.Runtime.exec(String [] cmdarray, String[] envp)  throws IOException when 
envp array contains about 80 strings which have large lengths.

 RI parses these specified environment variables successfully.

 

Code for reproducing: 
------------------
import junit.framework.TestCase;
import java.io.*;
public class testExec2 extends TestCase {

    public static int nmbEnv = 80;
    public final static String ENV_S = "env";
    public final static String ENV_S1 = "0123456789";
   
    public void testExec() {
        String [] envs = new String [nmbEnv];
        for (int i = 0; i < nmbEnv; i++) {
            envs[i] = ENV_S+Integer.toString(i)+"=";
            String s = "";
            for (int j = 0; j < i; j++) {
                s = s + ENV_S1;
            }
            s = s+"a";
            envs[i] = envs[i] + s;
        }
        String [] cmdL = new String[4]; // + nmbEnv];
        cmdL[0] = System.getProperty("java.home")+File.separator+"bin"+File.separator+"java";
        cmdL[1] = "-classpath";
        cmdL[2] = ".";
        cmdL[3] = "testExec2_App"; 
//        System.out.println(envs[nmbEnv-1]);
        try {
            Process p = Runtime.getRuntime().exec(cmdL, envs);
            p.waitFor();
            int ans = p.exitValue();
            if (ans != 0) {
                assertEquals("Incorrect exitValue", 0, ans);
            }                        
        } catch (Throwable e) {
            e.printStackTrace();
            fail("Unexpected error: "+e);
        }
     }
}

class testExec2_App {
    public static void main(String[] args) {
         System.exit(0);
    }
}
------------------
 

Output on RI
================== 

java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
 .

Time: 0.188

OK (1 test)

 

Output on Harmony
================
Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r454528, (Oct 13 2006), Windows/ia32/msvc 1310, release build
http://incubator.apache.org/harmony
.java.io.IOException: The creation of the Process has just failed: "H:\share\binaries\buil
ds\combined\20061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
        at java.lang.Runtime$SubProcess.execVM(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at testExec2.testExec(testExec2.java:27)
        at java.lang.reflect.VMReflection.invokeMethod(Native Method)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:125)
        at junit.framework.TestResult$1.protect(TestResult.java:107)
        at junit.framework.TestResult.runProtected(TestResult.java:135)
        at junit.framework.TestResult.run(TestResult.java:104)
        at junit.framework.TestCase.run(TestCase.java:119)
        at junit.framework.TestSuite.runTest(TestSuite.java:209)
        at junit.framework.TestSuite.run(TestSuite.java:202)
        at junit.textui.TestRunner.doRun(TestRunner.java:115)
        at junit.textui.TestRunner.start(TestRunner.java:171)
        at junit.textui.TestRunner.main(TestRunner.java:136)
F
Time: 0.047
There was 1 failure:
1) testExec(testExec2)junit.framework.AssertionFailedError: Unexpected error: java.io.IOEx
ception: The creation of the Process has just failed: "H:\share\binaries\builds\combined\2
0061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
        at testExec2.testExec(testExec2.java:35)
        at java.lang.reflect.VMReflection.invokeMethod(Native Method)
 
FAILURES!!!



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (HARMONY-1863) [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw

Posted by "Geir Magnusson Jr (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1863?page=all ]

Geir Magnusson Jr closed HARMONY-1863.
--------------------------------------

    Resolution: Fixed

closing as suggested

> [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1863
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1863
>             Project: Harmony
>          Issue Type: Bug
>         Environment: Windows
>            Reporter: Vera Petrashkova
>         Attachments: log.txt, log2.txt, Test.java, Test2.java, testExec2.zip
>
>
> java.lang.Runtime.exec(String [] cmdarray, String[] envp)  throws IOException when 
> envp array contains about 80 strings which have large lengths.
>  RI parses these specified environment variables successfully.
>  
> Code for reproducing: 
> ------------------
> import junit.framework.TestCase;
> import java.io.*;
> public class testExec2 extends TestCase {
>     public static int nmbEnv = 80;
>     public final static String ENV_S = "env";
>     public final static String ENV_S1 = "0123456789";
>    
>     public void testExec() {
>         String [] envs = new String [nmbEnv];
>         for (int i = 0; i < nmbEnv; i++) {
>             envs[i] = ENV_S+Integer.toString(i)+"=";
>             String s = "";
>             for (int j = 0; j < i; j++) {
>                 s = s + ENV_S1;
>             }
>             s = s+"a";
>             envs[i] = envs[i] + s;
>         }
>         String [] cmdL = new String[4]; // + nmbEnv];
>         cmdL[0] = System.getProperty("java.home")+File.separator+"bin"+File.separator+"java";
>         cmdL[1] = "-classpath";
>         cmdL[2] = ".";
>         cmdL[3] = "testExec2_App"; 
> //        System.out.println(envs[nmbEnv-1]);
>         try {
>             Process p = Runtime.getRuntime().exec(cmdL, envs);
>             p.waitFor();
>             int ans = p.exitValue();
>             if (ans != 0) {
>                 assertEquals("Incorrect exitValue", 0, ans);
>             }                        
>         } catch (Throwable e) {
>             e.printStackTrace();
>             fail("Unexpected error: "+e);
>         }
>      }
> }
> class testExec2_App {
>     public static void main(String[] args) {
>          System.exit(0);
>     }
> }
> ------------------
>  
> Output on RI
> ================== 
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
>  .
> Time: 0.188
> OK (1 test)
>  
> Output on Harmony
> ================
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r454528, (Oct 13 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> .java.io.IOException: The creation of the Process has just failed: "H:\share\binaries\buil
> ds\combined\20061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at java.lang.Runtime$SubProcess.execVM(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at testExec2.testExec(testExec2.java:27)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at junit.framework.TestCase.runTest(TestCase.java:154)
>         at junit.framework.TestCase.runBare(TestCase.java:125)
>         at junit.framework.TestResult$1.protect(TestResult.java:107)
>         at junit.framework.TestResult.runProtected(TestResult.java:135)
>         at junit.framework.TestResult.run(TestResult.java:104)
>         at junit.framework.TestCase.run(TestCase.java:119)
>         at junit.framework.TestSuite.runTest(TestSuite.java:209)
>         at junit.framework.TestSuite.run(TestSuite.java:202)
>         at junit.textui.TestRunner.doRun(TestRunner.java:115)
>         at junit.textui.TestRunner.start(TestRunner.java:171)
>         at junit.textui.TestRunner.main(TestRunner.java:136)
> F
> Time: 0.047
> There was 1 failure:
> 1) testExec(testExec2)junit.framework.AssertionFailedError: Unexpected error: java.io.IOEx
> ception: The creation of the Process has just failed: "H:\share\binaries\builds\combined\2
> 0061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at testExec2.testExec(testExec2.java:35)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>  
> FAILURES!!!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-1863) [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw

Posted by "Serguei Zapreyev (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1863?page=comments#action_12442039 ] 
            
Serguei Zapreyev commented on HARMONY-1863:
-------------------------------------------

So, the reason of the test failure is explained by the 32K restriction on an environment block for the new process creation facility provided by MS Platform SDK.
It leads to "More data is available" error rising during a process creation leading 
further to 
java.io.IOException: The creation of the Process has just failed: "..."

RI doesn't lead to an exception because, I guess, it cuts the block before a process
creation. I think it is incorrect since it provides a false context to execute the command. I'm going to attach the test and the log demonstrating that.


> [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1863
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1863
>             Project: Harmony
>          Issue Type: Bug
>         Environment: Windows
>            Reporter: Vera Petrashkova
>         Attachments: testExec2.zip
>
>
> java.lang.Runtime.exec(String [] cmdarray, String[] envp)  throws IOException when 
> envp array contains about 80 strings which have large lengths.
>  RI parses these specified environment variables successfully.
>  
> Code for reproducing: 
> ------------------
> import junit.framework.TestCase;
> import java.io.*;
> public class testExec2 extends TestCase {
>     public static int nmbEnv = 80;
>     public final static String ENV_S = "env";
>     public final static String ENV_S1 = "0123456789";
>    
>     public void testExec() {
>         String [] envs = new String [nmbEnv];
>         for (int i = 0; i < nmbEnv; i++) {
>             envs[i] = ENV_S+Integer.toString(i)+"=";
>             String s = "";
>             for (int j = 0; j < i; j++) {
>                 s = s + ENV_S1;
>             }
>             s = s+"a";
>             envs[i] = envs[i] + s;
>         }
>         String [] cmdL = new String[4]; // + nmbEnv];
>         cmdL[0] = System.getProperty("java.home")+File.separator+"bin"+File.separator+"java";
>         cmdL[1] = "-classpath";
>         cmdL[2] = ".";
>         cmdL[3] = "testExec2_App"; 
> //        System.out.println(envs[nmbEnv-1]);
>         try {
>             Process p = Runtime.getRuntime().exec(cmdL, envs);
>             p.waitFor();
>             int ans = p.exitValue();
>             if (ans != 0) {
>                 assertEquals("Incorrect exitValue", 0, ans);
>             }                        
>         } catch (Throwable e) {
>             e.printStackTrace();
>             fail("Unexpected error: "+e);
>         }
>      }
> }
> class testExec2_App {
>     public static void main(String[] args) {
>          System.exit(0);
>     }
> }
> ------------------
>  
> Output on RI
> ================== 
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
>  .
> Time: 0.188
> OK (1 test)
>  
> Output on Harmony
> ================
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r454528, (Oct 13 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> .java.io.IOException: The creation of the Process has just failed: "H:\share\binaries\buil
> ds\combined\20061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at java.lang.Runtime$SubProcess.execVM(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at testExec2.testExec(testExec2.java:27)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at junit.framework.TestCase.runTest(TestCase.java:154)
>         at junit.framework.TestCase.runBare(TestCase.java:125)
>         at junit.framework.TestResult$1.protect(TestResult.java:107)
>         at junit.framework.TestResult.runProtected(TestResult.java:135)
>         at junit.framework.TestResult.run(TestResult.java:104)
>         at junit.framework.TestCase.run(TestCase.java:119)
>         at junit.framework.TestSuite.runTest(TestSuite.java:209)
>         at junit.framework.TestSuite.run(TestSuite.java:202)
>         at junit.textui.TestRunner.doRun(TestRunner.java:115)
>         at junit.textui.TestRunner.start(TestRunner.java:171)
>         at junit.textui.TestRunner.main(TestRunner.java:136)
> F
> Time: 0.047
> There was 1 failure:
> 1) testExec(testExec2)junit.framework.AssertionFailedError: Unexpected error: java.io.IOEx
> ception: The creation of the Process has just failed: "H:\share\binaries\builds\combined\2
> 0061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at testExec2.testExec(testExec2.java:35)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>  
> FAILURES!!!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-1863) [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw

Posted by "Vera Petrashkova (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1863?page=all ]

Vera Petrashkova updated HARMONY-1863:
--------------------------------------

    Attachment: testExec2.zip

testExec2.zip file contains test source code and classes


> [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1863
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1863
>             Project: Harmony
>          Issue Type: Bug
>         Environment: Windows
>            Reporter: Vera Petrashkova
>         Attachments: testExec2.zip
>
>
> java.lang.Runtime.exec(String [] cmdarray, String[] envp)  throws IOException when 
> envp array contains about 80 strings which have large lengths.
>  RI parses these specified environment variables successfully.
>  
> Code for reproducing: 
> ------------------
> import junit.framework.TestCase;
> import java.io.*;
> public class testExec2 extends TestCase {
>     public static int nmbEnv = 80;
>     public final static String ENV_S = "env";
>     public final static String ENV_S1 = "0123456789";
>    
>     public void testExec() {
>         String [] envs = new String [nmbEnv];
>         for (int i = 0; i < nmbEnv; i++) {
>             envs[i] = ENV_S+Integer.toString(i)+"=";
>             String s = "";
>             for (int j = 0; j < i; j++) {
>                 s = s + ENV_S1;
>             }
>             s = s+"a";
>             envs[i] = envs[i] + s;
>         }
>         String [] cmdL = new String[4]; // + nmbEnv];
>         cmdL[0] = System.getProperty("java.home")+File.separator+"bin"+File.separator+"java";
>         cmdL[1] = "-classpath";
>         cmdL[2] = ".";
>         cmdL[3] = "testExec2_App"; 
> //        System.out.println(envs[nmbEnv-1]);
>         try {
>             Process p = Runtime.getRuntime().exec(cmdL, envs);
>             p.waitFor();
>             int ans = p.exitValue();
>             if (ans != 0) {
>                 assertEquals("Incorrect exitValue", 0, ans);
>             }                        
>         } catch (Throwable e) {
>             e.printStackTrace();
>             fail("Unexpected error: "+e);
>         }
>      }
> }
> class testExec2_App {
>     public static void main(String[] args) {
>          System.exit(0);
>     }
> }
> ------------------
>  
> Output on RI
> ================== 
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
>  .
> Time: 0.188
> OK (1 test)
>  
> Output on Harmony
> ================
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r454528, (Oct 13 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> .java.io.IOException: The creation of the Process has just failed: "H:\share\binaries\buil
> ds\combined\20061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at java.lang.Runtime$SubProcess.execVM(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at testExec2.testExec(testExec2.java:27)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at junit.framework.TestCase.runTest(TestCase.java:154)
>         at junit.framework.TestCase.runBare(TestCase.java:125)
>         at junit.framework.TestResult$1.protect(TestResult.java:107)
>         at junit.framework.TestResult.runProtected(TestResult.java:135)
>         at junit.framework.TestResult.run(TestResult.java:104)
>         at junit.framework.TestCase.run(TestCase.java:119)
>         at junit.framework.TestSuite.runTest(TestSuite.java:209)
>         at junit.framework.TestSuite.run(TestSuite.java:202)
>         at junit.textui.TestRunner.doRun(TestRunner.java:115)
>         at junit.textui.TestRunner.start(TestRunner.java:171)
>         at junit.textui.TestRunner.main(TestRunner.java:136)
> F
> Time: 0.047
> There was 1 failure:
> 1) testExec(testExec2)junit.framework.AssertionFailedError: Unexpected error: java.io.IOEx
> ception: The creation of the Process has just failed: "H:\share\binaries\builds\combined\2
> 0061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at testExec2.testExec(testExec2.java:35)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>  
> FAILURES!!!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-1863) [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw

Posted by "Serguei Zapreyev (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1863?page=comments#action_12442045 ] 
            
Serguei Zapreyev commented on HARMONY-1863:
-------------------------------------------

So, looks like the original test detects the known restriction of the implementation 
support and I suggest to close the issue because it isn't a bug.

> [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1863
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1863
>             Project: Harmony
>          Issue Type: Bug
>         Environment: Windows
>            Reporter: Vera Petrashkova
>         Attachments: log.txt, log2.txt, Test.java, Test2.java, testExec2.zip
>
>
> java.lang.Runtime.exec(String [] cmdarray, String[] envp)  throws IOException when 
> envp array contains about 80 strings which have large lengths.
>  RI parses these specified environment variables successfully.
>  
> Code for reproducing: 
> ------------------
> import junit.framework.TestCase;
> import java.io.*;
> public class testExec2 extends TestCase {
>     public static int nmbEnv = 80;
>     public final static String ENV_S = "env";
>     public final static String ENV_S1 = "0123456789";
>    
>     public void testExec() {
>         String [] envs = new String [nmbEnv];
>         for (int i = 0; i < nmbEnv; i++) {
>             envs[i] = ENV_S+Integer.toString(i)+"=";
>             String s = "";
>             for (int j = 0; j < i; j++) {
>                 s = s + ENV_S1;
>             }
>             s = s+"a";
>             envs[i] = envs[i] + s;
>         }
>         String [] cmdL = new String[4]; // + nmbEnv];
>         cmdL[0] = System.getProperty("java.home")+File.separator+"bin"+File.separator+"java";
>         cmdL[1] = "-classpath";
>         cmdL[2] = ".";
>         cmdL[3] = "testExec2_App"; 
> //        System.out.println(envs[nmbEnv-1]);
>         try {
>             Process p = Runtime.getRuntime().exec(cmdL, envs);
>             p.waitFor();
>             int ans = p.exitValue();
>             if (ans != 0) {
>                 assertEquals("Incorrect exitValue", 0, ans);
>             }                        
>         } catch (Throwable e) {
>             e.printStackTrace();
>             fail("Unexpected error: "+e);
>         }
>      }
> }
> class testExec2_App {
>     public static void main(String[] args) {
>          System.exit(0);
>     }
> }
> ------------------
>  
> Output on RI
> ================== 
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
>  .
> Time: 0.188
> OK (1 test)
>  
> Output on Harmony
> ================
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r454528, (Oct 13 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> .java.io.IOException: The creation of the Process has just failed: "H:\share\binaries\buil
> ds\combined\20061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at java.lang.Runtime$SubProcess.execVM(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at testExec2.testExec(testExec2.java:27)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at junit.framework.TestCase.runTest(TestCase.java:154)
>         at junit.framework.TestCase.runBare(TestCase.java:125)
>         at junit.framework.TestResult$1.protect(TestResult.java:107)
>         at junit.framework.TestResult.runProtected(TestResult.java:135)
>         at junit.framework.TestResult.run(TestResult.java:104)
>         at junit.framework.TestCase.run(TestCase.java:119)
>         at junit.framework.TestSuite.runTest(TestSuite.java:209)
>         at junit.framework.TestSuite.run(TestSuite.java:202)
>         at junit.textui.TestRunner.doRun(TestRunner.java:115)
>         at junit.textui.TestRunner.start(TestRunner.java:171)
>         at junit.textui.TestRunner.main(TestRunner.java:136)
> F
> Time: 0.047
> There was 1 failure:
> 1) testExec(testExec2)junit.framework.AssertionFailedError: Unexpected error: java.io.IOEx
> ception: The creation of the Process has just failed: "H:\share\binaries\builds\combined\2
> 0061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at testExec2.testExec(testExec2.java:35)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>  
> FAILURES!!!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-1863) [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw

Posted by "Serguei Zapreyev (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1863?page=all ]

Serguei Zapreyev updated HARMONY-1863:
--------------------------------------

    Attachment: Test2.java
                log2.txt

To be punctual, the same (32K) problem is actual for the "command line to execute" argument of the process creation facility.
Test2.java and log2.txt demonstrate if a command line is about 32K length RI cuts the tail of command arguments and starts an execution with incorrect arguments set whereas DRLVM detects the issue by throwing IOE exception.

> [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1863
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1863
>             Project: Harmony
>          Issue Type: Bug
>         Environment: Windows
>            Reporter: Vera Petrashkova
>         Attachments: log.txt, log2.txt, Test.java, Test2.java, testExec2.zip
>
>
> java.lang.Runtime.exec(String [] cmdarray, String[] envp)  throws IOException when 
> envp array contains about 80 strings which have large lengths.
>  RI parses these specified environment variables successfully.
>  
> Code for reproducing: 
> ------------------
> import junit.framework.TestCase;
> import java.io.*;
> public class testExec2 extends TestCase {
>     public static int nmbEnv = 80;
>     public final static String ENV_S = "env";
>     public final static String ENV_S1 = "0123456789";
>    
>     public void testExec() {
>         String [] envs = new String [nmbEnv];
>         for (int i = 0; i < nmbEnv; i++) {
>             envs[i] = ENV_S+Integer.toString(i)+"=";
>             String s = "";
>             for (int j = 0; j < i; j++) {
>                 s = s + ENV_S1;
>             }
>             s = s+"a";
>             envs[i] = envs[i] + s;
>         }
>         String [] cmdL = new String[4]; // + nmbEnv];
>         cmdL[0] = System.getProperty("java.home")+File.separator+"bin"+File.separator+"java";
>         cmdL[1] = "-classpath";
>         cmdL[2] = ".";
>         cmdL[3] = "testExec2_App"; 
> //        System.out.println(envs[nmbEnv-1]);
>         try {
>             Process p = Runtime.getRuntime().exec(cmdL, envs);
>             p.waitFor();
>             int ans = p.exitValue();
>             if (ans != 0) {
>                 assertEquals("Incorrect exitValue", 0, ans);
>             }                        
>         } catch (Throwable e) {
>             e.printStackTrace();
>             fail("Unexpected error: "+e);
>         }
>      }
> }
> class testExec2_App {
>     public static void main(String[] args) {
>          System.exit(0);
>     }
> }
> ------------------
>  
> Output on RI
> ================== 
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
>  .
> Time: 0.188
> OK (1 test)
>  
> Output on Harmony
> ================
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r454528, (Oct 13 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> .java.io.IOException: The creation of the Process has just failed: "H:\share\binaries\buil
> ds\combined\20061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at java.lang.Runtime$SubProcess.execVM(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at testExec2.testExec(testExec2.java:27)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at junit.framework.TestCase.runTest(TestCase.java:154)
>         at junit.framework.TestCase.runBare(TestCase.java:125)
>         at junit.framework.TestResult$1.protect(TestResult.java:107)
>         at junit.framework.TestResult.runProtected(TestResult.java:135)
>         at junit.framework.TestResult.run(TestResult.java:104)
>         at junit.framework.TestCase.run(TestCase.java:119)
>         at junit.framework.TestSuite.runTest(TestSuite.java:209)
>         at junit.framework.TestSuite.run(TestSuite.java:202)
>         at junit.textui.TestRunner.doRun(TestRunner.java:115)
>         at junit.textui.TestRunner.start(TestRunner.java:171)
>         at junit.textui.TestRunner.main(TestRunner.java:136)
> F
> Time: 0.047
> There was 1 failure:
> 1) testExec(testExec2)junit.framework.AssertionFailedError: Unexpected error: java.io.IOEx
> ception: The creation of the Process has just failed: "H:\share\binaries\builds\combined\2
> 0061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at testExec2.testExec(testExec2.java:35)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>  
> FAILURES!!!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-1863) [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw

Posted by "Serguei Zapreyev (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1863?page=all ]

Serguei Zapreyev updated HARMONY-1863:
--------------------------------------

    Attachment: Test.java
                log.txt

So, the test shows if the environment block is about 32K length RI cuts it and starts the command within an incorrect environment whereas DRLVM detects the issue by IOE throwing.

> [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1863
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1863
>             Project: Harmony
>          Issue Type: Bug
>         Environment: Windows
>            Reporter: Vera Petrashkova
>         Attachments: log.txt, Test.java, testExec2.zip
>
>
> java.lang.Runtime.exec(String [] cmdarray, String[] envp)  throws IOException when 
> envp array contains about 80 strings which have large lengths.
>  RI parses these specified environment variables successfully.
>  
> Code for reproducing: 
> ------------------
> import junit.framework.TestCase;
> import java.io.*;
> public class testExec2 extends TestCase {
>     public static int nmbEnv = 80;
>     public final static String ENV_S = "env";
>     public final static String ENV_S1 = "0123456789";
>    
>     public void testExec() {
>         String [] envs = new String [nmbEnv];
>         for (int i = 0; i < nmbEnv; i++) {
>             envs[i] = ENV_S+Integer.toString(i)+"=";
>             String s = "";
>             for (int j = 0; j < i; j++) {
>                 s = s + ENV_S1;
>             }
>             s = s+"a";
>             envs[i] = envs[i] + s;
>         }
>         String [] cmdL = new String[4]; // + nmbEnv];
>         cmdL[0] = System.getProperty("java.home")+File.separator+"bin"+File.separator+"java";
>         cmdL[1] = "-classpath";
>         cmdL[2] = ".";
>         cmdL[3] = "testExec2_App"; 
> //        System.out.println(envs[nmbEnv-1]);
>         try {
>             Process p = Runtime.getRuntime().exec(cmdL, envs);
>             p.waitFor();
>             int ans = p.exitValue();
>             if (ans != 0) {
>                 assertEquals("Incorrect exitValue", 0, ans);
>             }                        
>         } catch (Throwable e) {
>             e.printStackTrace();
>             fail("Unexpected error: "+e);
>         }
>      }
> }
> class testExec2_App {
>     public static void main(String[] args) {
>          System.exit(0);
>     }
> }
> ------------------
>  
> Output on RI
> ================== 
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
>  .
> Time: 0.188
> OK (1 test)
>  
> Output on Harmony
> ================
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r454528, (Oct 13 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> .java.io.IOException: The creation of the Process has just failed: "H:\share\binaries\buil
> ds\combined\20061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at java.lang.Runtime$SubProcess.execVM(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at testExec2.testExec(testExec2.java:27)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at junit.framework.TestCase.runTest(TestCase.java:154)
>         at junit.framework.TestCase.runBare(TestCase.java:125)
>         at junit.framework.TestResult$1.protect(TestResult.java:107)
>         at junit.framework.TestResult.runProtected(TestResult.java:135)
>         at junit.framework.TestResult.run(TestResult.java:104)
>         at junit.framework.TestCase.run(TestCase.java:119)
>         at junit.framework.TestSuite.runTest(TestSuite.java:209)
>         at junit.framework.TestSuite.run(TestSuite.java:202)
>         at junit.textui.TestRunner.doRun(TestRunner.java:115)
>         at junit.textui.TestRunner.start(TestRunner.java:171)
>         at junit.textui.TestRunner.main(TestRunner.java:136)
> F
> Time: 0.047
> There was 1 failure:
> 1) testExec(testExec2)junit.framework.AssertionFailedError: Unexpected error: java.io.IOEx
> ception: The creation of the Process has just failed: "H:\share\binaries\builds\combined\2
> 0061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at testExec2.testExec(testExec2.java:35)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>  
> FAILURES!!!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-1863) [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw

Posted by "Serguei Zapreyev (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1863?page=comments#action_12442006 ] 
            
Serguei Zapreyev commented on HARMONY-1863:
-------------------------------------------

I'm a volunteer to investigate this issue.

> [classlib][drlvm] On Windows Runtime.exec(String[]cmdarray, String[] envp) throws IOException on large envp array while RI does not throw
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1863
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1863
>             Project: Harmony
>          Issue Type: Bug
>         Environment: Windows
>            Reporter: Vera Petrashkova
>         Attachments: testExec2.zip
>
>
> java.lang.Runtime.exec(String [] cmdarray, String[] envp)  throws IOException when 
> envp array contains about 80 strings which have large lengths.
>  RI parses these specified environment variables successfully.
>  
> Code for reproducing: 
> ------------------
> import junit.framework.TestCase;
> import java.io.*;
> public class testExec2 extends TestCase {
>     public static int nmbEnv = 80;
>     public final static String ENV_S = "env";
>     public final static String ENV_S1 = "0123456789";
>    
>     public void testExec() {
>         String [] envs = new String [nmbEnv];
>         for (int i = 0; i < nmbEnv; i++) {
>             envs[i] = ENV_S+Integer.toString(i)+"=";
>             String s = "";
>             for (int j = 0; j < i; j++) {
>                 s = s + ENV_S1;
>             }
>             s = s+"a";
>             envs[i] = envs[i] + s;
>         }
>         String [] cmdL = new String[4]; // + nmbEnv];
>         cmdL[0] = System.getProperty("java.home")+File.separator+"bin"+File.separator+"java";
>         cmdL[1] = "-classpath";
>         cmdL[2] = ".";
>         cmdL[3] = "testExec2_App"; 
> //        System.out.println(envs[nmbEnv-1]);
>         try {
>             Process p = Runtime.getRuntime().exec(cmdL, envs);
>             p.waitFor();
>             int ans = p.exitValue();
>             if (ans != 0) {
>                 assertEquals("Incorrect exitValue", 0, ans);
>             }                        
>         } catch (Throwable e) {
>             e.printStackTrace();
>             fail("Unexpected error: "+e);
>         }
>      }
> }
> class testExec2_App {
>     public static void main(String[] args) {
>          System.exit(0);
>     }
> }
> ------------------
>  
> Output on RI
> ================== 
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
>  .
> Time: 0.188
> OK (1 test)
>  
> Output on Harmony
> ================
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r454528, (Oct 13 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> .java.io.IOException: The creation of the Process has just failed: "H:\share\binaries\buil
> ds\combined\20061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at java.lang.Runtime$SubProcess.execVM(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at java.lang.Runtime.exec(Unknown Source)
>         at testExec2.testExec(testExec2.java:27)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at junit.framework.TestCase.runTest(TestCase.java:154)
>         at junit.framework.TestCase.runBare(TestCase.java:125)
>         at junit.framework.TestResult$1.protect(TestResult.java:107)
>         at junit.framework.TestResult.runProtected(TestResult.java:135)
>         at junit.framework.TestResult.run(TestResult.java:104)
>         at junit.framework.TestCase.run(TestCase.java:119)
>         at junit.framework.TestSuite.runTest(TestSuite.java:209)
>         at junit.framework.TestSuite.run(TestSuite.java:202)
>         at junit.textui.TestRunner.doRun(TestRunner.java:115)
>         at junit.textui.TestRunner.start(TestRunner.java:171)
>         at junit.textui.TestRunner.main(TestRunner.java:136)
> F
> Time: 0.047
> There was 1 failure:
> 1) testExec(testExec2)junit.framework.AssertionFailedError: Unexpected error: java.io.IOEx
> ception: The creation of the Process has just failed: "H:\share\binaries\builds\combined\2
> 0061013\drl_20061013_win_ia32_0002_msvc_r_H\bin\java" -classpath . testExec2_App
>         at testExec2.testExec(testExec2.java:35)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
>  
> FAILURES!!!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira