RFR: 8048687 [TESTBUG] com/sun/jdi/ExclusiveBind.java "Could not find or load main class"
Erik Gahlin
erik.gahlin at oracle.com
Tue Jul 1 08:23:05 UTC 2014
Looks good!
Erik
Staffan Larsen skrev 2014-07-01 09:38:
> Please review this test fix.
>
> webrev: http://cr.openjdk.java.net/~sla/8048687/webrev.00/
> bug: https://bugs.openjdk.java.net/browse/JDK-8048687
>
> The test tries to start a process but fails with:
>
>
> ----------System.out:(35/1961)----------
> vmOpts:
> javaOpts: -Xmixed -server -XX:MaxRAMFraction=8 -XX:+CreateMinidumpOnCrash -XX:ReservedCodeCacheSize=256M
> Command line: [/export/local/aurora/sandbox/sca/vmsqe/jdk/nightly/fastdebug/rt_baseline/macosx-amd64/bin/java -classpath /export/local/aurora/sandbox/results/workDir/classes/1/com/sun/jdi -Xmixed -server -XX:MaxRAMFraction=8 -XX:+CreateMinidumpOnCrash -XX:ReservedCodeCacheSize=256M -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=61682 HelloWorld ]
> ...
> ----------System.err:(16/856)----------
> [process1] Error: Could not find or load main class
> Failed to start a process (thread dump follows)
>
>
> At first glance the command line looks ok, but what I missed here is that there are two spaces before "-Xmixed". Two spaces in a command line is ok, but in this case it means that the String[] argument to ProcessBuilder has one empty String element. That is not ok since that would turn into an actual empty argument to the process. We can actually see this in the output from the process, too:
>
> [process1] Error: Could not find or load main class
>
> If it was the HelloWorld class that could not be found it should have said:
>
> [process1] Error: Could not find or load main class HelloWorld
>
> But now it is the empty string class that we can't find.
>
> The fix makes sure there are no empty Strings in the process arguments.
>
> Thanks,
> /Staffan
More information about the serviceability-dev
mailing list