Bug 417545 - kded5 crashes in ModemMonitor::requestPin(MMModemLock)
Summary: kded5 crashes in ModemMonitor::requestPin(MMModemLock)
Status: RESOLVED FIXED
Alias: None
Product: plasma-nm
Classification: Plasma
Component: general (show other bugs)
Version: 5.18.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Jan Grulich
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-02-13 09:16 UTC by jan
Modified: 2020-02-19 09:11 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jan 2020-02-13 09:16:49 UTC
SUMMARY
Ctrl+Esc no longer shows System Activity.

STEPS TO REPRODUCE
1. Press Ctrl+Esc

OBSERVED RESULT
Pressing Ctrl+Esc does no longer open System Activity.

EXPECTED RESULT
Pressing Ctrl+Esc should open the System Activity (c.f. https://userbase.kde.org/System_Activity)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.18.0
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1

ADDITIONAL INFORMATION
Comment 1 Frederick Zhang 2020-02-13 11:38:01 UTC
I'm also running 5.18.0 on Arch and the shortcut works for me. Could you try re-assign this shortcut in Global Shortcuts -> KDE Daemon -> Show System Activity to see whether there are any issues, e.g. conflicts?
Comment 2 jan 2020-02-13 16:55:22 UTC
There was a second assignment for Ctrl+Esc (close window), but that's not it. Turns out that kded5 crashes on startup and therefore isn't running. If I start it from konsole I get the following messages:


Installing the delayed initialization callback.
org.kde.knotifications: env says KDE is running but SNI unavailable -- check KDE_FULL_SESSION and XDG_CURRENT_DESKTOP
bluedevil: Created
print-manager.kded: unable to register service to dbus
kcm_touchpad: Using X11 backend
Width:  2062  height:  1076
Approx. resX:  22  resY:  21
Touchpad resolution: x:  31  y:  31
Final resolution x: 31  y: 31
Delayed initialization.
Reloading the khotkeys configuration
Version 2 File!
true
Imported file "/usr/share/khotkeys/konqueror_gestures_kde321.khotkeys"
Imported file "/usr/share/khotkeys/konsole.khotkeys"
Imported file "/usr/share/khotkeys/kde32b1.khotkeys"
Imported file "/usr/share/khotkeys/defaults.khotkeys"
Registering ":1.266/org/ayatana/NotificationItem/dropbox_client_4434" to system tray
Registering ":1.252/org/ayatana/NotificationItem/Update_Manager" to system tray
Registering "org.kde.StatusNotifierHost-4103" as system tray
bluedevil: Bluetooth operational changed true
Registering ":1.289/StatusNotifierItem" to system tray
bluedevil: ObexManager operational changed true
plasma-nm: unlockRequired ==  2
kf5.ki18n: "0 instead of 1 arguments to message {The mobile broadband...} supplied before conversion."
QSharedPointer: cannot create a QSharedPointer from a QObject-tracking QWeakPointer
KCrash: Attempting to start /usr/bin/kded5 from kdeinit
sock_file=/run/user/1000/kdeinit5__0
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kded5 path = /usr/bin pid = 5394
KCrash: Arguments: /usr/bin/kded5 
Segmentation fault (core dumped)
Comment 3 Christoph Feck 2020-02-13 18:54:09 UTC
Please add the backtrace for the crash. It could be a duplicate of bug 416961 if you are using a Wayland session.
Comment 4 jan 2020-02-13 19:48:35 UTC
Hm, from the backtrace it seems to be the ModemManager requesting the PIN for my SIM card that fails. If I remove the SIM card, kded5 starts and everything behaves normally including the System Tray (see Bug 417544).

#0  0x00007fffe9a84c19 in ModemMonitor::requestPin(MMModemLock) () at /usr/lib/qt/plugins/kf5/kded/networkmanagement.so
#1  0x00007ffff6d2846e in  () at /usr/lib/libQt5Core.so.5
#2  0x00007fffe93c0522 in ModemManager::Modem::unlockRequiredChanged(MMModemLock) () at /usr/lib/libKF5ModemManagerQt.so.6
#3  0x00007fffe93c3fec in  () at /usr/lib/libKF5ModemManagerQt.so.6
#4  0x00007ffff6d2026a in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#5  0x00007ffff7a16362 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#6  0x00007ffff7a1f819 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#7  0x00007ffff6cf2962 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#8  0x00007ffff6cf51c6 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#9  0x00007ffff6d4b9d4 in  () at /usr/lib/libQt5Core.so.5
#10 0x00007ffff592339e in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#11 0x00007ffff59251b1 in  () at /usr/lib/libglib-2.0.so.0
#12 0x00007ffff59251f1 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#13 0x00007ffff6d4b020 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#14 0x00007ffff6cf14cc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#15 0x00007ffff6cf94d6 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#16 0x000055555555a6ad in  ()
#17 0x00007ffff66c5023 in __libc_start_main () at /usr/lib/libc.so.6
#18 0x000055555555a9be in  ()
Comment 5 Méven Car 2020-02-14 11:35:55 UTC
Could install debug symbols for plasma-nm so that we can have a better trace ?
https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Also since you have a sim modem, did you have a prompt asking you for your PIN or did have it stored in kwallet for instance ?
Comment 6 Nate Graham 2020-02-15 21:44:31 UTC
Interesting. Thanks for the info so far; can you please provided the additional information that Méven has requested?
Comment 7 jan 2020-02-16 10:02:27 UTC
Yes, I usually had a prompt asking for the PIN, but currently it doesn't appear. If I unlock the SIM, e.g., via ModemManager, I can start kded5 without crashing.

I also tried setting the mobile connection to auto connect and storing the PIN there. kded5 crashes before the connection can be established, but once it is established, I can restart it.

Unfortunately, Arch Linux doesn't provide packages with debug symbols, so the trace I attached is the best I can do.
Comment 8 Frederick Zhang 2020-02-16 12:22:42 UTC
You can probably build one with debug info yourself with:


diff --git a/repos/extra-x86_64/PKGBUILD b/repos/extra-x86_64/PKGBUILD
index fa028f9..f5f98a0 100644
--- a/repos/extra-x86_64/PKGBUILD
+++ b/repos/extra-x86_64/PKGBUILD
@@ -12,8 +12,9 @@ license=(GPL2)
 depends=(plasma-workspace modemmanager-qt networkmanager-qt qca mobile-broadband-provider-info)
 makedepends=(extra-cmake-modules openconnect)
 optdepends=('openconnect: Cisco AnyConnect VPN plugin')
 groups=(plasma)
+options+=(debug !strip)
 source=("https://download.kde.org/stable/plasma/$pkgver/$pkgname-$pkgver.tar.xz"{,.sig})
 sha256sums=('526cac8d0e189d1fb0a8842b02ca2485e386d3551bd9ef7a9be094c4be9f858e'
             'SKIP')
 validpgpkeys=('2D1D5B0588357787DE9EE225EC94D18F7F05997E'  # Jonathan Riddell <jr@jriddell.org>
@@ -27,9 +28,10 @@ prepare() {
 
 build() {
   cd build
   cmake ../$pkgname-$pkgver \
-    -DBUILD_TESTING=OFF
+    -DBUILD_TESTING=OFF \
+    -DCMAKE_BUILD_TYPE=RelWithDebInfo
   make
 }
 
 package() {


$ asp update
$ asp checkout plasma-nm
$ cd plasma-nm/repos/extra-x86_64
$ git apply "/path/to/diff"
$ makepkg -is
Comment 9 Méven Car 2020-02-18 08:36:55 UTC
@jan@meinkes.com
This is a bug hard to reproduce as it pretty much requires specific hardware and settings.
So please find the energy to produce a stacktrace if you want this bug to have a chance to get fixed.
Comment 10 Jan Grulich 2020-02-18 11:25:58 UTC
Git commit 24c9505c67d9569cf276341e2297712ecdd95d2c by Jan Grulich.
Committed on 18/02/2020 at 11:25.
Pushed by grulich into branch 'Plasma/5.18'.

Fix crash when asking for a modem unlock

M  +21   -21   kded/modemmonitor.cpp

https://commits.kde.org/plasma-nm/24c9505c67d9569cf276341e2297712ecdd95d2c
Comment 11 jan 2020-02-18 17:15:42 UTC
(In reply to Frederick Zhang from comment #8)

Thanks for the instructions. I also needed to add 

options=(debug !strip)

to the PKGBUILD file.

With this I get the following trace:

QSharedPointer: cannot create a QSharedPointer from a QObject-tracking QWeakPointer

Thread 1 "kded5" received signal SIGSEGV, Segmentation fault.
ModemMonitor::requestPin (this=0x55555593cf20, lock=<optimized out>) at /usr/include/qt/QtCore/qsharedpointer_impl.h:452
452         static void deref(Data *dd) noexcept
(gdb) bt
#0  ModemMonitor::requestPin(MMModemLock) (this=0x55555593cf20, lock=<optimized out>) at /usr/include/qt/QtCore/qsharedpointer_impl.h:452
#1  0x00007ffff6d2846e in  () at /usr/lib/libQt5Core.so.5
#2  0x00007fffe93c2711 in ModemManager::Modem::unlockRequiredChanged(MMModemLock) (this=<optimized out>, _t1=<optimized out>)
    at /home/meinke/tmp/modemmanager-qt/repos/extra-x86_64/src/build/src/KF5ModemManagerQt_autogen/EWIEGA46WW/moc_modem.cpp:789
#3  0x00007fffe93c6030 in ModemManager::Modem::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    (_o=0x555555b42c70, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /home/meinke/tmp/modemmanager-qt/repos/extra-x86_64/src/build/src/KF5ModemManagerQt_autogen/EWIEGA46WW/moc_modem.cpp:271
#4  0x00007ffff6d2026a in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#5  0x00007ffff7a16362 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#6  0x00007ffff7a1f819 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#7  0x00007ffff6cf2962 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#8  0x00007ffff6cf51c6 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#9  0x00007ffff6d4b9d4 in  () at /usr/lib/libQt5Core.so.5
#10 0x00007ffff592339e in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#11 0x00007ffff59251b1 in  () at /usr/lib/libglib-2.0.so.0
#12 0x00007ffff59251f1 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#13 0x00007ffff6d4b020 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#14 0x00007ffff6cf14cc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#15 0x00007ffff6cf94d6 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#16 0x000055555555a6ad in  ()
#17 0x00007ffff66c5023 in __libc_start_main () at /usr/lib/libc.so.6
#18 0x000055555555a9be in  ()
Comment 12 jan 2020-02-18 17:16:37 UTC
(In reply to Jan Grulich from comment #10)
> Git commit 24c9505c67d9569cf276341e2297712ecdd95d2c by Jan Grulich.
> Committed on 18/02/2020 at 11:25.
> Pushed by grulich into branch 'Plasma/5.18'.
> 
> Fix crash when asking for a modem unlock
> 
> M  +21   -21   kded/modemmonitor.cpp
> 
> https://commits.kde.org/plasma-nm/24c9505c67d9569cf276341e2297712ecdd95d2c

Thanks for the fix. Looking forward to the update!
Comment 13 jan 2020-02-19 09:11:39 UTC
I just installed and tested 5.18.1. The problem is fixed. Thanks again!