RFR: 8315127: CDSMapTest fails with incorrect number of oop references
Andrey Turbanov
aturbanov at openjdk.org
Fri Sep 1 20:29:43 UTC 2023
On Fri, 1 Sep 2023 00:18:20 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> This is a bug in the test case. The test parses patterns like this in the map file
>
>
> 0x00000000ffe00000: @@ Object (0xffe00000) java.lang.String
> - klass: 'java/lang/String' 0x0000000800010220
> - fields (3 words):
> - private 'hash' 'I' @12 0 (0x00000000)
> - private final 'coder' 'B' @16 0 (0x00)
> - private 'hashIsZero' 'Z' @17 true (0x01)
> - injected 'flags' 'B' @18 1 (0x01)
> - private final 'value' '[B' @20 0x00000000ffe00018 (0xffe00018) [B length: 0
> 0x00000000ffe00018: @@ Object (0xffe00018) [B length: 0
> - klass: {type array byte} 0x00000008000024d8
>
>
> Before this fix, the test assets that there are at least 10000 oop references (such as the `value` field in the above String). However, some JDK builds may have fewer archived heap objects, resulting in less than 10000 references (the graal build in the bug report has only 8286 references).
>
> After this fix, we check that the number of oop references is not fewer than the number of strings, as we know each string contains one oop field. This is sufficient to check that the map file contains expected output, without using a hard-coded number.
test/hotspot/jtreg/runtime/cds/CDSMapReader.java line 282:
> 280: } finally {
> 281: System.out.println("Parsed " + lineCount + " lines in " + fileName);
> 282: System.out.println("Found " + mapFile.heapObjectCount() + " heap objects ("
Suggestion:
System.out.println("Found " + mapFile.heapObjectCount() + " heap objects ("
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15527#discussion_r1313487050
More information about the hotspot-runtime-dev
mailing list