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

logStream::write re-formats string

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      svc
    • Resolved In Build:
      b107
    • CPU:
      generic
    • OS:
      generic

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: