Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8347267

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

XMLWordPrintable

        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.

        This seems to come from the division by a total_delta (of ticks) == 0 :
            jlong used_delta = used - last_used;
            jlong total_delta = total - last_total;

            jdouble cpu = (jdouble) used_delta / total_delta;

              mbaesken Matthias Baesken
              mbaesken Matthias Baesken
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: