RFR: 8353815: [ubsan] compilationPolicy.cpp: division by zero related to tiered compilation flags

Manuel Hässig mhaessig at openjdk.org
Thu Jun 19 15:19:40 UTC 2025


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

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

Commit messages:
 - Increase lower bound of TieredRateUpdate(Min|Max)Time to 1ms
 - Disable compilation threshold scaling for Tier(3|4)LoadFeedback=0

Changes: https://git.openjdk.org/jdk/pull/25902/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25902&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8353815
  Stats: 7 lines in 2 files changed: 2 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/25902.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25902/head:pull/25902

PR: https://git.openjdk.org/jdk/pull/25902


More information about the hotspot-compiler-dev mailing list