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

[ubsan] compilationPolicy.cpp:308:35: runtime error: division by zero

XMLWordPrintable

    • aarch64
    • os_x

      When running with ubsan-enabled binaries, the hs jtreg tests
      runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java#id8 (-XX:Tier3LoadFeedback=0)
      runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java#id9 (sets -XX:Tier4LoadFeedback=0)

      show a division by zero in the following code; this seems to be related to the feedback_k factor 0 set by Tier3LoadFeedback/Tier4LoadFeedback ;

      double CompilationPolicy::threshold_scale(CompLevel level, int feedback_k) {
        int comp_count = compiler_count(level);
        if (comp_count > 0) {
          double queue_size = CompileBroker::queue_size(level);
          double k = (double)queue_size / ((double)feedback_k * (double)comp_count) + 1; // <----- division by zero

      Message is :

      TEST FAILED: Error processing option Tier3LoadFeedback with valid value '-server -XX:+UseG1GC -XX:Tier3LoadFeedback=0'! JVM exited with unexpected error code = 134 [0x86]
      stdout content[]
      stderr content[/priv/jenkins/client-home/workspace/openjdk-jdk-weekly-macos_aarch64-opt/jdk/src/hotspot/share/compiler/compilationPolicy.cpp:308:35: runtime error: division by zero
          #0 0x1065c1990 in CompilationPolicy::threshold_scale(CompLevel, int) compilationPolicy.cpp:308
          #1 0x1065c54ec in LoopPredicate::apply(methodHandle const&, CompLevel, int, int) compilationPolicy.cpp
          #2 0x1065c47a4 in CompLevel CompilationPolicy::common<LoopPredicate>(methodHandle const&, CompLevel, bool) compilationPolicy.cpp:1042
          #3 0x1065c4584 in CompilationPolicy::call_event(methodHandle const&, CompLevel, Thread*) compilationPolicy.cpp:1110
          #4 0x1065c3324 in CompilationPolicy::method_invocation_event(methodHandle const&, methodHandle const&, CompLevel, nmethod*, JavaThread*) compilationPolicy.cpp:1148
          #5 0x1065c3100 in CompilationPolicy::event(methodHandle const&, methodHandle const&, int, int, CompLevel, nmethod*, JavaThread*) compilationPolicy.cpp:736
          #6 0x106bba260 in InterpreterRuntime::frequency_counter_overflow_inner(JavaThread*, unsigned char*) interpreterRuntime.cpp:1074
          #7 0x106bb9fdc in InterpreterRuntime::frequency_counter_overflow(JavaThread*, unsigned char*) interpreterRuntime.cpp:1023
          #8 0x1396038c0 (<unknown module>)
          #9 0x13960090c (<unknown module>)
          #10 0x13960090c (<unknown module>)
          #11 0x13960090c (<unknown module>)
          #12 0x13960090c (<unknown module>)
          #13 0x13960090c (<unknown module>)
          #14 0x13960090c (<unknown module>)
          #15 0x13960090c (<unknown module>)
          #16 0x13960081c (<unknown module>)
          #17 0x13960081c (<unknown module>)
          #18 0x13960081c (<unknown module>)
          #19 0x1395fc150 (<unknown module>)
          #20 0x106bcc724 in JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) javaCalls.cpp:415
          #21 0x106bcbaac in JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) javaCalls.cpp:250
          #22 0x106bcbb90 in JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaThread*) javaCalls.cpp:256
          #23 0x107444030 in call_initPhase1(JavaThread*) threads.cpp:298
          #24 0x107443424 in Threads::initialize_java_lang_classes(JavaThread*, JavaThread*) threads.cpp:382
          #25 0x107444ec8 in Threads::create_vm(JavaVMInitArgs*, bool*) threads.cpp:671
          #26 0x106cb7de4 in JNI_CreateJavaVM jni.cpp:3678
          #27 0x102566510 in JavaMain java.c:494
          #28 0x10256d53c in ThreadJavaMain java_md_macosx.m:679
          #29 0x1936fef90 in _pthread_start+0x84 (libsystem_pthread.dylib:arm64e+0x6f90)
          #30 0x1936f9d30 in thread_start+0x4 (libsystem_pthread.dylib:arm64e+0x1d30)

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

              Created:
              Updated: