Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-2822

Crash in LogBufferIterator::next

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.2.1, 5.0.0
    • 4.2.2, 5.0.0
    • Logging
    • None

    Description

      It appears there is a crash in traffic_logstats that's consistently happening in LogBufferIterator::next, a sample stack trace is attached. I'll be looking into the issue.

      #0 0x0000000000465c1d in LogBufferIterator::next (this=0x7fff435bd7b0) at LogBuffer.cc:813
      #1 0x0000000000448fd2 in parse_log_buff (buf_header=0x7fff435bd900, summary=false) at logstats.cc:1234
      #2 0x0000000000449660 in process_file (in_fd=8, offset=0, max_age=0) at logstats.cc:1757
      #3 0x000000000044d031 in main (argv=0x7fff435ce1a8) at logstats.cc:2558

      It appears the issue is related to logstats.cc::process_file(), the final read when it will read the contents of the log buffer can return a value less than buffer_bytes; and since header is an aliased pointer of buffer, the contents of header and the subsequent buffers can be invalid data, the solution in my opinion would be to loop until all required data has been read before calling parse_log_buff().

      Attachments

        Activity

          People

            psudaemon Phil Sorber
            briang Brian Geffon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: