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

logStream::write re-formats string

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • hotspot
    • None
    • svc
    • b107
    • generic
    • generic

      The logStream::write function takes a char* string and size, accumulating data in _current_line. If the string completes a line (ends with a newline), the configured _log_func is applied to the collected string.

      logStream::write is used as the underlying implementation of the log stream formatted printing functions, providing the underlying support for post-formatting accumulation of the output.

      However, the _log_func is also a formatting function, taking a char* format string and varargs.

      Most of the time, this doesn't matter much; the _log_func just wastes some time looking for format directives in the accumulated output. However, if the output contains "%" characters, they are improperly treated as format directives, with bad results, such as failed assertions or undefined behavior.

            kbarrett Kim Barrett
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: