RFR: 8358706: Integer overflow with -XX:MinOopMapAllocation=-1
Casper Norrbin
cnorrbin at openjdk.org
Mon Dec 1 14:07:22 UTC 2025
Hi everyone,
Passing a negative value to `-XX:MinOopMapAllocation` could trigger an integer overflow. This value is used as the initial size for the `OopMap` `GrowableArray` list inside `OopMapSet`. Negative inputs hits an assert when allocating for `GrowableArray`. Restricting this flag to positive values ensures we get a clear error message instead of a crash.
Testing:
- Oracle tier 1
- Local tests with `-XX:MinOopMapAllocation=x`, covering both valid and invalid values.
-------------
Commit messages:
- constraint on MinOopMapAllocation
Changes: https://git.openjdk.org/jdk/pull/28576/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28576&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8358706
Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/28576.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28576/head:pull/28576
PR: https://git.openjdk.org/jdk/pull/28576
More information about the hotspot-runtime-dev
mailing list