RFR: 8330275: Crash in XMark::follow_array
Stefan Karlsson
stefank at openjdk.org
Thu Apr 25 06:57:29 UTC 2024
On Wed, 24 Apr 2024 20:22:52 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:
> 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. This patch sets the maximum address offset bits to 44.
>
> 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 on x86
Hi @ashu-mehra,
Thanks for fixing this issue.
There's a number of changes style changes I would like to make to make sure that the code looks more inline with what the rest of the ZGC code looks like. But before we start with that I would like to request that we skip making the changes to marking stack code and limit the changes to only the probing code. Doing so will make it easier to get this fix reviewed and delivered.
-------------
Changes requested by stefank (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18941#pullrequestreview-2021682780
More information about the hotspot-gc-dev
mailing list