RFR: 8358706: Integer overflow with -XX:MinOopMapAllocation=-1 [v2]

Casper Norrbin cnorrbin at openjdk.org
Wed Dec 3 10:06:35 UTC 2025


On Mon, 1 Dec 2025 14:33:19 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:

>> 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.
>
> Casper Norrbin has updated the pull request incrementally with one additional commit since the last revision:
> 
>   change flag type to int

Thank you both for the reviews!

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

PR Comment: https://git.openjdk.org/jdk/pull/28576#issuecomment-3606030527


More information about the hotspot-runtime-dev mailing list