Integrated: 8346971: [ubsan] psCardTable.cpp:131:24: runtime error: large index is out of bounds
Kim Barrett
kbarrett at openjdk.org
Tue Jan 14 18:57:55 UTC 2025
On Fri, 10 Jan 2025 11:21:31 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> Please review this change to PSStripeShadowCardTable to avoid several examples
> of UB in it's internal calculations. We avoid the UB by switching to the
> integer domain (using uintptr_t) for all of the internal calculations, with
> casts between pointers and uintptr_t as needed at the boundaries.
>
> This applies not just to the various pointer adjustments, but also to pointer
> comparisons. In particular, the prior range check assertions using pointer
> comparisons could have been partially or even completely "optimized" away
> based on the no-UB assumption.
>
> Testing: mach5 tier1-5
> local (linux-x64) tier1 with -XX:+UseParallelGC
This pull request has now been integrated.
Changeset: 4c30933b
Author: Kim Barrett <kbarrett at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/4c30933b2ab92369d2da449ab3cd030b748e61fb
Stats: 35 lines in 1 file changed: 29 ins; 0 del; 6 mod
8346971: [ubsan] psCardTable.cpp:131:24: runtime error: large index is out of bounds
Reviewed-by: ayang, tschatzl
-------------
PR: https://git.openjdk.org/jdk/pull/23032
More information about the hotspot-gc-dev
mailing list