harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vera Petrashkova (JIRA)" <j...@apache.org>
Subject [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
Date Fri, 13 Oct 2006 12:11:35 GMT
[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

        

Mime
View raw message