Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-43893

Memory leak in QMessagePattern::setPattern

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.1
    • 5.4.0
    • Core: Other
    • None
    • 5f6bbce4beb32bc6bc1e06f92cde56c48f946558

    Description

      If we use qSetMessagePattern with following pattern we get the following stacktrace from memory sanitizer.

      %{time yyyy.MM.dd hh:mm:ss.zzz} %{if-debug}D%{endif}%{if-warning}W%{endif}%{if-critical}C%{endif}%{if-fatal}F%{endif} %{function}(%{file}:%{line}) %{message}
      

      Direct leak of 3 byte(s) in 1 object(s) allocated from:
      #0 in operator new[](unsigned long) ([...]/binary+0x4380eb)
      #1 in QMessagePattern::setPattern(QString const&) [...]/qtbase/src/corelib/global/qlogging.cpp:998
      #2 in QMessagePattern::QMessagePattern() [...]/qtbase/src/corelib/global/qlogging.cpp:863
      #3 in (anonymous namespace)::Q_QGS_qMessagePattern::innerFunction()::Holder::Holder() [...]/qtbase/src/corelib/global/qlogging.cpp:1078
      #4 in (anonymous namespace)::Q_QGS_qMessagePattern::innerFunction() [...]/qtbase/src/corelib/global/qlogging.cpp:1078
      #5 in QGlobalStatic<QMessagePattern, (anonymous namespace)::Q_QGS_qMessagePattern::innerFunction(), (anonymous namespace)::Q_QGS_qMessagePattern::guard>::operator()() /home/andre/hg/libs/qt54/dist/include/QtCore/qglobalstatic.h:129
      #6 in qSetMessagePattern(QString const&) [...]/qtbase/src/corelib/global/qlogging.cpp:1613
      #7 in LogHandler::LogHandler() [...]/src/global/LogHandler.cpp:119:2
      #8 in __cxx_global_var_init [...]/src/global/LogHandler.cpp:73:24
      #9 in GLOBAL_sub_I_LogHandler.stdout.e6430.2629.dTxvqP.ii [...]/dist/include/QtCore/qbytearray.h
      #10 in call_init.part.0 (/lib64/ld-linux-x86-64.so.2+0xf249)

      Attachments

        For Gerrit Dashboard: QTBUG-43893
        # Subject Branch Project Status CR V

        Activity

          People

            kkohne Kai Köhne
            misery André Klitzing
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes