Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.0
-
None
-
8
-
5d26d40a5596be048be87f309df9264bac741be9 (qt/qtbase/6.0.0) 455d009a608eacd40577da2d0741a4d11259e126 (qt/qtbase/6.0) 95cea24fa2f3eed5e7d8cfca085a6f09e7643331 (qt/qtbase/dev)
-
Qt6_Foundation_Sprint 23
Description
When running tst_qfuture built with address sanitizer, I see multiple reports that the memory is leaked. Looks like it all comes from tst_QFuture::onCanceled() test.
Visible on Ubuntu 18 with GCC 7.5 ASan. Building Qt with CMake.
Leak Sanitizer output:
================================================================= ================================================================= ==10479==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 240 byte(s) in 1 object(s) allocated from: #0 0x7fb6c825e448 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0448) #1 0x7fb6c6fc0594 in QFutureInterfaceBase::QFutureInterfaceBase(QFutureInterfaceBase::State) /home/ag/work/qt5/qtbase/src/corelib/thread/qfutureinterface.cpp:76 #2 0x5619b43f37a3 in QFutureInterface<std::unique_ptr<int, std::default_delete<int> > >::QFutureInterface(QFutureInterfaceBase::State) include/QtCore/../../../../../qt5/qtbase/src/corelib/thread/qfutureinterface.h:209 #3 0x5619b43a0d36 in onCanceled<tst_QFuture::onCanceled()::<lambda()> > include/QtCore/../../../../../qt5/qtbase/src/corelib/thread/qfuture.h:390 #4 0x5619b4396ea3 in tst_QFuture::onCanceled() /home/ag/work/qt5/qtbase/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp:2728 #5 0x5619b439ca06 in tst_QFuture::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) tests/auto/corelib/thread/qfuture/tst_qfuture_autogen/include/tst_qfuture.moc:378 #6 0x7fb6c6a1fea7 in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const /home/ag/work/qt5/qtbase/src/corelib/kernel/qmetaobject.cpp:2324 #7 0x7fb6c7e40eb2 in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (/home/ag/work/build/qt5/qtbase/lib/libQt6Test.so.6+0xbdeb2) #8 0x7fb6c7e2db95 in QTest::TestMethods::invokeTestOnData(int) const /home/ag/work/qt5/qtbase/src/testlib/qtestcase.cpp:934 #9 0x7fb6c7e2fd76 in QTest::TestMethods::invokeTest(int, char const*, QTest::WatchDog*) const /home/ag/work/qt5/qtbase/src/testlib/qtestcase.cpp:1163 #10 0x7fb6c7e3333f in QTest::TestMethods::invokeTests(QObject*) const /home/ag/work/qt5/qtbase/src/testlib/qtestcase.cpp:1506 #11 0x7fb6c7e34a1e in QTest::qRun() /home/ag/work/qt5/qtbase/src/testlib/qtestcase.cpp:1933 #12 0x7fb6c7e33cb2 in QTest::qExec(QObject*, int, char**) /home/ag/work/qt5/qtbase/src/testlib/qtestcase.cpp:1841 #13 0x5619b439b6cd in main /home/ag/work/qt5/qtbase/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp:3104 #14 0x7fb6c5c14b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) Indirect leak of 240 byte(s) in 1 object(s) allocated from: #0 0x7fb6c825e448 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0448) #1 0x7fb6c6fc0594 in QFutureInterfaceBase::QFutureInterfaceBase(QFutureInterfaceBase::State) /home/ag/work/qt5/qtbase/src/corelib/thread/qfutureinterface.cpp:76 #2 0x5619b43ef3eb in QFutureInterface<int>::QFutureInterface(QFutureInterfaceBase::State) include/QtCore/../../../../../qt5/qtbase/src/corelib/thread/qfutureinterface.h:209 #3 0x5619b43a973f in then<tst_QFuture::onCanceled()::<lambda(int)> > include/QtCore/../../../../../qt5/qtbase/src/corelib/thread/qfuture.h:356 #4 0x5619b43a091a in then<tst_QFuture::onCanceled()::<lambda(int)> > include/QtCore/../../../../../qt5/qtbase/src/corelib/thread/qfuture.h:348 #5 0x5619b4396b2e in tst_QFuture::onCanceled() /home/ag/work/qt5/qtbase/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp:2715 #6 0x5619b439ca06 in tst_QFuture::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) tests/auto/corelib/thread/qfuture/tst_qfuture_autogen/include/tst_qfuture.moc:378 #7 0x7fb6c6a1fea7 in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const /home/ag/work/qt5/qtbase/src/corelib/kernel/qmetaobject.cpp:2324 #8 0x7fb6c7e40eb2 in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (/home/ag/work/build/qt5/qtbase/lib/libQt6Test.so.6+0xbdeb2) #9 0x7fb6c7e2db95 in QTest::TestMethods::invokeTestOnData(int) const /home/ag/work/qt5/qtbase/src/testlib/qtestcase.cpp:934 #10 0x7fb6c7e2fd76 in QTest::TestMethods::invokeTest(int, char const*, QTest::WatchDog*) const /home/ag/work/qt5/qtbase/src/testlib/qtestcase.cpp:1163 #11 0x7fb6c7e3333f in QTest::TestMethods::invokeTests(QObject*) const /home/ag/work/qt5/qtbase/src/testlib/qtestcase.cpp:1506 #12 0x7fb6c7e34a1e in QTest::qRun() /home/ag/work/qt5/qtbase/src/testlib/qtestcase.cpp:1933 #13 0x7fb6c7e33cb2 in QTest::qExec(QObject*, int, char**) /home/ag/work/qt5/qtbase/src/testlib/qtestcase.cpp:1841 #14 0x5619b439b6cd in main /home/ag/work/qt5/qtbase/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp:3104 #15 0x7fb6c5c14b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) ... SUMMARY: AddressSanitizer: 2376 byte(s) leaked in 26 allocation(s).
Attachments
For Gerrit Dashboard: QTBUG-87289 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
324222,8 | Fix memory leaks in QFuture's continuations | 6.0.0 | qt/qtbase | Status: MERGED | +2 | 0 |
324467,3 | Fix memory leaks in QFuture's continuations | 6.0 | qt/qtbase | Status: MERGED | +2 | 0 |
324468,3 | Fix memory leaks in QFuture's continuations | dev | qt/qtbase | Status: MERGED | +2 | 0 |