RFR: 8366145: G1: Help diagnose ubsan division by zero in computing pause time ratios (g1Analytics.cpp) [v2]
Leo Korinth
lkorinth at openjdk.org
Wed Aug 27 16:26:53 UTC 2025
> This pull request is created to help diagnose the bug report https://bugs.openjdk.org/browse/JDK-8354430.
>
> The problem is that we get a ubsan runtime error when dividing by zero. Ubsan is not normally running, so I will add an assert making it easier to catch the problem and printing the value of the two variables that when subtracted will create a zero; it will hopefully help with diagnosis.
>
> Some comments:
> 1) the result of `most_recent_gc_end_time_sec()` will not change within the function, thus I will not clutter the code with a new variable, is that okay?
> 2) I added two calls to `fabs` which are most probably not needed (ieee floating point rules seems to say that positive and negative zero equals). However I think my proposed code makes it clear that I have thought about it.
>
> I am now running tier1-3
Leo Korinth has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:
- Merge branch 'master' into _8366145
- 8366145: Help diagnose ubsan failure
-------------
Changes: https://git.openjdk.org/jdk/pull/26939/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26939&range=01
Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/26939.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/26939/head:pull/26939
PR: https://git.openjdk.org/jdk/pull/26939
More information about the hotspot-gc-dev
mailing list