Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Memory leak in StackView.replace?!
Forum Updated to NodeBB v4.3 + New Features

Memory leak in StackView.replace?!

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 427 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andreas Schacherbauer
    wrote on last edited by
    #1

    Hi,
    We have setup AddressSanitizer (Enabled LeakSanitizer) and encountered a memory leak that we can't identify.

    We have a Qml StackView in our application and as soon as we call it's replace function, we get a leak of two objects from an unknown module

    =================================================================
    ==17290==ERROR: LeakSanitizer: detected memory leaks
    
    Indirect leak of 56 byte(s) in 1 object(s) allocated from:
        #0 0x7f0ac1c07d68 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded68)
        #1 0x7f0aa35b66e2  (<unknown module>)
    
    Indirect leak of 56 byte(s) in 1 object(s) allocated from:
        #0 0x7f0ac1c07d68 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded68)
        #1 0x7f0aa35b66cb  (<unknown module>)
    
    SUMMARY: AddressSanitizer: 112 byte(s) leaked in 2 allocation(s).
    

    Our call to the stack view looks like this:

    stackView.replace(null, destinationView, {}, StackView.ReplaceTransition);
    

    destinationView is a QObject subclass, allocated by us and is also released properly.
    The same behavior occurs if we replace destinationView with a Component so that the stack view is the owner of the new view.

    If we provoke other memory leaks, we do see stack traces with Qt symbols. Not sure if this is a Qml specific issue here and if, it would be interesting how we could get proper symbols for Qml objects.

    We use Qt 5.15.2.

    Thx,
    Andi

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Are you sure it's not a false positive? 112 bytes does not look very severe.

      (Z(:^

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Andreas Schacherbauer
        wrote on last edited by
        #3

        We don't really care about the leak itself but as long as it's reported, the return value of the app is not 0 which means our CI is not happy.
        So far we haven't found a way to ignore leaks from an unknown module.

        J.HilkJ 1 Reply Last reply
        0
        • A Andreas Schacherbauer

          We don't really care about the leak itself but as long as it's reported, the return value of the app is not 0 which means our CI is not happy.
          So far we haven't found a way to ignore leaks from an unknown module.

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @Andreas-Schacherbauer do you have an "initialComponent" set ? because that one is not cleared/replaced by the replace function


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Andreas Schacherbauer
            wrote on last edited by
            #5

            @J-Hilk no, we don't have an initialComponent set.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved