Bug 413231 - Kscreenlocker random crash after inotify_add failure
Summary: Kscreenlocker random crash after inotify_add failure
Status: RESOLVED BACKTRACE
Alias: None
Product: kscreenlocker
Classification: Plasma
Component: greeter (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-20 10:15 UTC by Qu Wenruo
Modified: 2019-10-20 14:42 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Qu Wenruo 2019-10-20 10:15:30 UTC
SUMMARY

First thing first, I don't understand why kscreenlocker is calling inotify_add(), especially calling inotify_add() can fail due to limit. And I don't believe it's OK to make kscreenlocker to read things in one's home directory.

Secondly, kscreenlocker_greeter crash would easily make user experience crappy.
User needs to unlock the session manually using loginctl.

The crash happens with the following info in journal:
17:07:37 adam-pc kscreenlocker_greet[12230]: inotify_add_watch(/home/adam/.config/plasmarc) failed: (No space left on device)
17:07:37 adam-pc kscreenlocker_greet[12230]: inotify_add_watch(/usr/share/plasma/desktoptheme/Arc-Dark/metadata.desktop) failed: (No space left on device)
17:07:37 adam-pc kscreenlocker_greet[12230]: inotify_add_watch(/usr/share/icons/Papirus-Dark/index.theme) failed: (No space left on device)
17:07:37 adam-pc kscreenlocker_greet[12230]: inotify_add_watch(/etc/fstab) failed: (No space left on device)
17:07:39 adam-pc kernel: kscreenlocker_g[12230]: segfault at 7ffbff7fdfe0 ip 00007efbfe417558 sp 00007ffbff7fdfb0 error 6 in libQt5Gui.so.5.13.1[7efbfe0a6000+414000]
17:07:39 adam-pc kernel: Code: e5 40 e9 6b ff ff ff 90 66 2e 0f 1f 84 00 00 00 00 00 41 57 41 56 41 55 41 54 55 53 48 89 fb 48 81 ec c8 38 00 00 48 8b 6f 10 <48> 89 74 24 30 64 48 8b 04 25 28 00 00 00 48 >gg

STEPS TO REPRODUCE
1. Use fs.inotify.max_user_watches to a low value (in my case, it's 2048)
2. Lock the session manually or wait for screensaver to kick in

OBSERVED RESULT
Kscreenlocker crashes and have to use loginctl to unlock session

EXPECTED RESULT
Kscreenlocker kicks in and shows the regular greeter


SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
KDE Plasma Version: 5.17.0
KDE Frameworks Version:  5.63.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION
Comment 1 David Edmundson 2019-10-20 14:21:22 UTC
I doubt it's related. Most cases where you see stderr it shows a dev handled a bad case. It's also 2 minutes earlier.

I think it's the known slideshow wallpaper crash, which will be fixed in 5.17.1 


Failing that please run

gdb --args /opt/kde5/lib64/libexec/kscreenlocker_greet --testing 

and fetch a backtrace
Comment 2 Qu Wenruo 2019-10-20 14:42:41 UTC
I'm not using the slideshow mode, just a single picture. (with a little long file name with multiple spaces in it)

And as I mentioned it's really random, using --testing to start greeter hasn't yet triggered the crash yet (0/10 runs).
But has hit it in real world load in both my laptop and desktop more than once.

I'll try to catch a crash, but coredumpctl hasn't yet catch any dump yet, which looks pretty strange.