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

Memory leak from svg containing text

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 5.12
    • SVG Support
    • None
    • Ubuntu 18.04 LTS 64 bit
      clang 6.0.0
      gcc 7.4.0
    • Linux/Wayland

    Description

      1. Have a simple program running QSvgRenderer::render:
        #include <QApplication>
        #include <QImage>
        #include <QPainter>
        #include <QString>
        #include <QSvgRenderer>
        
        int main(int argc, char *argv[]) {
            QApplication a(argc, argv);
            static QImage image(200, 200, QImage::Format_RGB32);
            static QPainter painter(&image);
            QString filename(argv[1]);
            QSvgRenderer renderer(filename);
            renderer.render(&painter);
            return 0;
        }
        
      2. Build it on Qt 5.12.3, built with -sanitize address.
        In case it's important, mine also was a release build.
      3. Run the program passing the attached input file as parameter: <svg><text></text></svg>
        The program reports a leak:
        Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
        
        =================================================================
        ==10779==ERROR: LeakSanitizer: detected memory leaks
        
        Direct leak of 256 byte(s) in 1 object(s) allocated from:
            #0 0x7f1a8f1e0b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
            #1 0x7f1a81a7e8ed  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1d8ed)
        
        Indirect leak of 32 byte(s) in 1 object(s) allocated from:
            #0 0x7f1a8f1e0d38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
            #1 0x7f1a81a7efd8  (/usr/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1dfd8)
        
        SUMMARY: AddressSanitizer: 288 byte(s) leaked in 2 allocation(s).
        

      Attachments

        1. QTBUG-75518.svg
          0.0 kB
        2. svgleak.zip
          0.6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            allan.jensen Allan Sandfeld Jensen
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes