RFR: 8330275: Crash in XMark::follow_array

Ashutosh Mehra asmehra at openjdk.org
Wed Apr 24 20:46:52 UTC 2024


This PR addresses the issue in ZGC where the number of address offset bits can go beyond the limit imposed by the encoding scheme in mark stack, thereby causing the encoding to fail.
Encoding of partial array offset in mark stack requires that the address offset be no more than 44 bits. But the current mechanism to probe maximum address offset bits on aarch64, riscv and ppc platforms can return value larger that 44 bits.

I have updated the generational mode to avoid subtracting 3 bits from the maximum address offset bit probed by the system, as the generational mode does not use multi-mapping.

I have also updated the code to set MarkPartialArrayMinSizeShift dynamically depending on the number of address offset bits used. This would avoid running into such problem again if in future maximum address offset bits is increased beyond 44.

For some reason (that I can't comprehend from the code) the existing implementation for probing the max addressable bit for ppc in non-generation ZGC is very different from other platforms and from generational mode as well. I have kept the existing implementation as is and just fixed it to ensure it does not return value greater than 44 bits.

Testing: test/hotspot/jtreg/gc/z and test/hotspot/jtreg/gc/x

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

Commit messages:
 - Fix ppc implementation
 - 8330275: Crash in XMark::follow_array

Changes: https://git.openjdk.org/jdk/pull/18941/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18941&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8330275
  Stats: 89 lines in 18 files changed: 58 ins; 8 del; 23 mod
  Patch: https://git.openjdk.org/jdk/pull/18941.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18941/head:pull/18941

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


More information about the hotspot-dev mailing list