RFR: 8367317: ZGC: ZVirtualMemoryReserver::force_reserve_discontiguous arithmetic underflow [v5]
Axel Boldt-Christmas
aboldtch at openjdk.org
Fri Oct 24 06:49:39 UTC 2025
> ZVirtualMemoryReserver::force_reserve_discontiguous is a debug only API used to simulate and test a discontinuous heap. The loop variable `end` is incorrectly checked which may lead to an underflow.
>
> In our normal testing we never observe this as the address space is always available. We observed this issue when running a hardened build (like ASAN) which had already mmapped the address space we tried to reserve.
>
> Rather than always jump two reserve sizes in its search, it searches every reserve size, moving an extra reserve size every time it succeeds with a reservation (so that there always is a gap). Searching in reserve sized steps is not really a requirement here, we could have just used a granule sized step.
Axel Boldt-Christmas 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 five additional commits since the last revision:
- Merge tag 'jdk-26+21' into JDK-8367317
Added tag jdk-26+21 for changeset 3e20a939
- Merge tag 'jdk-26+19' into JDK-8367317
Added tag jdk-26+19 for changeset b37a1a33
- Merge tag 'jdk-26+18' into JDK-8367317
Added tag jdk-26+18 for changeset 5251405c
- Merge tag 'jdk-26+17' into JDK-8367317
Added tag jdk-26+17 for changeset 2aafda19
- 8367317: ZGC: ZVirtualMemoryReserver::force_reserve_discontiguous arithmetic underflow
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27207/files
- new: https://git.openjdk.org/jdk/pull/27207/files/da962d1f..5338f590
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27207&range=04
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27207&range=03-04
Stats: 36081 lines in 862 files changed: 21933 ins; 9676 del; 4472 mod
Patch: https://git.openjdk.org/jdk/pull/27207.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27207/head:pull/27207
PR: https://git.openjdk.org/jdk/pull/27207
More information about the hotspot-gc-dev
mailing list