RFR: 8353815: [ubsan] compilationPolicy.cpp: division by zero related to tiered compilation flags
Vladimir Kozlov
kvn at openjdk.org
Fri Jun 20 14:43:27 UTC 2025
On Thu, 19 Jun 2025 15:15:16 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:
> A run of `runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java` with an ubsan enabled binary revealed that passing the value 0 to `Tier(3|4)LoadFeedback`, and `TieredRateUpdateMinTime` lead to division by zero.
>
> Since `Tier(3|4)LoadFeedback` should disable the scaling of the compilation thresholds, 8bf37ee special cases the 0 case to disable scaling and documents it accordingly.
>
> 4893b28 sets the lower limit for `TieredRateUpdate(Min|Max)Time` to 1 since the code assumes that at least 1ms passes between each event:
>
> https://github.com/openjdk/jdk/blob/c4fb00a7be51c7a05a29d3d57d787feb5c698ddf/src/hotspot/share/compiler/compilationPolicy.cpp#L968-L974
>
> This PR was tested with:
> - [ ] [Github Actions](https://github.com/mhaessig/jdk/actions/runs/15760915006)
> - [x] tier1 and 2 plus Oracle internal testing on Oracle supported platforms
Good
-------------
Marked as reviewed by kvn (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/25902#pullrequestreview-2946418057
More information about the hotspot-compiler-dev
mailing list