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

ubsan: shenandoahAdaptiveHeuristics.cpp:245:44: runtime error: division by zero

XMLWordPrintable

    • gc
    • b08
    • generic
    • linux

        When running with ubsan enabled test binaries, the following error has been observed :
        Test gc/logging/TestGCId.jtr :

         stderr: [/jdk/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp:245:44: runtime error: division by zero
            #0 0x7fff88638d6c in ShenandoahAdaptiveHeuristics::should_start_gc() (/build/images/jdk/lib/server/libjvm.so+0x7998d6c)
            #1 0x7fff88703d58 in ShenandoahControlThread::run_service() (/build/images/jdk/lib/server/libjvm.so+0x7a63d58)
            #2 0x7fff8628b730 in ConcurrentGCThread::run() (/build/images/jdk/lib/server/libjvm.so+0x55eb730)
            #3 0x7fff88cd9208 in Thread::call_run() (/build/images/jdk/lib/server/libjvm.so+0x8039208)
            #4 0x7fff880e6928 in thread_native_entry(Thread*) (/build/images/jdk/lib/server/libjvm.so+0x7446928)
            #5 0x7fff8dd79714 in start_thread (/lib64/libpthread.so.0+0x9714)
            #6 0x7fff8d12b774 in __GI___clone (/lib64/libc.so.6+0x13b774)

        Looks like avg_alloc_rate can sometimes be zero, and we do not handle this at the moment :

          double avg_alloc_rate = _allocation_rate.upper_bound(_margin_of_error_sd);
          if (avg_cycle_time > allocation_headroom / avg_alloc_rate) {

        Maybe we should simply test for if (avg_alloc_rate != 0,0f && ... ) additionally ?

              wkemper William Kemper
              mbaesken Matthias Baesken
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: