Skip to content

Memory Leak in Open With External Tool #893

Open
@borgmanJeremy

Description

@borgmanJeremy

Flameshot version
Master branch (0.8 candidate)

To Reproduce
Build flameshot with address and leak sanitizer enabled. Use open with external tool.

Log

==2855737==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 2376 byte(s) in 27 object(s) allocated from:
    #0 0x7f68072c3f41 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x7f6805fc6888  (/usr/lib/libQt5Core.so.5+0x2de888)

Indirect leak of 1440 byte(s) in 9 object(s) allocated from:
    #0 0x7f68072c2459 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x7f6805fc2f65 in QObjectPrivate::addConnection(int, QObjectPrivate::Connection*) (/usr/lib/libQt5Core.so.5+0x2daf65)

Indirect leak of 768 byte(s) in 8 object(s) allocated from:
    #0 0x7f68072c3f41 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x7f6806cf6724 in QStyledItemDelegate::QStyledItemDelegate(QObject*) (/usr/lib/libQt5Widgets.so.5+0x3e6724)
    #2 0x56261a9bf199 in AppLauncherWidget::configureListView(QListWidget*) /home/jeremy/github/borgman_flameshot/src/tools/launcher/applauncherwidget.cpp:241
    #3 0x56261a9bc6b2 in AppLauncherWidget::initListWidget() /home/jeremy/github/borgman_flameshot/src/tools/launcher/applauncherwidget.cpp:188
    #4 0x56261a9b43f5 in AppLauncherWidget::AppLauncherWidget(QPixmap const&, QWidget*) /home/jeremy/github/borgman_flameshot/src/tools/launcher/applauncherwidget.cpp:69
    #5 0x56261a9b2863 in AppLauncher::widget() /home/jeremy/github/borgman_flameshot/src/tools/launcher/applaunchertool.cpp:58
    #6 0x56261a932748 in CaptureWidget::handleButtonSignal(CaptureTool::Request) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturewidget.cpp:782
    #7 0x56261a952972 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<CaptureTool::Request>, void, void (CaptureWidget::*)(CaptureTool::Request)>::call(void (CaptureWidget::*)(CaptureTool::Request), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:152
    #8 0x56261a951238 in void QtPrivate::FunctionPointer<void (CaptureWidget::*)(CaptureTool::Request)>::call<QtPrivate::List<CaptureTool::Request>, void>(void (CaptureWidget::*)(CaptureTool::Request), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:185
    #9 0x56261a94ea45 in QtPrivate::QSlotObject<void (CaptureWidget::*)(CaptureTool::Request), QtPrivate::List<CaptureTool::Request>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt/QtCore/qobjectdefs_impl.h:418
    #10 0x7f6805fd0a05  (/usr/lib/libQt5Core.so.5+0x2e8a05)
    #11 0x56261a7879ef in CaptureTool::requestAction(CaptureTool::Request) /home/jeremy/github/borgman_flameshot/cmake-build-debug/src/flameshot_autogen/CB6E7VNMGS/moc_capturetool.cpp:174
    #12 0x56261a9b2ea9 in AppLauncher::pressed(CaptureContext const&) /home/jeremy/github/borgman_flameshot/src/tools/launcher/applaunchertool.cpp:72
    #13 0x56261a92f2bd in CaptureWidget::processTool(CaptureTool*) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturewidget.cpp:695
    #14 0x56261a92d7d1 in CaptureWidget::setState(CaptureButton*) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturewidget.cpp:664
    #15 0x56261a952393 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<CaptureButton*>, void, void (CaptureWidget::*)(CaptureButton*)>::call(void (CaptureWidget::*)(CaptureButton*), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:152
    #16 0x56261a9511f3 in void QtPrivate::FunctionPointer<void (CaptureWidget::*)(CaptureButton*)>::call<QtPrivate::List<CaptureButton*>, void>(void (CaptureWidget::*)(CaptureButton*), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:185
    #17 0x56261a94e59f in QtPrivate::QSlotObject<void (CaptureWidget::*)(CaptureButton*), QtPrivate::List<CaptureButton*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt/QtCore/qobjectdefs_impl.h:418
    #18 0x7f6805fd0a05  (/usr/lib/libQt5Core.so.5+0x2e8a05)
    #19 0x56261a7a39d3 in CaptureButton::pressedButton(CaptureButton*) /home/jeremy/github/borgman_flameshot/cmake-build-debug/src/flameshot_autogen/3PDZ6QXSRB/moc_capturebutton.cpp:197
    #20 0x56261a8f70a2 in CaptureButton::mousePressEvent(QMouseEvent*) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturebutton.cpp:143
    #21 0x7f6806aaac7d in QWidget::event(QEvent*) (/usr/lib/libQt5Widgets.so.5+0x19ac7d)

