Bug 473668

Summary: Plasmashell crashes in NetworkModel::updateItem() when trying to connect to OpenVPN shortly after disconnecting
Product: [Plasma] plasma-nm Reporter: valdikss
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: ASSIGNED ---    
Severity: crash CC: ashl1future, casteele, dennis, ecthelion, kde, kdedev, nate, qydwhotmail, weeeyuki
Priority: HI Keywords: drkonqi
Version: 5.27.6   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report: https://crash-reports.kde.org/organizations/kde/issues/23042/
Attachments: Video of NetworkManager applet crash

Description valdikss 2023-08-23 05:39:30 UTC
Application: plasmashell (5.27.6)

Qt Version: 5.15.9
Frameworks Version: 5.108.0
Operating System: Linux 6.4.11-100.fc37.x86_64 x86_64
Windowing System: X11
Distribution: Fedora Linux 37 (KDE Plasma)
DrKonqi: 5.27.6 [KCrashBackend]

-- Information about the crash:
Plasmashell crashes (and automatically restarts) when the user disconnects from VPN connection using NetworkManager plasma applet, and connects to the VPN connection again (same or other) in about 1 second after disconnection.

This happens quite frequently, but not all the time. To prevent the crashes, it is usually sufficient to wait 2 seconds before reconnecting to the VPN.

The bug is very old, I remember it happening for more than 3-4 years. KDE Crash handler never cought it, for some reason it worked this time, that's why I reporting it.

The crash can be reproduced sometimes.

-- Backtrace:
Application: Plasma (plasmashell), signal: Segmentation fault

