RFR: 8351921: G1: Pinned regions with pinned objects only reachable by native code crash VM [v2]
Thomas Schatzl
tschatzl at openjdk.org
Mon Mar 17 16:33:39 UTC 2025
> Hi all,
>
> please review this fix for a crash in G1 where it tries to reclaim a pinned region that does not have any reference visible to the VM any more and there are no other reachable pinnable objects in the same region. This can happen e.g. when JNI code is the only holder for a reference.
>
> This has been reported this in a real application, but the attached test case (that uses WhiteBox to simulate a lone pinnable object in a region where the GC does not have a reference any more) shows the principle as well.
>
> The solution involves unconditionally adding pinned regions in the collection set to the set of evacuation failed regions, instead of only doing that when G1 first encounters a reachable pinnable object in that pinned region.
>
> Testing: gha, tier1-5
>
> Thanks,
> Thomas
Thomas Schatzl has updated the pull request incrementally with two additional commits since the last revision:
- * iwalulya review
* typos
- Update test/hotspot/jtreg/gc/g1/pinnedobjs/TestPinnedEvacEmpty.java
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/24060/files
- new: https://git.openjdk.org/jdk/pull/24060/files/d0848bad..bfd96710
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=24060&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=24060&range=00-01
Stats: 4 lines in 1 file changed: 0 ins; 1 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/24060.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24060/head:pull/24060
PR: https://git.openjdk.org/jdk/pull/24060
More information about the hotspot-gc-dev
mailing list