RFR (XS): 8066670 - PrintSharedArchiveAndExit does not exit the VM when the archive is invalid

Ioi Lam ioi.lam at oracle.com
Thu Dec 4 18:39:02 UTC 2014


Hi Calvin,

Without the -XX:+PrintSharedArchiveAndExit switch:

  * The -version switch would trigger "Java HotSpot(TM) version ...." in
    the output
  * Without -version, the usage info "Usage: ..." would be printed

Since the two output are mutually exclusive, I decided to put them in 
two separate test cases.

Thanks
- Ioi

On 12/4/14, 10:02 AM, Calvin Cheung wrote:
> Hi Ioi,
>
> The fix looks good.
>
> For the testcase, I'm wondering if it's possible to start only one 
> java process for each scenario by calling output.shouldNotContain() 
> twice.
>
> For (1) With a valid archive for example:
>          pb = ProcessTools.createJavaProcessBuilder(
>              "-XX:+UnlockDiagnosticVMOptions", 
> "-XX:SharedArchiveFile=./sample.jsa",
>              "-XX:+PrintSharedArchiveAndExit", "-version");
>          output = new OutputAnalyzer(pb.start());
>          output.shouldContain("archive is valid");
>          output.shouldNotContain("Java HotSpot(TM)"); // Should not 
> print JVM version
>          output.shouldNotContain("Usage:");           // Should not 
> print JVM help message
>          output.shouldHaveExitValue(0);               // Should report 
> success in error code.
>
> thanks,
> Calvin
>
>
> On 12/4/2014 2:32 AM, Ioi Lam wrote:
>> Hi Folks,
>>
>> Please review a small fix:
>>
>> https://bugs.openjdk.java.net/browse/JDK-8066670
>> http://cr.openjdk.java.net/~iklam/8066670-PrintSharedArchiveAndExit/
>>
>> Summary of fix:
>>
>> Do not set UseSharedSpaces to falseif PrintSharedArchiveAndExit is 
>> enabled.
>>
>>     After this fix, the JVM correctly exits when 
>> PrintSharedArchiveAndExit is enabled
>>     and an invalid archive is encountered.
>>
>>     New test cases are in closed source code.
>>
>> Tests:
>>
>>     JPRT
>>     JTREG
>>
>>
>>
>



More information about the hotspot-runtime-dev mailing list