RFR: 8347047: cleanup action passed to MemorySegment::reinterpret keeps old segment alive

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Jan 7 11:38:39 UTC 2025


On Tue, 7 Jan 2025 10:44:22 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> This PR proposes to eliminate the capturing of `this` in the cleanup action of `AbstractMemorySegment::reinterpretInternal`.

Please test this extensively. There is a non-zero chance that some tests (esp. in later tiers) might be relying on the current (bogus) behavior. So it might be possible for this fix to uncover more use-after-free issues.

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

PR Comment: https://git.openjdk.org/jdk/pull/22943#issuecomment-2575067126


More information about the core-libs-dev mailing list