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

Valgrind Memory Leak in QXmlSchema

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.7, 5.15.2
    • XML: QtXmlPatterns
    • None
    • OpenSuse 15.3
    • Linux/X11

    Description

      I've found a memory leak in QXmlSchema.

      $ valgrind --tool=memcheck --leak-check=full ./test
      
      ==21494== 27,468 (96 direct, 27,372 indirect) bytes in 3 blocks are definitely lost in loss record 5,346 of 5,367 
      ==21494==    at 0x4C332EF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) 
      ==21494==    by 0x6BDEDF1: QListData::detach_grow(int*, int) (in /usr/lib64/libQt5Core.so.5.12.7) 
      ==21494==    by 0x63279D9: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) 
      ==21494==    by 0x6327B4E: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) 
      ==21494==    by 0x63B93C9: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) 
      ==21494==    by 0x63BA47D: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) 
      ==21494==    by 0x63BAA12: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) 
      ==21494==    by 0x622414C: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) 
      ==21494==    by 0x622444A: ??? (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) 
      ==21494==    by 0x62233AD: QXmlSchema::load(QByteArray const&, QUrl const&) (in /usr/lib64/libQt5XmlPatterns.so.5.12.7) 
      ==21494==    by 0x4033E0: Dialog::test() (dialog.cpp:35) 
      ==21494==    by 0x403D44: Dialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_dialog.cpp:71) 
      ==21494==

      The presence and size of the leak depends on the file being uploaded. It is recommended to test the file included in the test project.

         QXmlSchema sch;
          QDomDocument xsddoc;
         QFile filexsd("./settings.xsd");
          if(filexsd.open(QIODevice::ReadOnly | QIODevice::Text)){
              qDebug()<< "open xsd\n";
              if(xsddoc.setContent(&filexsd)){
                      sch.load(xsddoc.toByteArray());
                      qDebug()<< "loaded xsd\n";
              }
              filexsd.close();
          }
      

      This behavior is similar to earlier in  QTBUG-62691

      Attachments

        1. settings.xsd
          18 kB
          Tim Usach
        2. test_src.zip
          381 kB
          Tim Usach
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            usacht Tim Usach
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes