RFR: 8274632: Possible pointer overflow in PretouchTask chunk claiming

Kim Barrett kbarrett at openjdk.java.net
Fri Oct 1 20:01:33 UTC 2021


On Fri, 1 Oct 2021 19:38:58 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> Please review this change to PretouchTask, fixing the mechanism used to
> claim chunks for parallel touching.  The old mechanism unconditionally added
> a potentially large value to the current pointer and then checked the result
> for overflow.  But since pointer arithmetic overflow is UB, that's not a
> reliable approach.
> 
> Testing:
> mach5 tier1

Also removed the no longer used _start_addr member.  And I just realized
the overflow check was doubly bad, since it was using that value, and
the potential wrap-around could exceed it.

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

PR: https://git.openjdk.java.net/jdk/pull/5791



More information about the hotspot-gc-dev mailing list