Bug 471952 - kscreenlocker_greet crashes when qmlcache is corrupted
Summary: kscreenlocker_greet crashes when qmlcache is corrupted
Status: RESOLVED FIXED
Alias: None
Product: kscreenlocker
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.6
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-04 16:54 UTC by l.fuerderer
Modified: 2023-09-28 22:10 UTC (History)
1 user (show)

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


Attachments
The lockscreen as I see it when kscreenlocker_greet crashes (128.06 KB, image/png)
2023-07-04 16:54 UTC, l.fuerderer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description l.fuerderer 2023-07-04 16:54:29 UTC
Created attachment 160078 [details]
The lockscreen as I see it when kscreenlocker_greet crashes

SUMMARY
When I lock my screen, I see an error message telling me how to unlock my screen again using a console.
It looks like I corrupted my qmlcache that kscreenlocker_greet uses.
The file ~/.cache/kscreenlocker_greet/qmlcache/5c5649af53bb78a2255cc07dba00b5d037690788.qmlc is truncated to 12288 bytes on my system (which is exactly 12 KiB).
When I remove the file, it will be regenerated with a size of 16068 bytes and the screen lock works as expected.
I can only speculate, how this file corruption happened. In my opinion, the most likely explanation is a "full disk" that caused the file not to be written to the end. After this "incident" the file stayed corrupted until I manually deleted it.


STEPS TO REPRODUCE
1. Make sure, the screen was locked at least once before, so that the following file exists.
2. truncate -s 12288 ~/.cache/kscreenlocker_greet/qmlcache/5c5649af53bb78a2255cc07dba00b5d037690788.qmlc
3. Lock the screen.

OBSERVED RESULT
A black screen with white text that cannot be unlocked graphically. It gives me instructions, how to unlock using the console. (See attached screenshot)


EXPECTED RESULT
When a cache file was not completely written to disk before, I would expect that it is not used the next time but regenerated instead. The screen should be able to lock as normal.


SOFTWARE/OS VERSIONS
Linux-Kernel: 6.4.1
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
The following messages appear in the journal log:
Jul 04 18:09:50 lukas kcminit[20142]: Initializing  "/usr/lib/qt/plugins/plasma/kcms/systemsettings/kcm_mouse.so"
Jul 04 18:09:50 lukas kcminit[20142]: Initializing  "/usr/lib/qt/plugins/plasma/kcms/systemsettings/kcm_touchpad.so"
Jul 04 18:09:50 lukas kcminit[20142]: kcm_touchpad: Using X11 backend
Jul 04 18:09:51 lukas kscreenlocker_greet[20147]: Qt: Session management error: networkIdsList argument is NULL
Jul 04 18:09:51 lukas kernel: QQmlThread[20165]: segfault at 7f87b2296b24 ip 00007f875fc1f781 sp 00007f873cff7580 error 4 in libQt5Qml.so.5.15.10[7f875faa7000+281000] likely on CPU 5 (core 1, socket 0)
Jul 04 18:09:51 lukas kernel: Code: c0 0f 84 62 02 00 00 4c 8d 3c 40 31 db 49 c1 e7 02 0f 1f 84 00 00 00 00 00 41 8b 45 44 48 89 ef 48 01 d8 48 83 c3 0c 4c 01 e8 <8b> 70 04 48 8d 50 08 e8 d3 c5 ff ff 4c 39 fb 75 de 66 41 83 7d 48
Jul 04 18:09:51 lukas kscreenlocker_greet[20166]: Qt: Session management error: networkIdsList argument is NULL
Jul 04 18:09:51 lukas kernel: QQmlThread[20180]: segfault at 7fe77dff8007 ip 00007fe71841f781 sp 00007fe6f4ff7580 error 4 in libQt5Qml.so.5.15.10[7fe7182a7000+281000] likely on CPU 4 (core 0, socket 0)
Jul 04 18:09:51 lukas kernel: Code: c0 0f 84 62 02 00 00 4c 8d 3c 40 31 db 49 c1 e7 02 0f 1f 84 00 00 00 00 00 41 8b 45 44 48 89 ef 48 01 d8 48 83 c3 0c 4c 01 e8 <8b> 70 04 48 8d 50 08 e8 d3 c5 ff ff 4c 39 fb 75 de 66 41 83 7d 48
Jul 04 18:09:51 lukas kscreenlocker_greet[20181]: Qt: Session management error: networkIdsList argument is NULL
Jul 04 18:09:51 lukas kernel: QQmlThread[20195]: segfault at 7f8faf415007 ip 00007f8f4e81f781 sp 00007f8f2cd6d580 error 4 in libQt5Qml.so.5.15.10[7f8f4e6a7000+281000] likely on CPU 3 (core 3, socket 0)
Jul 04 18:09:51 lukas kernel: Code: c0 0f 84 62 02 00 00 4c 8d 3c 40 31 db 49 c1 e7 02 0f 1f 84 00 00 00 00 00 41 8b 45 44 48 89 ef 48 01 d8 48 83 c3 0c 4c 01 e8 <8b> 70 04 48 8d 50 08 e8 d3 c5 ff ff 4c 39 fb 75 de 66 41 83 7d 48
Jul 04 18:09:51 lukas kscreenlocker_greet[20196]: Qt: Session management error: networkIdsList argument is NULL
Jul 04 18:09:51 lukas kernel: QQmlThread[20210]: segfault at 7f46db59cb24 ip 00007f467821f781 sp 00007f4655ff9580 error 4 in libQt5Qml.so.5.15.10[7f46780a7000+281000] likely on CPU 2 (core 2, socket 0)
Jul 04 18:09:51 lukas kernel: Code: c0 0f 84 62 02 00 00 4c 8d 3c 40 31 db 49 c1 e7 02 0f 1f 84 00 00 00 00 00 41 8b 45 44 48 89 ef 48 01 d8 48 83 c3 0c 4c 01 e8 <8b> 70 04 48 8d 50 08 e8 d3 c5 ff ff 4c 39 fb 75 de 66 41 83 7d 48
Comment 1 Nate Graham 2023-09-14 18:52:23 UTC
Can confirm that I can blow up the screenlocker by corrupting one of those files. Whis seems bad. I wonder if it's one of the causes of these "screenlocker is broken" reports.
Comment 2 Bug Janitor Service 2023-09-18 08:58:23 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kscreenlocker/-/merge_requests/164
Comment 3 Harald Sitter 2023-09-26 20:09:01 UTC
Git commit d1640daa360943f86196e323c4a76bde57566150 by Harald Sitter.
Committed on 18/09/2023 at 10:59.
Pushed by sitter into branch 'master'.

greeter: disable qml disk cache

The cache currently runs risk of getting corrupted and breaking the lock
screen until the cache hash changes or the cache file gets removed by
the user. Since we don't necessarily need a cache here let's just
disable it for the time being in the interest of greater fault
tolerance.

M  +5    -0    greeter/main.cpp

https://invent.kde.org/plasma/kscreenlocker/-/commit/d1640daa360943f86196e323c4a76bde57566150
Comment 4 Harald Sitter 2023-09-26 20:12:52 UTC
Git commit f9b5596b2763e33319134cfd9e9fd5e6bd124a0b by Harald Sitter.
Committed on 26/09/2023 at 22:09.
Pushed by sitter into branch 'Plasma/5.27'.

greeter: disable qml disk cache

The cache currently runs risk of getting corrupted and breaking the lock
screen until the cache hash changes or the cache file gets removed by
the user. Since we don't necessarily need a cache here let's just
disable it for the time being in the interest of greater fault
tolerance.
(cherry picked from commit d1640daa360943f86196e323c4a76bde57566150)

M  +5    -0    greeter/main.cpp

https://invent.kde.org/plasma/kscreenlocker/-/commit/f9b5596b2763e33319134cfd9e9fd5e6bd124a0b