RFR: 8353815: [ubsan] compilationPolicy.cpp: division by zero related to tiered compilation flags
duke
duke at openjdk.org
Mon Jun 23 06:50:32 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
@mhaessig
Your change (at version 4893b288e4f69e03fdc52281603b4718b3668cb2) is now ready to be sponsored by a Committer.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25902#issuecomment-2995151043
More information about the hotspot-compiler-dev
mailing list