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

infinite loop in LogOutputList::wait_until_no_readers()

    XMLWordPrintable

Details

    • svc
    • b25

    Backports

      Description

        While observing a loop while using -verbose option it would seem that a destructor call
        in the iterator constructor causes wait_until_no_readers to go into an infinite loop.

        On analysis the issue seems to be in file src/hotspot/share/logging/logOutputList.cpp

        The issue is due to invoking of destructor in iterator constructor due to creation of
        an object in the following code:

         Iterator iterator(LogLevelType level = LogLevel::Last) {
            increase_readers();
            return Iterator(this, _level_start[level]);
          }

        Again, when the object is destroyed, the destructor is called again.

        Due to this the _active_readers count becomes negative and wait_until_no_readers
        goes into infinite loop.

        void LogOutputList::wait_until_no_readers() const {
          OrderAccess::storeload();
          while (_active_readers != 0) {
            // Busy wait
          }
        }

        Attachments

          Issue Links

            Activity

              People

                dbuck David Buck
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: