RFR: 8347267: [macOS]: UnixOperatingSystem.c:67:40: runtime error: division by zero

Kevin Walls kevinw at openjdk.org
Thu Jan 9 19:25:40 UTC 2025


On Thu, 9 Jan 2025 15:13:01 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> When running ubsan-enabled binaries on macOS aarch64, in test
> javax/management/MBeanServer/OldMBeanServerTest.java
> the following division by zero is shown :
> src/jdk.management/macosx/native/libmanagement_ext/UnixOperatingSystem.c:67:40: runtime error: division by zero
> UndefinedBehaviorSanitizer:DEADLYSIGNAL
> UndefinedBehaviorSanitizer: nested bug in the same thread, aborting.
> 
> We should add special handling for the case ` (total_delta == 0)` .

Hi, looks good.
It is odd that this is never known to happen (zero ticks elapsed!) before, so we might wonder what ubsan is really changing here.
But even if it only happens with ubsan, we can protect ourselves.  8-)

(as long as we aren't changing too much to suit the tool -- we don't seem to be there yet!)

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

Marked as reviewed by kevinw (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/23010#pullrequestreview-2540756390


More information about the serviceability-dev mailing list