Bug 492996 - Kscreenlocker_greet frequently segfaults
Summary: Kscreenlocker_greet frequently segfaults
Status: RESOLVED WORKSFORME
Alias: None
Product: plasmashell
Classification: Plasma
Component: Screen locking (other bugs)
Version First Reported In: 6.1.4
Platform: openSUSE Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-12 03:37 UTC by Cars
Modified: 2025-03-05 20:12 UTC (History)
4 users (show)

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


Attachments
Output from Crashed Processes Viewer (20.95 KB, text/plain)
2024-09-12 03:37 UTC, Cars
Details
gdblog (123.81 KB, text/plain)
2024-09-17 18:22 UTC, Cars
Details
useful gdb output (89.07 KB, text/plain)
2024-09-18 04:24 UTC, Cars
Details
debug session output (40.80 KB, text/plain)
2024-09-18 04:35 UTC, Cars
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cars 2024-09-12 03:37:12 UTC
Created attachment 173569 [details]
Output from Crashed Processes Viewer

SUMMARY
Kscreenlocker_greet frequently crashes when I attempt to unlock the computer. 

STEPS TO REPRODUCE
1.  run "$ usr/libexec/kscreenlocker_greet --testing"
2.  wait
3.  segfault

OBSERVED RESULT
"""
kf.svg: The theme "Amy-Plasma" uses the legacy metadata.desktop. Consider contacting the author and asking them update it to use the newer JSON format.
kf.svg: The theme "Amy-Plasma" uses the legacy metadata.desktop. Consider contacting the author and asking them update it to use the newer JSON format.
kf.plasma.core: The theme "Amy-Plasma" uses the legacy metadata.desktop. Consider contacting the author and asking them update it to use the newer JSON format.
kf.plasma.core: The theme "Amy-Plasma" uses the legacy metadata.desktop. Consider contacting the author and asking them update it to use the newer JSON format.
Locked at 1726111691
kf.svg: The theme "Amy-Plasma" uses the legacy metadata.desktop. Consider contacting the author and asking them update it to use the newer JSON format.
qt.gui.imageio: libpng warning: iCCP: known incorrect sRGB profile
Segmentation fault (core dumped)
"""

EXPECTED RESULT
No segfault

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20240908
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.8-1-default (64-bit)
Graphics Platform: Wayland
Processors: 20 × Intel® Core™ i9-10900KF CPU @ 3.70GHz
Memory: 31.2 GiB of RAM
Graphics Processor: AMD Radeon RX 6700 XT
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: Z590 VISION D
System Version: -CF

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2024-09-16 19:36:11 UTC
Could you follow the instructions at https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl to get a backtrace of only the crashing thread that has debug symbols? Thanks a lot!
Comment 2 Cars 2024-09-17 17:55:14 UTC
#0  0x00007f394ac96204 in pthread_mutex_lock@@GLIBC_2.2.5 () from /lib64/libc.so.6
#1  0x00007f3944142189 in PR_Lock () from /lib64/libnspr4.so
#2  0x00007f3944145736 in PR_CallOnce () from /lib64/libnspr4.so
#3  0x00007f3944187688 in ?? () from /lib64/libnss3.so
#4  0x00007f394418bd49 in NSS_Init () from /lib64/libnss3.so
#5  0x00007f394528a696 in pam_sm_authenticate () from /usr/lib64/security/pam_pkcs11.so
#6  0x00007f394d9a72e3 in ?? () from /lib64/libpam.so.0
#7  0x00007f394d9a7b49 in pam_authenticate () from /lib64/libpam.so.0
#8  0x000056385669c864 in ?? ()
#9  0x00007f394b5d1e1b in QObject::event(QEvent*) () from /lib64/libQt6Core.so.6
#10 0x00007f394b58ec30 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt6Core.so.6
#11 0x00007f394b58ef90 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt6Core.so.6
#12 0x00007f394b7c2fe3 in ?? () from /lib64/libQt6Core.so.6
#13 0x00007f3949910fb8 in ?? () from /lib64/libglib-2.0.so.0
#14 0x00007f3949912d38 in ?? () from /lib64/libglib-2.0.so.0
#15 0x00007f39499133ec in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#16 0x00007f394b7c1adc in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#17 0x00007f394b5993db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt6Core.so.6
#18 0x00007f394b674a64 in QThread::exec() () from /lib64/libQt6Core.so.6
#19 0x00007f394b6ed139 in ?? () from /lib64/libQt6Core.so.6
#20 0x00007f394ac92e22 in start_thread () from /lib64/libc.so.6
#21 0x00007f394ad1433c in __clone3 () from /lib64/libc.so.6
Comment 3 Cars 2024-09-17 18:22:45 UTC
Created attachment 173788 [details]
gdblog
Comment 4 Cars 2024-09-17 18:28:23 UTC
I attempted to run the gdb commands in the documentation but it failed to download the debug symbols for kscreenlocker_greet, so the end result is unhelpful. Any help on getting the debug symbols loaded for that would be helpful.

The attached gdblog is on two separate debugging attempts, the first didn't crash, the second did. 

