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

Memory leak in QXcbSessionManager

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.1.0
    • QPA: X11/XCB
    • None
    • Linux/X11

    Description

      When checking our application for memory leaks, we found some memory not freed by the QXcbSessionManager, e.g.:

      ==122696== 4 bytes in 1 blocks are still reachable in loss record 2 of 95
      ==122696==    at 0x483E77F: malloc (vg_replace_malloc.c:307)
      ==122696==    by 0x7FD15BE: strdup (in /usr/lib/libc-2.33.so)
      ==122696==    by 0x9151B08: IceRegisterForProtocolSetup (in /usr/lib/libICE.so.6.3.0)
      ==122696==    by 0x9138655: SmcOpenConnection (in /usr/lib/libSM.so.6.0.1)
      ==122696==    by 0x8F26964: QXcbSessionManager::QXcbSessionManager(QString const&, QString const&) (in /local/ssd/mlangen/build/a3gui.default/usr/lib/libQt6XcbQpa.so.6.1.0)
      ==122696==    by 0x8F03A9A: QXcbIntegration::createPlatformSessionManager(QString const&, QString const&) const (in /local/ssd/mlangen/build/a3gui.default/usr/lib/libQt6XcbQpa.so.6.1.0)
      ==122696==    by 0x552EEEF: QSessionManagerPrivate::QSessionManagerPrivate(QString const&, QString const&) (in /local/ssd/mlangen/build/a3gui.default/usr/lib/libQt6Gui.so.6.1.0)
      ==122696==    by 0x552EFE4: QSessionManager::QSessionManager(QGuiApplication*, QString&, QString&) (in /local/ssd/mlangen/build/a3gui.default/usr/lib/libQt6Gui.so.6.1.0)
      ==122696==    by 0x54EFC76: QGuiApplicationPrivate::init() (in /local/ssd/mlangen/build/a3gui.default/usr/lib/libQt6Gui.so.6.1.0)
      ==122696==    by 0x4C5734D: QApplicationPrivate::init() (in /local/ssd/mlangen/build/a3gui.default/usr/lib/libQt6Widgets.so.6.1.0)
      

      You can trigger the output by using valgrind with the --leak-check=full --show-leak-kinds=all options on the following program:

      #include <QApplication> 
       
      int main(int argc, char **argv) 
      { 
          QApplication app(argc, argv); 
          return 0;
      }

      Having a look at the source code, it looks like the open Smc connection is closed again, but maybe there might be more to be done...
       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            liaqi Liang Qi
            mlangen Marc Langenbach
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes