Bug 439192 - System settings crashes in Bolt::Manager::~Manager() after navigating away from thunderbolt page
Summary: System settings crashes in Bolt::Manager::~Manager() after navigating away fr...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_thunderbolt (show other bugs)
Version: 5.22.2
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Daniel Vrátil
URL:
Keywords:
: 427516 459779 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-06-26 17:59 UTC by Ima S
Modified: 2022-09-28 15:55 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24.7
Sentry Crash Report:


Attachments
gdb backtrace (12.22 KB, text/plain)
2022-01-22 13:52 UTC, Sebastian
Details
valgrind output (116.08 KB, text/plain)
2022-01-22 13:53 UTC, Sebastian
Details
GDB backtrace of crash (12.44 KB, text/plain)
2022-06-27 09:24 UTC, Jonathan Wakely
Details
valgrind log of 'kcmshell5 bolt' (94.41 KB, text/plain)
2022-06-27 09:49 UTC, Jonathan Wakely
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ima S 2021-06-26 17:59:06 UTC
SUMMARY
Title, 100% reproducibility

STEPS TO REPRODUCE
1. Open system settings
2. Navigate to the thunderbolt page
3. Click on any other page

OBSERVED RESULT
The settings window closes/crashes

EXPECTED RESULT
It navigates to the page and doesn't close

SOFTWARE/OS VERSIONS
Arch Linux: as of 2021-6-26
KDE Plasma Version: 5.22.2
KDE Frameworks Version: 5.83.0
Qt Version: 5.12.2
using X11

ADDITIONAL INFORMATION
Tried immediately after a restart, still happened.
Also happens even when disconnected from thunderbolt device.
Comment 1 David Edmundson 2021-06-26 22:11:47 UTC
Crashes need a backtrace to be actionable
Comment 2 Ima S 2021-06-28 17:17:20 UTC
I haven't made backtraces before, this was hard. I wasn't able to get debug symbols for qt5-base, but I did recompile kcmutils, plasma-thunderbolt and systemsettings.

Here's the output and backtrace:


Starting program: /usr/bin/systemsettings5 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff1094640 (LWP 407254)]
[New Thread 0x7fffebfff640 (LWP 407255)]
[New Thread 0x7fffe8f40640 (LWP 407256)]
[New Thread 0x7fffd7fff640 (LWP 407257)]
[New Thread 0x7fffddd65640 (LWP 407258)]
[New Thread 0x7fffdd564640 (LWP 407259)]
[New Thread 0x7fffdcd63640 (LWP 407260)]
[Thread 0x7fffdcd63640 (LWP 407260) exited]
[New Thread 0x7fffdcd63640 (LWP 407261)]
[New Thread 0x7fffd77fe640 (LWP 407262)]
[New Thread 0x7fffd6ffd640 (LWP 407263)]
[New Thread 0x7fffd67fc640 (LWP 407264)]
[New Thread 0x7fffd5ffb640 (LWP 407265)]
[New Thread 0x7fffb7fff640 (LWP 407266)]QQmlEngine::setContextForObject(): Object already has a QQmlContext
[Detaching after fork from child process 407268]
[Detaching after fork from child process 407269]
[New Thread 0x7fffb6d48640 (LWP 407270)]
QQmlEngine::setContextForObject(): Object already has a QQmlContext
QQmlEngine::setContextForObject(): Object already has a QQmlContext
[New Thread 0x7fffb59fa640 (LWP 407275)]
[New Thread 0x7fffb51d2640 (LWP 407276)]
[New Thread 0x7fffa39d9640 (LWP 407285)]
[New Thread 0x7fffa1f12640 (LWP 407289)]
[Thread 0x7fffb6d48640 (LWP 407270) exited]
[Thread 0x7fffb51d2640 (LWP 407276) exited]
[New Thread 0x7fffb51d2640 (LWP 407317)]
QQmlEngine::setContextForObject(): Object already has a QQmlContext
QQmlEngine::setContextForObject(): Object already has a QQmlContext
Previously registered enum will be overwritten due to name clash: Bolt.Secure
Possible conflicting items:
    Bolt.Auth.Secure from scope Bolt injected by Bolt
    Bolt.Security.Secure from scope Bolt injected by Bolt
kf.kirigami: The Theme singleton is deprecated (since 5.39). Import Kirigami 2.2 or higher and use the attached property instead.
[New Thread 0x7fffb6d48640 (LWP 407319)]
double free or corruption (out)

Thread 1 "systemsettings5" received signal SIGABRT, Aborted.
0x00007ffff627bd22 in raise () from /usr/lib/libc.so.6
#0  0x00007ffff627bd22 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff6265862 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff62bdd28 in __libc_message () from /usr/lib/libc.so.6
#3  0x00007ffff62c592a in malloc_printerr () from /usr/lib/libc.so.6
#4  0x00007ffff62c71b0 in _int_free () from /usr/lib/libc.so.6
#5  0x00007ffff62ca9e8 in free () from /usr/lib/libc.so.6
#6  0x00007ffff690492e in QObjectPrivate::deleteChildren (this=0x555555f7e170) at kernel/qobject.cpp:2104
#7  0x00007ffff690f6c5 in QObject::~QObject (this=this@entry=0x555556a7f0b0, __in_chrg=<optimized out>) at kernel/qobject.cpp:1082
#8  0x00007fffb650a9b4 in Bolt::Manager::~Manager (this=this@entry=0x555556a7f0b0, __in_chrg=<optimized out>) at /usr/src/debug/plasma-thunderbolt-5.22.2.1/src/lib/manager.cpp:59
#9  0x00007fffb6540d11 in QQmlPrivate::QQmlElement<Bolt::Manager>::~QQmlElement (this=0x555556a7f0b0, __in_chrg=<optimized out>) at /usr/include/qt/QtQml/qqmlprivate.h:144
#10 QQmlPrivate::QQmlElement<Bolt::Manager>::~QQmlElement (this=0x555556a7f0b0, __in_chrg=<optimized out>) at /usr/include/qt/QtQml/qqmlprivate.h:144
#11 0x00007ffff690492e in QObjectPrivate::deleteChildren (this=0x555555e96f40) at kernel/qobject.cpp:2104
#12 0x00007ffff690f6c5 in QObject::~QObject (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1082
#13 0x00007ffff5d00357 in ?? () from /usr/lib/libQt5Quick.so.5
#14 0x00007ffff690492e in QObjectPrivate::deleteChildren (this=0x55555600acb0) at kernel/qobject.cpp:2104
#15 0x00007ffff690f6c5 in QObject::~QObject (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1082
#16 0x00007fffd4e2efe7 in ?? () from /usr/lib/qt/qml/QtQuick/Templates.2/libqtquicktemplates2plugin.so
#17 0x00007ffff5ebdb9d in KDeclarative::QmlObject::~QmlObject() () from /usr/lib/libKF5Declarative.so.5
#18 0x00007ffff5ebe72a in KDeclarative::QmlObjectSharedEngine::~QmlObjectSharedEngine() () from /usr/lib/libKF5Declarative.so.5
#19 0x00007ffff7e4fb2f in KQuickAddons::ConfigModule::~ConfigModule() () from /usr/lib/libKF5QuickAddons.so.5
#20 0x00007fffb653d888 in KCMBolt::~KCMBolt (this=0x555555cc5910, __in_chrg=<optimized out>)
    at /usr/src/debug/build/src/kcm/kcm_bolt_autogen/EWIEGA46WW/../../../../../plasma-thunderbolt-5.22.2.1/src/kcm/kcm_bolt.h:18
#21 KCMBolt::~KCMBolt (this=0x555555cc5910, __in_chrg=<optimized out>)
    at /usr/src/debug/build/src/kcm/kcm_bolt_autogen/EWIEGA46WW/../../../../../plasma-thunderbolt-5.22.2.1/src/kcm/kcm_bolt.h:18
#22 0x00007ffff7f57b77 in std::default_delete<KQuickAddons::ConfigModule>::operator() (__ptr=<optimized out>, this=<optimized out>) at /usr/include/c++/11.1.0/bits/unique_ptr.h:85
#23 std::unique_ptr<KQuickAddons::ConfigModule, std::default_delete<KQuickAddons::ConfigModule> >::~unique_ptr (this=<optimized out>, __in_chrg=<optimized out>)
    at /usr/include/c++/11.1.0/bits/unique_ptr.h:361
#24 KCModuleQmlPrivate::~KCModuleQmlPrivate (this=<optimized out>, __in_chrg=<optimized out>) at /usr/src/debug/kcmutils-5.83.0/src/kcmoduleqml.cpp:34
#25 KCModuleQml::~KCModuleQml (this=0x555555a9c7e0, __in_chrg=<optimized out>) at /usr/src/debug/kcmutils-5.83.0/src/kcmoduleqml.cpp:226
#26 0x00007ffff7f57b9d in KCModuleQml::~KCModuleQml (this=0x555555a9c7e0, __in_chrg=<optimized out>) at /usr/src/debug/kcmutils-5.83.0/src/kcmoduleqml.cpp:227
#27 0x00007ffff7f5eeb8 in KCModuleProxy::deleteClient (this=this@entry=0x555556487ad0) at /usr/src/debug/kcmutils-5.83.0/src/kcmoduleproxy.cpp:179
#28 0x00007ffff7f5efe0 in KCModuleProxy::~KCModuleProxy (this=0x555556487ad0, __in_chrg=<optimized out>) at /usr/src/debug/kcmutils-5.83.0/src/kcmoduleproxy.cpp:170
#29 0x00007ffff7f5f18e in KCModuleProxy::~KCModuleProxy (this=0x555556487ad0, __in_chrg=<optimized out>) at /usr/src/debug/kcmutils-5.83.0/src/kcmoduleproxy.cpp:174
#30 0x00007ffff690492e in QObjectPrivate::deleteChildren (this=this@entry=0x5555560efef0) at kernel/qobject.cpp:2104
#31 0x00007ffff74ff5ce in QWidget::~QWidget (this=0x5555562efc90, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1522
#32 0x00007ffff74ff94a in QWidget::~QWidget (this=0x5555562efc90, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1546
#33 0x00007ffff690492e in QObjectPrivate::deleteChildren (this=this@entry=0x7fffa4098a90) at kernel/qobject.cpp:2104
#34 0x00007ffff74ff5ce in QWidget::~QWidget (this=0x5555569e6990, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1522
#35 0x00007ffff7667e0a in QScrollArea::~QScrollArea (this=0x5555569e6990, __in_chrg=<optimized out>) at widgets/qscrollarea.cpp:173
#36 0x00007ffff7c7be97 in KPageWidgetItem::~KPageWidgetItem() () from /usr/lib/libKF5WidgetsAddons.so.5
#37 0x00007ffff7c7c9c6 in ?? () from /usr/lib/libKF5WidgetsAddons.so.5
#38 0x00007ffff7c7d222 in KPageWidgetModel::removePage(KPageWidgetItem*) () from /usr/lib/libKF5WidgetsAddons.so.5
#39 0x00007ffff7f9e56e in ModuleView::closeModules (this=0x555555be9d30) at /usr/src/debug/systemsettings-5.22.2.1/core/ModuleView.cpp:363
#40 0x00007fffe80eb182 in SidebarMode::loadModule (this=0x555555a0d270, activeModule=..., args=...) at /usr/src/debug/systemsettings-5.22.2.1/sidebar/SidebarMode.cpp:488
#41 0x00007fffe80ebbdd in SidebarMode::loadModule (this=<optimized out>, activeModule=..., args=...) at /usr/include/qt/QtCore/qabstractitemmodel.h:76
#42 0x00007fffe80e78a2 in SidebarMode::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=0x7fffffffb3e0) at /usr/src/debug/build/sidebar/systemsettings_sidebar_mode_autogen/EWIEGA46WW/moc_SidebarMode.cpp:525
#43 0x00007fffe80e7f33 in SidebarMode::qt_metacall (this=0x555555a0d270, _c=QMetaObject::InvokeMetaMethod, _id=20, _a=0x7fffffffb3e0) at /usr/src/debug/build/sidebar/systemsettings_sidebar_mode_autogen/EWIEGA46WW/moc_SidebarMode.cpp:661
#44 0x00007ffff576cc9e in ?? () from /usr/lib/libQt5Qml.so.5
#45 0x00007ffff5648121 in ?? () from /usr/lib/libQt5Qml.so.5
#46 0x00007ffff5649f6b in QV4::QObjectMethod::callInternal(QV4::Value const*, QV4::Value const*, int) const () from /usr/lib/libQt5Qml.so.5
#47 0x00007ffff56670c0 in ?? () from /usr/lib/libQt5Qml.so.5
#48 0x00007ffff5669dbf in ?? () from /usr/lib/libQt5Qml.so.5
#49 0x00007ffff55fc0df in QV4::Function::call(QV4::Value const*, QV4::Value const*, int, QV4::ExecutionContext const*) () from /usr/lib/libQt5Qml.so.5
#50 0x00007ffff5787f36 in QQmlJavaScriptExpression::evaluate(QV4::CallData*, bool*) () from /usr/lib/libQt5Qml.so.5
#51 0x00007ffff573853d in QQmlBoundSignalExpression::evaluate(void**) () from /usr/lib/libQt5Qml.so.5
#52 0x00007ffff5739799 in ?? () from /usr/lib/libQt5Qml.so.5
#53 0x00007ffff576c755 in QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) () from /usr/lib/libQt5Qml.so.5
#54 0x00007ffff6911068 in doActivate<false> (sender=0x5555568ed210, signal_index=64, argv=0x0) at kernel/qobject.cpp:3778
#55 0x00007ffff03f9732 in QQuickAbstractButtonPrivate::handleRelease(QPointF const&) () from /usr/lib/libQt5QuickTemplates2.so.5
#56 0x00007ffff0417011 in QQuickControl::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQt5QuickTemplates2.so.5
#57 0x00007ffff5b7c3b8 in QQuickItem::event(QEvent*) () from /usr/lib/libQt5Quick.so.5
#58 0x00007ffff74c0d62 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5555568ed210, e=0x7fffffffd900) at kernel/qapplication.cpp:3632
#59 0x00007ffff68da15a in QCoreApplication::notifyInternal2 (receiver=0x5555568ed210, event=0x7fffffffd900) at kernel/qcoreapplication.cpp:1064
#60 0x00007ffff5b9aa89 in QQuickWindowPrivate::deliverMouseEvent(QQuickPointerMouseEvent*) () from /usr/lib/libQt5Quick.so.5
#61 0x00007ffff5b9c2fc in QQuickWindowPrivate::deliverPointerEvent(QQuickPointerEvent*) () from /usr/lib/libQt5Quick.so.5
#62 0x00007ffff6dd1635 in QWindow::event (this=0x555555bec190, ev=<optimized out>) at kernel/qwindow.cpp:2438
#63 0x00007ffff74c0d62 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x555555bec190, e=0x7fffffffd900) at kernel/qapplication.cpp:3632
#64 0x00007ffff68da15a in QCoreApplication::notifyInternal2 (receiver=0x555555bec190, event=0x7fffffffd900) at kernel/qcoreapplication.cpp:1064
#65 0x00007ffff5ed568a in QQuickWidget::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQt5QuickWidgets.so.5
#66 0x00007ffff75040be in QWidget::event (this=0x555555c02c90, event=0x7fffffffde60) at kernel/qwidget.cpp:9020
#67 0x00007ffff74c0d62 in QApplicationPrivate::notify_helper (this=this@entry=0x5555555b8140, receiver=receiver@entry=0x555555c02c90, e=e@entry=0x7fffffffde60) at kernel/qapplication.cpp:3632
#68 0x00007ffff74c8ac9 in QApplication::notify (this=0x7fffffffdb80, receiver=0x555555c02c90, e=0x7fffffffde60) at kernel/qapplication.cpp:3076
#69 0x00007ffff68da15a in QCoreApplication::notifyInternal2 (receiver=0x555555c02c90, event=0x7fffffffde60) at kernel/qcoreapplication.cpp:1064
#70 0x00007ffff74c757b in QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x555555c02c90, event=event@entry=0x7fffffffde60, alienWidget=alienWidget@entry=0x555555c02c90, nativeWidget=0x5555557874a0, buttonDown=<optimized out>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2614
#71 0x00007ffff751da84 in QWidgetWindow::handleMouseEvent (this=0x5555559d50e0, event=0x7fffffffe130) at kernel/qwidgetwindow.cpp:683
#72 0x00007ffff7520db5 in QWidgetWindow::event (this=0x5555559d50e0, event=0x7fffffffe130) at kernel/qwidgetwindow.cpp:300
#73 0x00007ffff74c0d62 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5555559d50e0, e=0x7fffffffe130) at kernel/qapplication.cpp:3632
#74 0x00007ffff68da15a in QCoreApplication::notifyInternal2 (receiver=0x5555559d50e0, event=0x7fffffffe130) at kernel/qcoreapplication.cpp:1064
#75 0x00007ffff6dc5210 in QGuiApplicationPrivate::processMouseEvent (e=0x5555569764d0) at kernel/qguiapplication.cpp:2282
#76 0x00007ffff6d9a7e5 in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169
#77 0x00007ffff11c7fbc in xcbSourceDispatch (source=<optimized out>) at qxcbeventdispatcher.cpp:105
#78 0x00007ffff44aa10c in g_main_dispatch (context=0x7fffec005000) at ../glib/glib/gmain.c:3337
#79 g_main_context_dispatch (context=0x7fffec005000) at ../glib/glib/gmain.c:4055
#80 0x00007ffff44fdb99 in g_main_context_iterate.constprop.0 (context=context@entry=0x7fffec005000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4131
#81 0x00007ffff44a7871 in g_main_context_iteration (context=0x7fffec005000, may_block=1) at ../glib/glib/gmain.c:4196
#82 0x00007ffff6932d86 in QEventDispatcherGlib::processEvents (this=0x5555556e26b0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#83 0x00007ffff68d8acc in QEventLoop::exec (this=this@entry=0x7fffffffe460, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#84 0x00007ffff68e1034 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#85 0x0000555555560968 in ?? ()
#86 0x0000000000000063 in ?? ()
#87 0x00007fffffffe530 in ?? ()
#88 0x00007fffffffe540 in ?? ()
#89 0x00007fffffffe548 in ?? ()
#90 0x00007fffffffe550 in ?? ()
#91 0x00007fff00000000 in ?? ()
#92 0x000000770000007c in ?? ()
#93 0x00007fffffffe570 in ?? ()
#94 0x00007fffffffe520 in ?? ()
#95 0x00007fffffffe528 in ?? ()
#96 0x0000000000000030 in ?? ()
#97 0x0000000100000028 in ?? ()
#98 0x00005555555b7e40 in ?? ()
#99 0x0000555555570f60 in ?? ()
#100 0x0000555555658310 in ?? ()
#101 0x0000555555570e20 in ?? ()
#102 0x00005555557473a0 in ?? ()
#103 0x0000555555709c70 in ?? ()
#104 0x0000555555708eb0 in ?? ()
#105 0x00007ffff69c45b0 in ?? () from /usr/lib/libQt5Core.so.5
#106 0x00007ffff69c3aa0 in ?? () from /usr/lib/libQt5Core.so.5
#107 0x0000555555a51f40 in ?? ()
#108 0x00007ffff79eb888 in vtable for QApplication () from /usr/lib/libQt5Widgets.so.5
#109 0x00005555555b8140 in ?? ()
#110 0x00007ffff7aca170 in KDEDModule::metaObject() const () from /usr/lib/libKF5DBusAddons.so.5
#111 0x0000000000000000 in ?? ()
[Inferior 1 (process 407226) killed]
Comment 3 Bug Janitor Service 2021-07-13 04:33:41 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Ima S 2021-07-13 04:36:37 UTC
Forgot to change the status, I'm still having the problem with 100% reproducibility.
Comment 5 Nate Graham 2021-08-03 02:56:23 UTC
Looks like it's crashing in teardown.
Comment 6 Sebastian 2022-01-22 13:51:16 UTC
Happens for me too on:

SOFTWARE/OS VERSIONS
KDE Neon 5.23 as of 2022-01-22
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.3
using X11

I'll add gdb and valgrind output as required by the guidelines.
Comment 7 Sebastian 2022-01-22 13:52:36 UTC
Created attachment 145754 [details]
gdb backtrace

GDB backtrace of the crash
Comment 8 Sebastian 2022-01-22 13:53:21 UTC
Created attachment 145755 [details]
valgrind output

valgrind output of the crash
Comment 9 Jonathan Wakely 2022-06-27 09:24:37 UTC
Created attachment 150184 [details]
GDB backtrace of crash

100% reproducible with Fedora RPMs too, using kde-cli-tools-5.24.5-1.fc36.x86_64 in an X11 plasma session.

Running kcmshell5 bolt and just clicking the "Close" button shows:

Previously registered enum will be overwritten due to name clash: Bolt.Secure
Possible conflicting items:
    Bolt.Auth.Secure from scope Bolt injected by Bolt
    Bolt.Security.Secure from scope Bolt injected by Bolt
file:///usr/lib64/qt5/qml/org/kde/kirigami.2/PlaceholderMessage.qml:235:5: QML Heading: Binding loop detected for property "verticalAlignment"
kf.kirigami: The Theme singleton is deprecated (since 5.39). Import Kirigami 2.2 or higher and use the attached property instead.
file:///usr/share/kpackage/kcms/kcm_bolt/contents/ui/DeviceList.qml:24:13: QML RowLayout: Cannot anchor to an item that isn't a parent or sibling.
double free or corruption (out)
KCrash: Application 'kcmshell5' crashing...
KCrash: Attempting to start /usr/libexec/drkonqi
Alarm clock
Comment 10 Jonathan Wakely 2022-06-27 09:27:50 UTC
The crash is an abort in glibc caused by double free on line 2104 of qt5-qtbase-5.15.3-3.fc36.x86_64/src/corelib/kernel/qobject.cpp