I had previously attempted to get smart card sign-in working, looks like kscreenlocker_greet didn't like what I did. I wonder if the pam process for the smart card reader is crashing which leads kscreenlocker_greet to lock-up?
Comment 5 Nate Graham 2024-09-17 18:42:51 UTC
Thanks, that's better than what we had before at least. This stuff makes me nervous though:

#1  0x00007f3944142189 in PR_Lock () from /lib64/libnspr4.so
#2  0x00007f3944145736 in PR_CallOnce () from /lib64/libnspr4.so
#3  0x00007f3944187688 in ?? () from /lib64/libnss3.so
#4  0x00007f394418bd49 in NSS_Init () from /lib64/libnss3.so
#5  0x00007f394528a696 in pam_sm_authenticate () from /usr/lib64/security/pam_pkcs11.so
#6  0x00007f394d9a72e3 in ?? () from /lib64/libpam.so.0
#7  0x00007f394d9a7b49 in pam_authenticate () from /lib64/libpam.so.0

So depending on what you did to try to get smart card auth working, that could be quite related. At this point I would recommend talking to the openSUSE folks about how to get that working properly, and after following their instructions, let's see if it still crashes. If so, we can go down the path of manually downloading debug symbols using zypper and we'll re-open the bug.

Does that sound like a plan?
Comment 6 Cars 2024-09-17 19:07:26 UTC
(In reply to Nate Graham from comment #5)
> Thanks, that's better than what we had before at least. This stuff makes me
> nervous though:
> 
> #1  0x00007f3944142189 in PR_Lock () from /lib64/libnspr4.so
> #2  0x00007f3944145736 in PR_CallOnce () from /lib64/libnspr4.so
> #3  0x00007f3944187688 in ?? () from /lib64/libnss3.so
> #4  0x00007f394418bd49 in NSS_Init () from /lib64/libnss3.so
> #5  0x00007f394528a696 in pam_sm_authenticate () from
> /usr/lib64/security/pam_pkcs11.so
> #6  0x00007f394d9a72e3 in ?? () from /lib64/libpam.so.0
> #7  0x00007f394d9a7b49 in pam_authenticate () from /lib64/libpam.so.0
> 
> So depending on what you did to try to get smart card auth working, that
> could be quite related. At this point I would recommend talking to the
> openSUSE folks about how to get that working properly, and after following
> their instructions, let's see if it still crashes. If so, we can go down the
> path of manually downloading debug symbols using zypper and we'll re-open
> the bug.
> 
> Does that sound like a plan?

I definitely can, though in an ideal world, this issue wouldn't also knock out kscreenlocker_greet. I'm happy to dive more into this issue if someone from the dev community can give me some help with more in-depth debugging. I understand this is probably a low priority given the niche problem, so if I don't hear back from anyone I'll report back once I talk to the opensuse folks
Comment 7 David Edmundson 2024-09-17 22:28:07 UTC
Next time you run in gdb please ensure the backtrace is after the segfault and run

"thread apply all bt"

The trace above just shows pam waiting, which is fine.
Comment 8 Cars 2024-09-18 04:24:41 UTC
Created attachment 173810 [details]
useful gdb output
Comment 9 Cars 2024-09-18 04:27:20 UTC
(In reply to David Edmundson from comment #7)
> Next time you run in gdb please ensure the backtrace is after the segfault
> and run
> 
> "thread apply all bt"
> 
> The trace above just shows pam waiting, which is fine.

I've figured out the debugging symbol dependencies and ran "thread apply all bt" on the last crash using coredumpctl gdb. I've attached the output
Comment 10 Cars 2024-09-18 04:35:29 UTC
Created attachment 173811 [details]
debug session output

gdb output from debugging session without relying on coredumpctl. Threads are named
Comment 11 Nate Graham 2024-09-18 12:28:50 UTC
Hmm, still missing a lot of symbols:


Thread 13 "QThread" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd56006c0 (LWP 50913)]
___pthread_mutex_lock (mutex=0x0) at pthread_mutex_lock.c:80
80	  unsigned int type = PTHREAD_MUTEX_TYPE_ELISION (mutex);
#0  ___pthread_mutex_lock (mutex=0x0) at pthread_mutex_lock.c:80
#1  0x00007fffd7fde189 in ?? ()
#2  0x00007fffdcb4ce68 in ?? ()
#3  0x00007fffd7fe1736 in ?? ()
#4  0x00007fffb40017c0 in ?? ()
#5  0x0000000000000000 in ?? ()
Comment 12 TraceyC 2025-03-04 23:24:36 UTC
I'm sorry it's been so long since our last response. Can you test this with an up to date system? Qt is now at 6.8.2 and this crash may have been fixed. Thanks!
Comment 13 Cars 2025-03-05 03:25:12 UTC
(In reply to TraceyC from comment #12)
> I'm sorry it's been so long since our last response. Can you test this with
> an up to date system? Qt is now at 6.8.2 and this crash may have been fixed.
> Thanks!

I tried to get better debug logs for a few days but never managed to get anything better that what I had sent. I've since removed the smart card integration and reset my PAM configs so I'm unable to replicate the issue
Comment 14 TraceyC 2025-03-05 20:12:52 UTC
I'll close this for now. If you run into it again, and can get a more complete backtrace, feel free to open this report back up. Thanks!