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

Coleen Phillimore coleenp at openjdk.org
Tue Dec 2 17:05:07 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

Yes, this looks good. Changing to int was a good idea.

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

Marked as reviewed by coleenp (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28576#pullrequestreview-3531239723


More information about the hotspot-runtime-dev mailing list