2099        // don't use qDeleteAll as the destructor of the child might
2100        // delete siblings
2101        for (int i = 0; i < children.count(); ++i) {
2102            currentChildBeingDeleted = children.at(i);
2103            children[i] = 0;
2104            delete currentChildBeingDeleted;
2105        }
2106        children.clear();

The comment suggests that when a child deletes a sibling it fails to set that entry in the vector to a null pointer, so that the parent subsequently tries to delete that pointer again.
Comment 11 Jonathan Wakely 2022-06-27 09:49:59 UTC
Created attachment 150185 [details]
valgrind log of 'kcmshell5 bolt'

Valgrind shows the destruction of the bold module is riddled with bugs, but possibly all caused by one double free. Fixing that might make all the later errors go away.
Comment 12 Nate Graham 2022-06-27 15:35:11 UTC
*** Bug 427516 has been marked as a duplicate of this bug. ***
Comment 13 David Edmundson 2022-06-27 15:45:41 UTC
Code path (presumably) is:
- Someone else owns a reference to the device
- Manager::~Manager runs. The list clears
- QObject::~QObject of the manager runs
- We delete a child object owning a reference to the device
- We then delete the Device which is a child

In any case it's an easy fix.
Comment 14 Bug Janitor Service 2022-06-27 15:47:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-thunderbolt/-/merge_requests/11
Comment 15 fw.smit01 2022-09-28 15:11:23 UTC
*** Bug 459779 has been marked as a duplicate of this bug. ***
Comment 16 Nate Graham 2022-09-28 15:53:59 UTC
Git commit 09c37c1c312991d08c10c7af94a83902150cb3ad by Nate Graham, on behalf of David Edmundson.
Committed on 28/09/2022 at 15:44.
Pushed by ngraham into branch 'master'.

