RFR: 8265393: VM crashes if both -XX:+RecordDynamicDumpInfo and -XX:SharedArchiveFile options are specified [v2]
Calvin Cheung
ccheung at openjdk.java.net
Thu Apr 22 16:41:25 UTC 2021
On Thu, 22 Apr 2021 04:56:01 GMT, Yumin Qi <minqi at openjdk.org> wrote:
>> Hi, Please review
>> 1) When the two flags -XX:+RecordDynamicDumpInfo and -XX:SharedArchiveFile used, in
>> Arguments::init_shared_archive_paths() :
>> if (DynamicDumpSharedSpaces) {
>> if (os::same_files(SharedArchiveFile, ArchiveClassesAtExit)) {
>> ...
>> ArchiveClassesAtExit is NULL.
>> C++ does not have a defined behavior of strcmp with strings of NULL. Posix version of os::same_files(const char* file1, const char* file2) calls strcmp without checking input args. This should be same as it is treated on Windows.
>> 2) JCmdTest.java is fat and possible to cause test timeout. Split JCmdTest.java into two separate Tests: JCmdTestStaticDump.java and JCmdTestDynamicDump.java.
>> 3) Add a test to check run with -XX:+RecordDynamicDumpInfo and -XX:SharedArchiveFile in JCmdTestDynamicDump.java
>> The test does not use utility to create jvm process since it will take testing envs into process, but the way in the test using LingeredApp does not take envs.
>>
>> Tests: tier1,tier2,tier3,tier4
>>
>> Thanks
>> Yumin
>
> Yumin Qi has updated the pull request incrementally with one additional commit since the last revision:
>
> Abstract common code into base class
test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDumpBase.java line 31:
> 29:
> 30: import jdk.test.lib.apps.LingeredApp;
> 31: import jdk.test.lib.cds.CDSTestUtils;
Extra import
test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDumpBase.java line 35:
> 33: import jdk.test.lib.process.OutputAnalyzer;
> 34: import jdk.test.lib.process.ProcessTools;
> 35: import jdk.test.lib.JDKToolFinder;
Extra import
test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDumpBase.java line 40:
> 38:
> 39: import java.io.InputStreamReader;
> 40: import java.io.BufferedReader;
Extra import.
test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDumpBase.java line 71:
> 69: "jdk/test/lib/apps/LingeredApp",
> 70: "jdk/test/lib/apps/LingeredApp$1"};
> 71: private static final String BOOT_CLASSES[] = {"Hello"};
Too many blank spaces before the '='.
test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDumpBase.java line 82:
> 80: System.out.println("Jar file created: " + testJar);
> 81: System.out.println("Jar file created: " + bootJar);
> 82: allJars = testJar+ File.pathSeparator + bootJar;
Need a blank space after `testJar`.
test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java line 42:
> 40: import java.io.IOException;
> 41: import java.util.ArrayList;
> 42: import java.util.List;
Extra import.
test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java line 46:
> 44: import jdk.test.lib.apps.LingeredApp;
> 45: import jdk.test.lib.cds.CDSTestUtils;
> 46: import jdk.test.lib.dcmd.PidJcmdExecutor;
Extra import.
test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java line 52:
> 50:
> 51: import java.io.InputStreamReader;
> 52: import java.io.BufferedReader;
Extra import.
test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestStaticDump.java line 43:
> 41: import java.nio.file.Path;
> 42: import java.util.ArrayList;
> 43: import java.util.List;
Extra import.
test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestStaticDump.java line 50:
> 48:
> 49: import java.io.InputStreamReader;
> 50: import java.io.BufferedReader;
Extra import.
test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestStaticDump.java line 89:
> 87: final boolean noBoot = !useBoot;
> 88: final boolean EXPECT_PASS = true;
> 89: final boolean EXPECT_FAIL = !EXPECT_PASS;
These are also used in JCmdTestDynamicDump. Maybe move them to JCmdTestDumpBase?
-------------
PR: https://git.openjdk.java.net/jdk/pull/3599
More information about the hotspot-dev
mailing list