RFR: 8315127: CDSMapTest fails with incorrect number of oop references

Ioi Lam iklam at openjdk.org
Fri Sep 1 00:26:14 UTC 2023


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.

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

Commit messages:
 - fix comments; tightened check
 - 8315127: CDSMapTest fails with incorrect number of oop references

Changes: https://git.openjdk.org/jdk/pull/15527/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15527&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8315127
  Stats: 65 lines in 2 files changed: 41 ins; 6 del; 18 mod
  Patch: https://git.openjdk.org/jdk/pull/15527.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15527/head:pull/15527

PR: https://git.openjdk.org/jdk/pull/15527


More information about the hotspot-runtime-dev mailing list