Avoid combining smart pointers and qobject parent ownership

Devices are stored as QSharedPointer<Device> mDevices. If something has
the memory managed explicitly we don't want QObject parents to also try
and do the same job.

M  +2    -2    src/lib/device.cpp
M  +1    -1    src/lib/device.h
M  +2    -2    src/lib/manager.cpp

https://invent.kde.org/plasma/plasma-thunderbolt/commit/09c37c1c312991d08c10c7af94a83902150cb3ad
Comment 17 Nate Graham 2022-09-28 15:54:27 UTC
Git commit ad691a62fbb3f4d05ef7d273eb4f7dcebbfad33d by Nate Graham, on behalf of David Edmundson.
Committed on 28/09/2022 at 15:54.
Pushed by ngraham into branch 'Plasma/5.26'.

Avoid combining smart pointers and qobject parent ownership

Devices are stored as QSharedPointer<Device> mDevices. If something has
the memory managed explicitly we don't want QObject parents to also try
and do the same job.


(cherry picked from commit 09c37c1c312991d08c10c7af94a83902150cb3ad)

M  +2    -2    src/lib/device.cpp
M  +1    -1    src/lib/device.h
M  +2    -2    src/lib/manager.cpp

https://invent.kde.org/plasma/plasma-thunderbolt/commit/ad691a62fbb3f4d05ef7d273eb4f7dcebbfad33d
Comment 18 Nate Graham 2022-09-28 15:55:11 UTC
Git commit 6ea3f5393e84ce9122f081c9b5c5ae47ee81f752 by Nate Graham, on behalf of David Edmundson.
Committed on 28/09/2022 at 15:55.
Pushed by ngraham into branch 'Plasma/5.24'.

Avoid combining smart pointers and qobject parent ownership

Devices are stored as QSharedPointer<Device> mDevices. If something has
the memory managed explicitly we don't want QObject parents to also try
and do the same job.


(cherry picked from commit 09c37c1c312991d08c10c7af94a83902150cb3ad)

M  +2    -2    src/lib/device.cpp
M  +1    -1    src/lib/device.h
M  +2    -2    src/lib/manager.cpp

https://invent.kde.org/plasma/plasma-thunderbolt/commit/6ea3f5393e84ce9122f081c9b5c5ae47ee81f752