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

AsyncLogging will crash if rotate() fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 17
    • 17
    • hotspot
    • 17
    • b26
    • generic
    • generic

    Description

      AsyncLogWriter::write() invokes LogFileOutput::write_blocking() directly.

      int LogFileOutput::write_blocking(const LogDecorations& decorations, const char* msg) {
        _rotation_semaphore.wait();
        int written = LogFileStreamOutput::write(decorations, msg);
        if (written > 0) {
          _current_size += written;

          if (should_rotate()) {
            rotate();
          }
        }
        _rotation_semaphore.signal();

        return written;
      }

      However, it doesn't put an exception case into consideraton.
      rotate() may fail before and leave _stream NULL.

      LogFileStreamOutput::write() will crash at flockfile(NULL)

      Attachments

        Issue Links

          Activity

            People

              xliu Xin Liu
              xliu Xin Liu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: