RFR: 8340631: assert(reserved_rgn->contain_region(base_addr, size)) failed: Reserved CDS region should contain this mapping region [v11]
Ioi Lam
iklam at openjdk.org
Thu Jan 9 02:30:38 UTC 2025
On Thu, 9 Jan 2025 00:27:57 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
>> What testing with `UseCompressedClassPointers` set to false, this assert is hit due to memory being released twice during the failure path of CDS archive mapping. This patch makes it so the RW and RO regions are only released once at the end in `MetaspaceShared::release_reserved_spaces()`.
>>
>> This patch hides `unmap_region` as the method should not be called on regions that were reserved. Instead, the region is skipped and we verify that it is indeed in the reserved space. Verified` with tier 1-4 tests.
>
> Matias Saavedra Silva has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 16 additional commits since the last revision:
>
> - Fixed copyright
> - Ioi suggestions
> - Merge branch 'master' into cds_mapping_8340631
> - Replaced memset
> - Fixed assert
> - Merge branch 'master' into cds_mapping_8340631
> - New implementation
> - Stefan and Ioi comments
> - Corrected edge case
> - Removed unneeded assert and caught edge case
> - ... and 6 more: https://git.openjdk.org/jdk/compare/84b14f43...65db5d02
src/hotspot/share/cds/metaspaceShared.cpp line 1357:
> 1355: } else {
> 1356: // The RW and RO regions are in a reserved space so they must only be
> 1357: // unmapped when the reserved space is released
I think this comment is not always true and should be removed. On Windows, sometimes the RO/RW regions are not in a ReservedSpace.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22743#discussion_r1908082342
More information about the hotspot-runtime-dev
mailing list