RFR: 8315127: CDSMapTest fails with incorrect number of oop references [v2]

Calvin Cheung ccheung at openjdk.org
Sat Sep 2 02:37:47 UTC 2023


On Fri, 1 Sep 2023 22:49:07 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.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
> 
>   @calvinccheung and @turbanoff review comments

Thanks for the update. It looks good.

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

Marked as reviewed by ccheung (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15527#pullrequestreview-1607843643


More information about the hotspot-runtime-dev mailing list