Indirect leak of 360 byte(s) in 9 object(s) allocated from:
    #0 0x7f68072c3f41 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x7f6805fc2d87 in QObjectPrivate::addConnection(int, QObjectPrivate::Connection*) (/usr/lib/libQt5Core.so.5+0x2dad87)

Indirect leak of 144 byte(s) in 9 object(s) allocated from:
    #0 0x7f68072c3f41 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x7f6805df73f1 in QtSharedPointer::ExternalRefCountData::getAndRef(QObject const*) (/usr/lib/libQt5Core.so.5+0x10f3f1)

Indirect leak of 128 byte(s) in 8 object(s) allocated from:
    #0 0x7f68072c3f41 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x56261a9bf185 in AppLauncherWidget::configureListView(QListWidget*) /home/jeremy/github/borgman_flameshot/src/tools/launcher/applauncherwidget.cpp:241
    #2 0x56261a9bc6b2 in AppLauncherWidget::initListWidget() /home/jeremy/github/borgman_flameshot/src/tools/launcher/applauncherwidget.cpp:188
    #3 0x56261a9b43f5 in AppLauncherWidget::AppLauncherWidget(QPixmap const&, QWidget*) /home/jeremy/github/borgman_flameshot/src/tools/launcher/applauncherwidget.cpp:69
    #4 0x56261a9b2863 in AppLauncher::widget() /home/jeremy/github/borgman_flameshot/src/tools/launcher/applaunchertool.cpp:58
    #5 0x56261a932748 in CaptureWidget::handleButtonSignal(CaptureTool::Request) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturewidget.cpp:782
    #6 0x56261a952972 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<CaptureTool::Request>, void, void (CaptureWidget::*)(CaptureTool::Request)>::call(void (CaptureWidget::*)(CaptureTool::Request), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:152
    #7 0x56261a951238 in void QtPrivate::FunctionPointer<void (CaptureWidget::*)(CaptureTool::Request)>::call<QtPrivate::List<CaptureTool::Request>, void>(void (CaptureWidget::*)(CaptureTool::Request), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:185
    #8 0x56261a94ea45 in QtPrivate::QSlotObject<void (CaptureWidget::*)(CaptureTool::Request), QtPrivate::List<CaptureTool::Request>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt/QtCore/qobjectdefs_impl.h:418
    #9 0x7f6805fd0a05  (/usr/lib/libQt5Core.so.5+0x2e8a05)
    #10 0x56261a7879ef in CaptureTool::requestAction(CaptureTool::Request) /home/jeremy/github/borgman_flameshot/cmake-build-debug/src/flameshot_autogen/CB6E7VNMGS/moc_capturetool.cpp:174
    #11 0x56261a9b2ea9 in AppLauncher::pressed(CaptureContext const&) /home/jeremy/github/borgman_flameshot/src/tools/launcher/applaunchertool.cpp:72
    #12 0x56261a92f2bd in CaptureWidget::processTool(CaptureTool*) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturewidget.cpp:695
    #13 0x56261a92d7d1 in CaptureWidget::setState(CaptureButton*) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturewidget.cpp:664
    #14 0x56261a952393 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<CaptureButton*>, void, void (CaptureWidget::*)(CaptureButton*)>::call(void (CaptureWidget::*)(CaptureButton*), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:152
    #15 0x56261a9511f3 in void QtPrivate::FunctionPointer<void (CaptureWidget::*)(CaptureButton*)>::call<QtPrivate::List<CaptureButton*>, void>(void (CaptureWidget::*)(CaptureButton*), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:185
    #16 0x56261a94e59f in QtPrivate::QSlotObject<void (CaptureWidget::*)(CaptureButton*), QtPrivate::List<CaptureButton*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt/QtCore/qobjectdefs_impl.h:418
    #17 0x7f6805fd0a05  (/usr/lib/libQt5Core.so.5+0x2e8a05)
    #18 0x56261a7a39d3 in CaptureButton::pressedButton(CaptureButton*) /home/jeremy/github/borgman_flameshot/cmake-build-debug/src/flameshot_autogen/3PDZ6QXSRB/moc_capturebutton.cpp:197
    #19 0x56261a8f70a2 in CaptureButton::mousePressEvent(QMouseEvent*) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturebutton.cpp:143
    #20 0x7f6806aaac7d in QWidget::event(QEvent*) (/usr/lib/libQt5Widgets.so.5+0x19ac7d)

Indirect leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x7f68072c3f41 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x7f6806cf6724 in QStyledItemDelegate::QStyledItemDelegate(QObject*) (/usr/lib/libQt5Widgets.so.5+0x3e6724)
    #2 0x56261a9bf199 in AppLauncherWidget::configureListView(QListWidget*) /home/jeremy/github/borgman_flameshot/src/tools/launcher/applauncherwidget.cpp:241
    #3 0x56261a9b57f9 in AppLauncherWidget::AppLauncherWidget(QPixmap const&, QWidget*) /home/jeremy/github/borgman_flameshot/src/tools/launcher/applauncherwidget.cpp:87
    #4 0x56261a9b2863 in AppLauncher::widget() /home/jeremy/github/borgman_flameshot/src/tools/launcher/applaunchertool.cpp:58
    #5 0x56261a932748 in CaptureWidget::handleButtonSignal(CaptureTool::Request) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturewidget.cpp:782
    #6 0x56261a952972 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<CaptureTool::Request>, void, void (CaptureWidget::*)(CaptureTool::Request)>::call(void (CaptureWidget::*)(CaptureTool::Request), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:152
    #7 0x56261a951238 in void QtPrivate::FunctionPointer<void (CaptureWidget::*)(CaptureTool::Request)>::call<QtPrivate::List<CaptureTool::Request>, void>(void (CaptureWidget::*)(CaptureTool::Request), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:185
    #8 0x56261a94ea45 in QtPrivate::QSlotObject<void (CaptureWidget::*)(CaptureTool::Request), QtPrivate::List<CaptureTool::Request>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt/QtCore/qobjectdefs_impl.h:418
    #9 0x7f6805fd0a05  (/usr/lib/libQt5Core.so.5+0x2e8a05)
    #10 0x56261a7879ef in CaptureTool::requestAction(CaptureTool::Request) /home/jeremy/github/borgman_flameshot/cmake-build-debug/src/flameshot_autogen/CB6E7VNMGS/moc_capturetool.cpp:174
    #11 0x56261a9b2ea9 in AppLauncher::pressed(CaptureContext const&) /home/jeremy/github/borgman_flameshot/src/tools/launcher/applaunchertool.cpp:72
    #12 0x56261a92f2bd in CaptureWidget::processTool(CaptureTool*) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturewidget.cpp:695
    #13 0x56261a92d7d1 in CaptureWidget::setState(CaptureButton*) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturewidget.cpp:664
    #14 0x56261a952393 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<CaptureButton*>, void, void (CaptureWidget::*)(CaptureButton*)>::call(void (CaptureWidget::*)(CaptureButton*), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:152
    #15 0x56261a9511f3 in void QtPrivate::FunctionPointer<void (CaptureWidget::*)(CaptureButton*)>::call<QtPrivate::List<CaptureButton*>, void>(void (CaptureWidget::*)(CaptureButton*), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:185
    #16 0x56261a94e59f in QtPrivate::QSlotObject<void (CaptureWidget::*)(CaptureButton*), QtPrivate::List<CaptureButton*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt/QtCore/qobjectdefs_impl.h:418
    #17 0x7f6805fd0a05  (/usr/lib/libQt5Core.so.5+0x2e8a05)
    #18 0x56261a7a39d3 in CaptureButton::pressedButton(CaptureButton*) /home/jeremy/github/borgman_flameshot/cmake-build-debug/src/flameshot_autogen/3PDZ6QXSRB/moc_capturebutton.cpp:197
    #19 0x56261a8f70a2 in CaptureButton::mousePressEvent(QMouseEvent*) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturebutton.cpp:143
    #20 0x7f6806aaac7d in QWidget::event(QEvent*) (/usr/lib/libQt5Widgets.so.5+0x19ac7d)

Indirect leak of 72 byte(s) in 9 object(s) allocated from:
    #0 0x7f68072c40c1 in operator new[](unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:102
    #1 0x7f6805fcd28c in QObject::connect(QObject const*, char const*, QObject const*, char const*, Qt::ConnectionType) (/usr/lib/libQt5Core.so.5+0x2e528c)
    #2 0x7f6806ccddf3 in QAbstractItemView::setItemDelegate(QAbstractItemDelegate*) (/usr/lib/libQt5Widgets.so.5+0x3bddf3)

Indirect leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7f68072c3f41 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x56261a9bf185 in AppLauncherWidget::configureListView(QListWidget*) /home/jeremy/github/borgman_flameshot/src/tools/launcher/applauncherwidget.cpp:241
    #2 0x56261a9b57f9 in AppLauncherWidget::AppLauncherWidget(QPixmap const&, QWidget*) /home/jeremy/github/borgman_flameshot/src/tools/launcher/applauncherwidget.cpp:87
    #3 0x56261a9b2863 in AppLauncher::widget() /home/jeremy/github/borgman_flameshot/src/tools/launcher/applaunchertool.cpp:58
    #4 0x56261a932748 in CaptureWidget::handleButtonSignal(CaptureTool::Request) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturewidget.cpp:782
    #5 0x56261a952972 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<CaptureTool::Request>, void, void (CaptureWidget::*)(CaptureTool::Request)>::call(void (CaptureWidget::*)(CaptureTool::Request), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:152
    #6 0x56261a951238 in void QtPrivate::FunctionPointer<void (CaptureWidget::*)(CaptureTool::Request)>::call<QtPrivate::List<CaptureTool::Request>, void>(void (CaptureWidget::*)(CaptureTool::Request), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:185
    #7 0x56261a94ea45 in QtPrivate::QSlotObject<void (CaptureWidget::*)(CaptureTool::Request), QtPrivate::List<CaptureTool::Request>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt/QtCore/qobjectdefs_impl.h:418
    #8 0x7f6805fd0a05  (/usr/lib/libQt5Core.so.5+0x2e8a05)
    #9 0x56261a7879ef in CaptureTool::requestAction(CaptureTool::Request) /home/jeremy/github/borgman_flameshot/cmake-build-debug/src/flameshot_autogen/CB6E7VNMGS/moc_capturetool.cpp:174
    #10 0x56261a9b2ea9 in AppLauncher::pressed(CaptureContext const&) /home/jeremy/github/borgman_flameshot/src/tools/launcher/applaunchertool.cpp:72
    #11 0x56261a92f2bd in CaptureWidget::processTool(CaptureTool*) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturewidget.cpp:695
    #12 0x56261a92d7d1 in CaptureWidget::setState(CaptureButton*) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturewidget.cpp:664
    #13 0x56261a952393 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<CaptureButton*>, void, void (CaptureWidget::*)(CaptureButton*)>::call(void (CaptureWidget::*)(CaptureButton*), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:152
    #14 0x56261a9511f3 in void QtPrivate::FunctionPointer<void (CaptureWidget::*)(CaptureButton*)>::call<QtPrivate::List<CaptureButton*>, void>(void (CaptureWidget::*)(CaptureButton*), CaptureWidget*, void**) /usr/include/qt/QtCore/qobjectdefs_impl.h:185
    #15 0x56261a94e59f in QtPrivate::QSlotObject<void (CaptureWidget::*)(CaptureButton*), QtPrivate::List<CaptureButton*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/qt/QtCore/qobjectdefs_impl.h:418
    #16 0x7f6805fd0a05  (/usr/lib/libQt5Core.so.5+0x2e8a05)
    #17 0x56261a7a39d3 in CaptureButton::pressedButton(CaptureButton*) /home/jeremy/github/borgman_flameshot/cmake-build-debug/src/flameshot_autogen/3PDZ6QXSRB/moc_capturebutton.cpp:197
    #18 0x56261a8f70a2 in CaptureButton::mousePressEvent(QMouseEvent*) /home/jeremy/github/borgman_flameshot/src/widgets/capture/capturebutton.cpp:143
    #19 0x7f6806aaac7d in QWidget::event(QEvent*) (/usr/lib/libQt5Widgets.so.5+0x19ac7d)

SUMMARY: AddressSanitizer: 5400 byte(s) leaked in 81 allocation(s).

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIt's a bugHelp WantedIssues that the main devs need some help from community. Similar to "Good first issue" but harder.Needs Investigation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions