Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leaks #2058

Merged
merged 16 commits into from May 20, 2024
Merged

Fix memory leaks #2058

merged 16 commits into from May 20, 2024

Conversation

dforsi
Copy link
Contributor

@dforsi dforsi commented Apr 7, 2024

This PR fixes some memory leaks found with AddressSanitizer (https://github.com/google/sanitizers/wiki/AddressSanitizer).

Most fixes consist only of adding a missing delete.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see QTable's don't take ownership of the delegates, hence this problem.

May be better fixed by setting the parent of the delegate to the table. I'll look in to it, as there will be other places that will need the fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I force pushed another commit that I made earlier today but I'll stop here for now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have fixed this in the Radiosonde module with parenting the delages, so you should be able to remove this bit of the patch.

I still need to fix it elsewhere, however.

@dforsi
Copy link
Contributor Author

dforsi commented Apr 29, 2024

I removed my changes the the Radiosonde plugin. Should I remove other changes?
@srcejon did you push your changes to a public repository? Maybe I can apply your changes to other plugins?

@srcejon
Copy link
Collaborator

srcejon commented Apr 29, 2024

Yes, the Radiosonde delegate changes have been committed.

I think the other changes are fine as far as I can see.

RE the loop in Airline::Init::~Init(), I think you should just be able to do qDeleteAll(m_icaoHash); - Not important, just FYI!

@dforsi
Copy link
Contributor Author

dforsi commented May 4, 2024

I added some qDeleteAll() that free the memory used by the container but not the object referenced, for example qDeleteAll(*m_airportInfo); clears the hash but it doesn't delete the single AirportInformation objects (as expected), so what should be done in this case? Since the objects are already in a container maybe it's better to iterate over the hash and delete them one by one instead of using parent that would just duplicate the references? And m_substitutions in Webserver is similar even if there are only 2 items.
On the other hand, the objects used to create the charts in the Sky Map plugin seem to be the case for parent?

One of the commits of this PR fixes a memleak in the handling of a Message in afcgui.cpp where a return true; was missing but why almost all the code in handleMessage() checks for

    while ((message = getInputMessageQueue()->pop()))
    {
        if (handleMessage(*message)) {
            delete message;
        }
    }

If the message is not handled there is a bug somewhere and I would rather issue a warning and delete the message anyway to avoid a memory leak.

the only places where the message is always deleted seem to be:

$ grep -rn 'handleMessage(' --include=*.{cpp,h} | grep -v bool | grep -v if
sdrsrv/mainserver.cpp:247:        handleMessage(*message);
sdrgui/mainwindow.cpp:2055:             handleMessage(*message);
plugins/channelrx/demoddsd/dsddemodsink.cpp:240:                        m_ambeFeature->handleMessage(*msg);
plugins/channelrx/demoddsd/dsddemodsink.cpp:260:                        m_ambeFeature->handleMessage(*msg

@srcejon
Copy link
Collaborator

srcejon commented May 7, 2024

I added some qDeleteAll() that free the memory used by the container but not the object referenced, for example qDeleteAll(*m_airportInfo); clears the hash but it doesn't delete the single AirportInformation objects (as expected), so what should be done in this case?

You shouldn't try to delete m_airportInfo - that uses a QSharedPointer so can be shared - and it should have automatic deletion: See: https://doc.qt.io/qt-6/qsharedpointer.html

@srcejon
Copy link
Collaborator

srcejon commented May 7, 2024

If the message is not handled there is a bug somewhere and I would rather issue a warning and delete the message anyway to avoid a memory leak.

Does a return value of false indicate that the message wasn't handled, or that delete shouldn't be called?

E.g. the handler could forward the message on to another queue, rather than allocate a new message. In that case, the message was handled, but you wouldn't want it deleted.

Copy link
Collaborator

@srcejon srcejon May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use < QtAlgorithms > rather than "qalgorithms.h", I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For uniformity yes, but in practice it makes no difference because the only line in <QtAlgoritms> is

#include "qalgorithms.h"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Qt, I believe the capitalised files without .h are the public headers, and the .h files are private that may be subject to change and don't necessarily have a one-to-one mapping with class names.

In this specific case they're the same, but as you seem to be doing a bit of a clean up, we may as well do it right.

@dforsi
Copy link
Contributor Author

dforsi commented May 18, 2024

If the message is not handled there is a bug somewhere and I would rather issue a warning and delete the message anyway to avoid a memory leak.

Does a return value of false indicate that the message wasn't handled, or that delete shouldn't be called?

E.g. the handler could forward the message on to another queue, rather than allocate a new message. In that case, the message was handled, but you wouldn't want it deleted.

it returns false to indicate that the message wasn't handled, but its caller that decides to delete or not is void AFCGUI::handleInputMessages() and it doesn't call other methods, so the memory is leaked.

@dforsi
Copy link
Contributor Author

dforsi commented May 19, 2024

I dropped the changes to the Map plugin because I still need to see how to free the single map items and this PR has been opened for too long.

I will look into Map and SID in separate PRs and maybe others unless someone beats me to it :).

dforsi added 16 commits May 19, 2024 19:44
Alse change the description of the existing option SANITIZE_ADDRESS to avoid ambiguity.
Found with:
ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel

Fixes:
Direct leak of 72 byte(s) in 1 object(s) allocated from:
    #0 0x7f7b94ef46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7f7b929ff74c in MainSettings::load() sdrbase/settings/mainsettings.cpp:153
    f4exb#2 0x7f7b947614f6 in MainWindow::loadSettings() sdrgui/mainwindow.cpp:1230
    f4exb#3 0x7f7b94759e11 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:211
    f4exb#4 0x55b694e0a175 in runQtApplication app/main.cpp:196
    f4exb#5 0x55b694e07ab7 in main app/main.cpp:248
    f4exb#6 0x7f7b8f4456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Indirect leak of 136 byte(s) in 1 object(s) allocated from:
    #0 0x7f7b94ef46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7f7b929e734d in QList<Preset>::node_construct(QList<Preset>::Node*, Preset const&) /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:465
    f4exb#2 0x7f7b929e734d in QList<Preset>::append(Preset const&) /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:625
    f4exb#3 0x7f7b929e734d in QList<Preset>::push_back(Preset const&) /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:377
    f4exb#4 0x7f7b929e734d in Configuration::deserialize(QByteArray const&) sdrbase/settings/configuration.cpp:112
    f4exb#5 0x7f7b929ff934 in MainSettings::load() sdrbase/settings/mainsettings.cpp:155
    f4exb#6 0x7f7b947614f6 in MainWindow::loadSettings() sdrgui/mainwindow.cpp:1230
    f4exb#7 0x7f7b94759e11 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:211
    f4exb#8 0x55b694e0a175 in runQtApplication app/main.cpp:196
    f4exb#9 0x55b694e07ab7 in main app/main.cpp:248
    f4exb#10 0x7f7b8f4456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Indirect leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f7b94ef46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7f7b929e9706 in QList<Preset::DeviceConfig>::node_construct(QList<Preset::DeviceConfig>::Node*, Preset::DeviceConfig const&) /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:465
    f4exb#2 0x7f7b929e9706 in QList<Preset::DeviceConfig>::append(Preset::DeviceConfig const&) /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:625
    f4exb#3 0x7f7b929f627c in Preset::deserialize(QByteArray const&) sdrbase/settings/preset.cpp:193
    f4exb#4 0x7f7b929e74ca in Configuration::deserialize(QByteArray const&) sdrbase/settings/configuration.cpp:113
    f4exb#5 0x7f7b929ff934 in MainSettings::load() sdrbase/settings/mainsettings.cpp:155
    f4exb#6 0x7f7b947614f6 in MainWindow::loadSettings() sdrgui/mainwindow.cpp:1230
    f4exb#7 0x7f7b94759e11 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:211
    f4exb#8 0x55b694e0a175 in runQtApplication app/main.cpp:196
    f4exb#9 0x55b694e07ab7 in main app/main.cpp:248
    f4exb#10 0x7f7b8f4456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
Fixes:
Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7eff8bcf46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7eff897b484d in DeviceUserArgs::serialize() const sdrbase/device/deviceuserargs.cpp:43
    f4exb#2 0x7eff897f4904 in MainSettings::save() const sdrbase/settings/mainsettings.cpp:237
    f4exb#3 0x7eff8b578654 in MainWindow::closeEvent(QCloseEvent*) sdrgui/mainwindow.cpp:1749
    f4exb#4 0x7eff877a5dc7 in QWidget::event(QEvent*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x1a5dc7) (BuildId: 983eca66d9695a1892aa796da4160d8d6f9b9ac4)

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7eff8bcf46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7eff897b484d in DeviceUserArgs::serialize() const sdrbase/device/deviceuserargs.cpp:43
    f4exb#2 0x7eff897f4904 in MainSettings::save() const sdrbase/settings/mainsettings.cpp:237
    f4exb#3 0x7eff8b552c9a in MainWindow::~MainWindow() sdrgui/mainwindow.cpp:326
    f4exb#4 0x564e8b36e1e5 in runQtApplication app/main.cpp:212
    f4exb#5 0x564e8b36bab7 in main app/main.cpp:248
    f4exb#6 0x7eff862456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
Found with:
ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel

Fixes:
Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7ff2588f46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7ff256723dd0 in MainCore::appendFeatureSet() sdrbase/maincore.cpp:190
    f4exb#2 0x7ff25817fb89 in MainWindow::addFeatureSet() sdrgui/mainwindow.cpp:1191
    f4exb#3 0x7ff25815a4d0 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:250
    f4exb#4 0x559632289175 in runQtApplication app/main.cpp:196
    f4exb#5 0x559632286ab7 in main app/main.cpp:248
    f4exb#6 0x7ff252e456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
Found with:
ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel

Fixes:
Direct leak of 56 byte(s) in 1 object(s) allocated from:
    #0 0x7f9d7d0f46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7f9d7af247aa in MainCore::appendDeviceSet(int) sdrbase/maincore.cpp:219
    f4exb#2 0x7f9d7c95c8a5 in MainWindow::sampleSourceAdd(Workspace*, Workspace*, int) sdrgui/mainwindow.cpp:359
    f4exb#3 0x7f9d7c97ce3c in MainWindow::loadConfiguration(Configuration const*, bool) sdrgui/mainwindow.cpp:1439
    f4exb#4 0x7f9d7c95a610 in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrgui/mainwindow.cpp:261
    f4exb#5 0x562f7c492175 in runQtApplication app/main.cpp:196
    f4exb#6 0x562f7c48fab7 in main app/main.cpp:248
    f4exb#7 0x7f9d776456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

and 34 others that I'm not copying here.
Found with:
ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel

Fixes:
Indirect leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7faba78f46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7faba73281e1 in GLShaderSpectrogram::initializeGL(int, int) sdrgui/gui/glshaderspectrogram.cpp:118
    f4exb#2 0x7faba7369b54 in GLSpectrumView::initializeGL() sdrgui/gui/glspectrumview.cpp:937
    f4exb#3 0x7faba33c4f45 in QOpenGLWidget::resizeEvent(QResizeEvent*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x1c4f45) (BuildId: 983eca66d9695a1892aa796da4160d8d6f9b9ac4)
Found with:
ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel

Fixes:
Direct leak of 176096 byte(s) in 5503 object(s) allocated from:
    #0 0x7f3a464f46c8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7f3a44009219 in Airline::Init::Init() sdrbase/util/airlines.cpp:5559
    f4exb#2 0x7f3a43dc797d in _sub_I_65535_0.0 (build/lib/libsdrbase.so+0x3c797d) (BuildId: fb568b705538a6e506ee23027626f4366b25aa50)
    f4exb#3 0x7f3a46c6ce3d in call_init elf/dl-init.c:74
    f4exb#4 0x7f3a46c6ce3d in call_init elf/dl-init.c:26
Fixes:
Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7efeb72f46b8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7efe834b65a2 in WebServer::WebServer(unsigned short&, QObject*) sdrangel/plugins/feature/map/webserver.cpp:34
    f4exb#2 0x7efe834bc342 in MapGUI::MapGUI(PluginAPI*, FeatureUISet*, Feature*, QWidget*) sdrangel/plugins/feature/map/mapgui.cpp:265
    f4exb#3 0x7efe835372f4 in MapGUI::create(PluginAPI*, FeatureUISet*, Feature*) sdrangel/plugins/feature/map/mapgui.cpp:66
    f4exb#4 0x7efe834b5471 in MapPlugin::createFeatureGUI(FeatureUISet*, Feature*) const sdrangel/plugins/feature/map/mapplugin.cpp:72
    f4exb#5 0x7efeb6b416c2 in FeatureUISet::loadFeatureSetSettings(FeatureSetPreset const*, PluginAPI*, WebAPIAdapterInterface*, QList<Workspace*>*, Workspace*) sdrangel/sdrgui/feature/featureuiset.cpp:185
    f4exb#6 0x7efeb67e9b41 in MainWindow::loadConfiguration(Configuration const*, bool) sdrangel/sdrgui/mainwindow.cpp:1503
    f4exb#7 0x7efeb6730e3e in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrangel/sdrgui/mainwindow.cpp:257
    f4exb#8 0x557281218bad in runQtApplication sdrangel/app/main.cpp:196
    f4exb#9 0x5572812194a3 in main sdrangel/app/main.cpp:248
    f4exb#10 0x7efeb10456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

and others
Found with:
ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel

Fixes:
Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7efeb72f46b8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7efe83515718 in WebServer::addSubstitution(QString, QString, QString) sdrangel/plugins/feature/map/webserver.cpp:84
    f4exb#2 0x7efe83559c9e in MapGUI::applyMap3DSettings(bool) sdrangel/plugins/feature/map/mapgui.cpp:1789
    f4exb#3 0x7efe8355e483 in MapGUI::displaySettings() sdrangel/plugins/feature/map/mapgui.cpp:1964
    f4exb#4 0x7efe834be0f6 in MapGUI::MapGUI(PluginAPI*, FeatureUISet*, Feature*, QWidget*) sdrangel/plugins/feature/map/mapgui.cpp:376
    f4exb#5 0x7efe835372f4 in MapGUI::create(PluginAPI*, FeatureUISet*, Feature*) sdrangel/plugins/feature/map/mapgui.cpp:66
    f4exb#6 0x7efe834b5471 in MapPlugin::createFeatureGUI(FeatureUISet*, Feature*) const sdrangel/plugins/feature/map/mapplugin.cpp:72
    f4exb#7 0x7efeb6b416c2 in FeatureUISet::loadFeatureSetSettings(FeatureSetPreset const*, PluginAPI*, WebAPIAdapterInterface*, QList<Workspace*>*, Workspace*) sdrangel/sdrgui/feature/featureuiset.cpp:185
    f4exb#8 0x7efeb67e9b41 in MainWindow::loadConfiguration(Configuration const*, bool) sdrangel/sdrgui/mainwindow.cpp:1503
    f4exb#9 0x7efeb6730e3e in MainWindow::MainWindow(qtwebapp::LoggerWithFile*, MainParser const&, QWidget*) sdrangel/sdrgui/mainwindow.cpp:257
    f4exb#10 0x557281218bad in runQtApplication sdrangel/app/main.cpp:196
    f4exb#11 0x5572812194a3 in main sdrangel/app/main.cpp:248
    f4exb#12 0x7efeb10456c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
Found with:
ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel

Fixes:
Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f2360af46b8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7f2321a07706 in AFC::MsgDeviceSetListsReport::create() sdrangel/plugins/feature/afc/afc.h:151
    f4exb#2 0x7f2321a0ac1f in AFC::updateDeviceSetLists() sdrangel/plugins/feature/afc/afc.cpp:290
    f4exb#3 0x7f2321a09648 in AFC::handleMessage(Message const&) sdrangel/plugins/feature/afc/afc.cpp:214
    f4exb#4 0x7f235dfba569 in Feature::handleInputMessages() sdrangel/sdrbase/feature/feature.cpp:46
    f4exb#5 0x7f235ddea09e in Feature::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) build-sdrangel-Desktop_qt5-Debug/sdrbase/sdrbase_autogen/3DM3QXXG3A/moc_feature.cpp:89
    f4exb#6 0x7f235b305fcc  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x305fcc) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)
    f4exb#7 0x7f235ddf5d8c in MessageQueue::messageEnqueued() build-sdrangel-Desktop_qt5-Debug/sdrbase/sdrbase_autogen/KH43KSYMFX/moc_messagequeue.cpp:131
    f4exb#8 0x7f235e0e1487 in MessageQueue::push(Message*, bool) sdrangel/sdrbase/util/messagequeue.cpp:55
    f4exb#9 0x7f2321a32fad in AFCGUI::requestDeviceSetLists() sdrangel/plugins/feature/afc/afcgui.cpp:213
    f4exb#10 0x7f2321a32124 in AFCGUI::AFCGUI(PluginAPI*, FeatureUISet*, Feature*, QWidget*) sdrangel/plugins/feature/afc/afcgui.cpp:170
    f4exb#11 0x7f2321a308cc in AFCGUI::create(PluginAPI*, FeatureUISet*, Feature*) sdrangel/plugins/feature/afc/afcgui.cpp:32
    f4exb#12 0x7f2321a1c229 in AFCPlugin::createFeatureGUI(FeatureUISet*, Feature*) const sdrangel/plugins/feature/afc/afcplugin.cpp:70
    f4exb#13 0x7f235fffc534 in MainWindow::featureAddClicked(Workspace*, int) sdrangel/sdrgui/mainwindow.cpp:2890
    f4exb#14 0x7f23600172c1 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>, QtPrivate::List<Workspace*, int>, void, void (MainWindow::*)(Workspace*, int)>::call(void (MainWindow::*)(Workspace*, int), MainWindow*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152
    f4exb#15 0x7f2360012b8d in void QtPrivate::FunctionPointer<void (MainWindow::*)(Workspace*, int)>::call<QtPrivate::List<Workspace*, int>, void>(void (MainWindow::*)(Workspace*, int), MainWindow*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185
    f4exb#16 0x7f2360010016 in QtPrivate::QSlotObject<void (MainWindow::*)(Workspace*, int), QtPrivate::List<Workspace*, int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418
    f4exb#17 0x7f235b3062b1  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3062b1) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)
    f4exb#18 0x7f235ffcc7fc in Workspace::addFeature(Workspace*, int) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_workspace.cpp:393
    f4exb#19 0x7f23602f56f8 in Workspace::addFeatureEmitted(int) sdrangel/sdrgui/gui/workspace.cpp:413
    f4exb#20 0x7f236030d611 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>, void, void (Workspace::*)(int)>::call(void (Workspace::*)(int), Workspace*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152
    f4exb#21 0x7f2360308bd9 in void QtPrivate::FunctionPointer<void (Workspace::*)(int)>::call<QtPrivate::List<int>, void>(void (Workspace::*)(int), Workspace*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185
    f4exb#22 0x7f2360305cdc in QtPrivate::QSlotObject<void (Workspace::*)(int), QtPrivate::List<int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418
    f4exb#23 0x7f235b3062b1  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3062b1) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)
    f4exb#24 0x7f235ffba7cf in FeatureAddDialog::addFeature(int) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_featureadddialog.cpp:141
    f4exb#25 0x7f23600c2d19 in FeatureAddDialog::apply(QAbstractButton*) sdrangel/sdrgui/gui/featureadddialog.cpp:53
    f4exb#26 0x7f235ffba366 in FeatureAddDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_featureadddialog.cpp:82
    f4exb#27 0x7f235b305fcc  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x305fcc) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)
    f4exb#28 0x7f235c1029b2 in QDialogButtonBox::clicked(QAbstractButton*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x3029b2) (BuildId: dfefd27f084c0dd066215fc79825fceae604f481)
Found with:
ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel

Fixes:
Direct leak of 448 byte(s) in 2 object(s) allocated from:
    #0 0x7f78cd8f46b8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7f788e0e9d9c in GS232ControllerWorker::MsgConfigureGS232ControllerWorker::create(GS232ControllerSettings const&, QList<QString> const&, bool) sdrangel/plugins/feature/gs232controller/gs232controllerworker.h:51
    f4exb#2 0x7f788e0eeedf in GS232Controller::applySettings(GS232ControllerSettings const&, QList<QString> const&, bool) sdrangel/plugins/feature/gs232controller/gs232controller.cpp:291
    f4exb#3 0x7f788e0ec595 in GS232Controller::handleMessage(Message const&) sdrangel/plugins/feature/gs232controller/gs232controller.cpp:156
    f4exb#4 0x7f78cabe899f in Feature::handleInputMessages() sdrangel/sdrbase/feature/feature.cpp:46
    f4exb#5 0x7f78ca9f9b5c in Feature::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) build-sdrangel-Desktop_qt5-Debug/sdrbase/sdrbase_autogen/3DM3QXXG3A/moc_feature.cpp:89
    f4exb#6 0x7f78c7f05fcc  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x305fcc) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)
    f4exb#7 0x7f78caa0584a in MessageQueue::messageEnqueued() build-sdrangel-Desktop_qt5-Debug/sdrbase/sdrbase_autogen/KH43KSYMFX/moc_messagequeue.cpp:131
    f4exb#8 0x7f78cad19c77 in MessageQueue::push(Message*, bool) sdrangel/sdrbase/util/messagequeue.cpp:55
    f4exb#9 0x7f788e142936 in GS232ControllerGUI::applySettings(QStringList const&, bool) sdrangel/plugins/feature/gs232controller/gs232controllergui.cpp:969
    f4exb#10 0x7f788e142727 in GS232ControllerGUI::applySetting(QString const&) sdrangel/plugins/feature/gs232controller/gs232controllergui.cpp:960
    f4exb#11 0x7f788e133c26 in GS232ControllerGUI::onWidgetRolled(QWidget*, bool) sdrangel/plugins/feature/gs232controller/gs232controllergui.cpp:206
    f4exb#12 0x7f788e0e25d9 in GS232ControllerGUI::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) build-sdrangel-Desktop_qt5-Debug/plugins/feature/gs232controller/featuregs232controller_autogen/EWIEGA46WW/moc_gs232controllergui.cpp:234
    f4exb#13 0x7f78c7f05fcc  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x305fcc) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)
    f4exb#14 0x7f78ccdcd9a1 in RollupContents::widgetRolled(QWidget*, bool) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_rollupcontents.cpp:146
    f4exb#15 0x7f78cd06a080 in RollupContents::eventFilter(QObject*, QEvent*) sdrangel/sdrgui/gui/rollupcontents.cpp:403
    f4exb#16 0x7f78c7ecc4b2 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x2cc4b2) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)

and more
Found with:
ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel

Fixes:
Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7f3c3e0f46b8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7f3bfdef913c in WebServer::WebServer(unsigned short&, QObject*) sdrangel/plugins/feature/skymap/webserver.cpp:34
    f4exb#2 0x7f3bfdf10b56 in SkyMapGUI::SkyMapGUI(PluginAPI*, FeatureUISet*, Feature*, QWidget*) sdrangel/plugins/feature/skymap/skymapgui.cpp:220
    f4exb#3 0x7f3bfdf0eb20 in SkyMapGUI::create(PluginAPI*, FeatureUISet*, Feature*) sdrangel/plugins/feature/skymap/skymapgui.cpp:44
    f4exb#4 0x7f3bfdef75e9 in SkyMapPlugin::createFeatureGUI(FeatureUISet*, Feature*) const sdrangel/plugins/feature/skymap/skymapplugin.cpp:72
    f4exb#5 0x7f3c3d60938b in MainWindow::featureAddClicked(Workspace*, int) sdrangel/sdrgui/mainwindow.cpp:2888
    f4exb#6 0x7f3c3d624621 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>, QtPrivate::List<Workspace*, int>, void, void (MainWindow::*)(Workspace*, int)>::call(void (MainWindow::*)(Workspace*, int), MainWindow*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152
    f4exb#7 0x7f3c3d61feed in void QtPrivate::FunctionPointer<void (MainWindow::*)(Workspace*, int)>::call<QtPrivate::List<Workspace*, int>, void>(void (MainWindow::*)(Workspace*, int), MainWindow*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185
    f4exb#8 0x7f3c3d61d376 in QtPrivate::QSlotObject<void (MainWindow::*)(Workspace*, int), QtPrivate::List<Workspace*, int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418
    f4exb#9 0x7f3c387062b1  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3062b1) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)
    f4exb#10 0x7f3c3d5d5ca4 in Workspace::addFeature(Workspace*, int) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_workspace.cpp:393
    f4exb#11 0x7f3c3d90c6a2 in Workspace::addFeatureEmitted(int) sdrangel/sdrgui/gui/workspace.cpp:413
    f4exb#12 0x7f3c3d9245bb in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>, void, void (Workspace::*)(int)>::call(void (Workspace::*)(int), Workspace*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152
    f4exb#13 0x7f3c3d91fb83 in void QtPrivate::FunctionPointer<void (Workspace::*)(int)>::call<QtPrivate::List<int>, void>(void (Workspace::*)(int), Workspace*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185
    f4exb#14 0x7f3c3d91cc86 in QtPrivate::QSlotObject<void (Workspace::*)(int), QtPrivate::List<int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418
    f4exb#15 0x7f3c387062b1  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3062b1) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)
    f4exb#16 0x7f3c3d5c3c77 in FeatureAddDialog::addFeature(int) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_featureadddialog.cpp:141
    f4exb#17 0x7f3c3d6d0d79 in FeatureAddDialog::apply(QAbstractButton*) sdrangel/sdrgui/gui/featureadddialog.cpp:53
    f4exb#18 0x7f3c3d5c380e in FeatureAddDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_featureadddialog.cpp:82
    f4exb#19 0x7f3c38705fcc  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x305fcc) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)
    f4exb#20 0x7f3c395029b2 in QDialogButtonBox::clicked(QAbstractButton*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x3029b2) (BuildId: dfefd27f084c0dd066215fc79825fceae604f481)

and more
Found with:
ASAN_OPTIONS="detect_odr_violation=1,strip_path_prefix=$(pwd)/" build/sdrangel

Fixes:
Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7fabe9cf46b8 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
    f4exb#1 0x7faba9afa508 in WebServer::addSubstitution(QString, QString, QString) sdrangel/plugins/feature/skymap/webserver.cpp:83
    f4exb#2 0x7faba9b11591 in SkyMapGUI::SkyMapGUI(PluginAPI*, FeatureUISet*, Feature*, QWidget*) sdrangel/plugins/feature/skymap/skymapgui.cpp:224
    f4exb#3 0x7faba9b0f0a0 in SkyMapGUI::create(PluginAPI*, FeatureUISet*, Feature*) sdrangel/plugins/feature/skymap/skymapgui.cpp:44
    f4exb#4 0x7faba9af70e9 in SkyMapPlugin::createFeatureGUI(FeatureUISet*, Feature*) const sdrangel/plugins/feature/skymap/skymapplugin.cpp:72
    f4exb#5 0x7fabe920938b in MainWindow::featureAddClicked(Workspace*, int) sdrangel/sdrgui/mainwindow.cpp:2888
    f4exb#6 0x7fabe9224621 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>, QtPrivate::List<Workspace*, int>, void, void (MainWindow::*)(Workspace*, int)>::call(void (MainWindow::*)(Workspace*, int), MainWindow*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152
    f4exb#7 0x7fabe921feed in void QtPrivate::FunctionPointer<void (MainWindow::*)(Workspace*, int)>::call<QtPrivate::List<Workspace*, int>, void>(void (MainWindow::*)(Workspace*, int), MainWindow*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185
    f4exb#8 0x7fabe921d376 in QtPrivate::QSlotObject<void (MainWindow::*)(Workspace*, int), QtPrivate::List<Workspace*, int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418
    f4exb#9 0x7fabe43062b1  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3062b1) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)
    f4exb#10 0x7fabe91d5ca4 in Workspace::addFeature(Workspace*, int) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_workspace.cpp:393
    f4exb#11 0x7fabe950c6a2 in Workspace::addFeatureEmitted(int) sdrangel/sdrgui/gui/workspace.cpp:413
    f4exb#12 0x7fabe95245bb in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>, void, void (Workspace::*)(int)>::call(void (Workspace::*)(int), Workspace*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:152
    f4exb#13 0x7fabe951fb83 in void QtPrivate::FunctionPointer<void (Workspace::*)(int)>::call<QtPrivate::List<int>, void>(void (Workspace::*)(int), Workspace*, void**) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:185
    f4exb#14 0x7fabe951cc86 in QtPrivate::QSlotObject<void (Workspace::*)(int), QtPrivate::List<int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:418
    f4exb#15 0x7fabe43062b1  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x3062b1) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)
    f4exb#16 0x7fabe91c3c77 in FeatureAddDialog::addFeature(int) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_featureadddialog.cpp:141
    f4exb#17 0x7fabe92d0d79 in FeatureAddDialog::apply(QAbstractButton*) sdrangel/sdrgui/gui/featureadddialog.cpp:53
    f4exb#18 0x7fabe91c380e in FeatureAddDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) build-sdrangel-Desktop_qt5-Debug/sdrgui/sdrgui_autogen/DMHXEJ42XS/moc_featureadddialog.cpp:82
    f4exb#19 0x7fabe4305fcc  (/lib/x86_64-linux-gnu/libQt5Core.so.5+0x305fcc) (BuildId: ed2abb344a128279a866aa6c4a79f3fa5c87c59e)
    f4exb#20 0x7fabe51029b2 in QDialogButtonBox::clicked(QAbstractButton*) (/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x3029b2) (BuildId: dfefd27f084c0dd066215fc79825fceae604f481)

and more
@dforsi dforsi marked this pull request as ready for review May 19, 2024 17:45
@srcejon
Copy link
Collaborator

srcejon commented May 19, 2024

Looks OK, thanks.

@f4exb f4exb merged commit dd864f1 into f4exb:master May 20, 2024
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants