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

SIGFPE in CMSCollector::preclean with big CMSScheduleRemarkSamplingRatio

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      gc
    • Resolved In Build:
      b116

      Description

      Running following command(run TestGCOld hotspot jtreg test) cause JVM exit with SIGFPE signal:
      java -XX:+UseConcMarkSweepGC -XX:CMSScheduleRemarkSamplingRatio=9223372036854775808 TestGCOld 10 10 10 10 10000
      ...
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGFPE (0x8) at pc=0x00007f16ab3970c2, pid=6845, tid=6849
      #
      # JRE version: Java(TM) SE Runtime Environment (9.0) (fastdebug build 9-internal+0-2016-03-10-011512.daholme.jdk9-hs-rt)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 9-internal+0-2016-03-10-011512.daholme.jdk9-hs-rt, mixed mode, tiered, compressed oops, concurrent mark sweep gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x9180c2] CMSCollector::preclean()+0xe2
      #
      ...

      hs_err_pid6845.log is attached.

      32 bit JVM also affected:
      java -XX:+UseConcMarkSweepGC -XX:CMSOldPLABNumRefills=2147483648 TestGCOld 10 10 10 10 10000

      The problem in overflow in CMSCollector::preclean() function:
      void CMSCollector::preclean() {
      ...
          if (used < (capacity/(CMSScheduleRemarkSamplingRatio * 100)
                      * CMSScheduleRemarkEdenPenetration)) {
      ...
      }

      CMSScheduleRemarkSamplingRatio have 'max_uintx' max range and 'CMSScheduleRemarkSamplingRatio * 100' can results in 0 due to the overflow and this can cause division by zero.

        Attachments

          Activity

            People

            • Assignee:
              sangheki Sangheon Kim
              Reporter:
              ddmitriev Dmitry Dmitriev
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: