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

Potential race in parallel gc task time printing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • gc

      While reviewing JDK-8146409 we found a potential race in printing task time stamps with an assert.

      GCTaskManager::print_task_time_stamps() contains the code

      if (!log_is_enabled(Debug, gc, task, time)) {
        return;
      }

      for (all threads t) {
        t->print_task_time_stamps();
      }

      And GCTaskThread::print_task_time_stamps() starts with

      assert(log_is_enabled(Debug, gc, task, time), "sanity");

      This latter assert might actually trigger since logging can be reconfigured any time, i.e. if the logging is reconfigured between the early exit in GCTaskManager::print_task_time_stamps() and the assert.

      This potential issue has been found purely by code review. Is only possible when asserts are enabled too. Needs to be verified somehow.

      The suggested fix is to simply remove the assert in GCTaskThread::print_task_time_stamps().

            Unassigned Unassigned
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: