Memory leak in StackView.replace?!
-
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 replacedestinationView
with aComponent
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 -
Are you sure it's not a false positive? 112 bytes does not look very severe.
-
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. -
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.@Andreas-Schacherbauer do you have an "initialComponent" set ? because that one is not cleared/replaced by the replace function
-
@J-Hilk no, we don't have an
initialComponent
set.