harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Serguei Zapreyev (JIRA)" <j...@apache.org>
Subject [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
Date Fri, 13 Oct 2006 14:48:36 GMT
    [ 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

        

Mime
View raw message