RFR: 8279009: CDS crashes when the source of an InstanceKlass is NULL [v3]

Calvin Cheung ccheung at openjdk.java.net
Wed Jan 19 23:27:51 UTC 2022


On Wed, 19 Jan 2022 04:27:11 GMT, Yumin Qi <minqi at openjdk.org> wrote:

>> Please review
>>   When user combine -XX:ArchiveClassesAtExit and -XX:DumpLoadedClassList, vm will generate shared archive at exit mean while dump class list to a file, it will encounter null source when lambda form invoker holder classes are regenerated which have no source.  It failed to output the NULL source.
>>    The fix is simply add ing check if the source exists. 
>>    For unregistered classes loaded from shared space, they should be filtered out since the source are not recorded in shared space.
>> 
>>    Tests: tier2,tier2.tier3,tier4
>> 
>> Thanks
>> Yumin
>
> Yumin Qi has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove unused export modules, clean up comments

Looks good. Some minor nits and comments.

test/hotspot/jtreg/runtime/cds/appcds/ClassListWithCustomClassNoSource.java line 33:

> 31: public class ClassListWithCustomClassNoSource {
> 32:     private static byte[] helloBytes;
> 33:     private static final String HELLO="Hello";

Needs a space before and after the ‘=‘.

test/hotspot/jtreg/runtime/cds/appcds/ClassListWithCustomClassNoSource.java line 80:

> 78:                System.out.println(HELLO + " is not loaded");
> 79:            }
> 80:            break;

Lines 72-80 should be aligned with line 71.

Are lines 75 and 78 for debugging only? Or should a RuntimeException be thrown under those conditions?

test/hotspot/jtreg/runtime/cds/appcds/TestDumpClassListSource.java line 147:

> 145:         output.shouldHaveExitValue(0);
> 146:         checkMatch(listFileName, sourceTarget, EXPECT_NOMATCH, "Failed to filter " + sourceTarget + " in class list file");
> 147:         checkMatch(listFileName, "Hello", EXPECT_NOMATCH,"Hello should not be logged in class list file");

Please add a space after `EXPECT_NOMATCH,`.

-------------

Marked as reviewed by ccheung (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7072


More information about the hotspot-runtime-dev mailing list