[KCrash Handler]
#4  0x00007fb10b2cbf86 in QMetaObject::activate(QObject*, int, void**) (sender=0x0, signal_index=34, argv=0x0) at kernel/qobject.cpp:4005
#5  0x00007fb10a26dd4a in VDMModelDelegateDataType::notify(QQmlAdaptorModel const&, QList<QQmlDelegateModelItem*> const&, int, int, QVector<int> const&) const () at /lib64/libQt5QmlModels.so.5
#6  0x00007fb10a275dcb in QQmlDelegateModel::_q_itemsChanged(int, int, QVector<int> const&) () at /lib64/libQt5QmlModels.so.5
#7  0x00007fb10a281689 in QQmlDelegateModel::_q_layoutChanged(QList<QPersistentModelIndex> const&, QAbstractItemModel::LayoutChangeHint) () at /lib64/libQt5QmlModels.so.5
#8  0x00007fb10a281ffb in QQmlDelegateModel::qt_metacall(QMetaObject::Call, int, void**) () at /lib64/libQt5QmlModels.so.5
#9  0x00007fb10b2d0e9e in doActivate<false>(QObject*, int, void**) (sender=0x55577debf030, signal_index=6, argv=0x7ffd7a355a80) at kernel/qobject.cpp:3949
#10 0x00007fb10b2cbf57 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x55577debf030, m=m@entry=0x7fb10b55c920 <QAbstractItemModel::staticMetaObject>, local_signal_index=local_signal_index@entry=3, argv=argv@entry=0x7ffd7a355a80) at kernel/qobject.cpp:3983
#11 0x00007fb10b24ddfa in QAbstractItemModel::layoutChanged(QList<QPersistentModelIndex> const&, QAbstractItemModel::LayoutChangeHint) (this=this@entry=0x55577debf030, _t1=..., _t2=<optimized out>, _t2@entry=QAbstractItemModel::VerticalSortHint) at .moc/moc_qabstractitemmodel.cpp:571
#12 0x00007fb10b27f92f in QSortFilterProxyModelPrivate::_q_sourceDataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) (this=0x55577cf977d0, source_top_left=<optimized out>, source_bottom_right=<optimized out>, roles=<optimized out>) at itemmodels/qsortfilterproxymodel.cpp:1510
#13 0x00007fb10b2d114f in doActivate<false>(QObject*, int, void**) (sender=0x55577d501c30, signal_index=3, argv=0x7ffd7a355d20) at kernel/qobject.cpp:3935
#14 0x00007fb10b2cbf57 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=m@entry=0x7fb10b55c920 <QAbstractItemModel::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd7a355d20) at kernel/qobject.cpp:3983
#15 0x00007fb10b24dd00 in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) (this=<optimized out>, _t1=<optimized out>, _t2=<optimized out>, _t3=<optimized out>) at .moc/moc_qabstractitemmodel.cpp:557
#16 0x00007fb0a2f35f52 in NetworkModel::updateItem(NetworkModelItem*) () at /lib64/libplasmanm_internal.so
#17 0x00007fb0a2f319c9 in NetworkModel::addActiveConnection(QSharedPointer<NetworkManager::ActiveConnection> const&) () at /lib64/libplasmanm_internal.so
#18 0x00007fb0a2f3686a in NetworkModel::activeConnectionAdded(QString const&) () at /lib64/libplasmanm_internal.so
#19 0x00007fb10b2d0fc6 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffd7a355fb0, r=<optimized out>, this=0x55577f1410b0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#20 doActivate<false>(QObject*, int, void**) (sender=0x7fb0a2db5180, signal_index=13, argv=0x7ffd7a355fb0) at kernel/qobject.cpp:3923
#21 0x00007fb0a2ce2e49 in NetworkManager::Notifier::activeConnectionAdded(QString const&) () at /lib64/libKF5NetworkManagerQt.so.6
#22 0x00007fb0a2d0c189 in NetworkManager::NetworkManagerPrivate::propertiesChanged(QMap<QString, QVariant> const&) () at /lib64/libKF5NetworkManagerQt.so.6
#23 0x00007fb0a2ce8db3 in NetworkManager::NetworkManagerPrivate::qt_metacall(QMetaObject::Call, int, void**) () at /lib64/libKF5NetworkManagerQt.so.6
#24 0x00007fb10c5810bb in QDBusConnectionPrivate::deliverCall(QObject*, int, QDBusMessage const&, QVector<int> const&, int) (this=<optimized out>, object=<optimized out>, msg=<optimized out>, metaTypes=<optimized out>, slotIdx=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qvarlengtharray.h:189
#25 0x00007fb10b2c8264 in QObject::event(QEvent*) (this=0x7fb0a2db5180, e=0x7fb0f4101150) at kernel/qobject.cpp:1347
#26 0x00007fb10bfaed72 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#27 0x00007fb10b29d618 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x7fb0a2db5180, event=0x7fb0f4101150) at kernel/qcoreapplication.cpp:1064
#28 0x00007fb10b29d802 in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1462
#29 0x00007fb10b2a0984 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x55577b51b3d0) at kernel/qcoreapplication.cpp:1821
#30 0x00007fb10b2a0c1c in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=<optimized out>, event_type=<optimized out>) at kernel/qcoreapplication.cpp:1680
#31 0x00007fb10b2eec27 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x55577b5e99b0) at kernel/qeventdispatcher_glib.cpp:277
#32 0x00007fb109ffcc7f in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#33 0x00007fb10a053178 in g_main_context_iterate.constprop () at /lib64/libglib-2.0.so.0
#34 0x00007fb109ff9f00 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#35 0x00007fb10b2ee71a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55577b5f7470, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#36 0x00007fb10b29c06a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffd7a356640, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#37 0x00007fb10b2a4132 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#38 0x000055577b31868c in main ()
[Inferior 1 (process 7851) detached]

The reporter indicates this bug may be a duplicate of or related to bug 472176.

Reported using DrKonqi
Comment 1 valdikss 2023-08-23 05:47:19 UTC
Created attachment 161130 [details]
Video of NetworkManager applet crash
Comment 2 Nate Graham 2023-08-23 16:54:21 UTC
*** Bug 472176 has been marked as a duplicate of this bug. ***
Comment 3 Nate Graham 2023-11-30 22:01:40 UTC
*** Bug 477403 has been marked as a duplicate of this bug. ***
Comment 4 Nate Graham 2024-04-10 17:58:35 UTC
*** Bug 483877 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2024-08-19 21:45:34 UTC
*** Bug 491895 has been marked as a duplicate of this bug. ***
Comment 6 Bug Janitor Service 2024-09-27 13:17:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-nm/-/merge_requests/374
Comment 7 Fushan Wen 2024-09-27 13:18:36 UTC
(In reply to Bug Janitor Service from comment #6)
> A possibly relevant merge request was started @
> https://invent.kde.org/plasma/plasma-nm/-/merge_requests/374

Can anyone affected test this change?
Comment 8 TraceyC 2024-09-27 18:56:01 UTC
I'm not able to reproduce the crash testing with a ProtonVPN wireguard connection and a private wireguard connection (both set up through Network Manager)
I tested on git-master as well as 6.1.5
I'm able to disconnect and reconnect to a VPN successfully multiple times with no crashes