Skip to content

Commit

Permalink
Fix memleaks found with AddressSanitizer/LeakSanitizer
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dforsi committed May 19, 2024
1 parent 3c0541d commit b79b774
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/feature/skymap/webserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ WebServer::WebServer(quint16 &port, QObject* parent) :
m_mimeTypes.insert(".geojson", new MimeType("application/geo+json"));
}

WebServer::~WebServer()
{
qDeleteAll(m_mimeTypes);
}

void WebServer::incomingConnection(qintptr socket)
{
QTcpSocket* s = new QTcpSocket(this);
Expand Down
1 change: 1 addition & 0 deletions plugins/feature/skymap/webserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class WebServer : public QTcpServer

public:
WebServer(quint16 &port, QObject* parent = 0);
~WebServer();
void incomingConnection(qintptr socket) override;
void addPathSubstitution(const QString &from, const QString &to);
void addSubstitution(QString path, QString from, QString to);
Expand Down

0 comments on commit b79b774

Please sign in to comment.