Bug 465269 - Plasma mobile session crashes when kscreenlocker is unlocked
Summary: Plasma mobile session crashes when kscreenlocker is unlocked
Status: RESOLVED FIXED
Alias: None
Product: plasma-mobile
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Debian unstable Linux
: NOR crash
Target Milestone: ---
Assignee: Devin Lin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-04 13:52 UTC by Marco Mattiolo
Modified: 2023-06-15 20:02 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
journalctl log (662.82 KB, text/plain)
2023-02-04 13:52 UTC, Marco Mattiolo
Details
journalctl log of two unlocking: first successful, second failing (901.57 KB, text/plain)
2023-02-09 20:52 UTC, Marco Mattiolo
Details
backtrace-qfeedback (5.61 KB, text/plain)
2023-02-14 07:21 UTC, Devin Lin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Mattiolo 2023-02-04 13:52:06 UTC
Created attachment 155934 [details]
journalctl log

Hi and thank you for developing kscreenlocker!
Here using Plasma mobile 5.26.90 on Mobian testing up-to-date on OG PP.
When plasma-mobile is started as a systemd service, after unlocking the lockscreen I'm getting the white writing "loginctl unlock-session 1" on black background. On the #plasmamobile:kde.org room I've been told that is symptom of a kscreenlocker issue


SOFTWARE/OS VERSIONS
Linux: 6.1-sunxi64
KDE Plasma Version: 5.26.90
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Comment 1 David Edmundson 2023-02-04 14:08:37 UTC
We've seen this in the past when distributions didn't recompile layer-shell-qt after an ABI break. If you have contact with your distribution can you message them.
Comment 2 Marco Mattiolo 2023-02-05 14:13:50 UTC
Hi David, thank you for your answer. I think you're getting to the point here, as this looks to be Debian-specific issue, I've not heard of this by anyone else using other distros.

Looking at the upload dates, layer-shell-qt seems to have been pushed to Debian sid repo [1]  on January,23rd AFTER both qtwayland-opensource-src [2]  and qtbase-opensource-src [3], both on January,13th. As layer-shell-qt was uploaded as source-only, it means it was built in Debian infrastructure on Jan,23rd using at-that-time up-to-date Qt dependencies.

But you have a good point that it has to be some rebuilding missing in Debian, then I'm going to rebuild layer-shell-qt myself to check this. Any further relevant package worth rebuilding?

[1] https://tracker.debian.org/pkg/layer-shell-qt
[2] https://tracker.debian.org/pkg/qtwayland-opensource-src
[3] https://tracker.debian.org/pkg/qtbase-opensource-src
Comment 3 Marco Mattiolo 2023-02-05 15:13:33 UTC
Rebuilding layer-shell-qt (in a docker image pointing to Debian sid archive) didn't solve this...
Comment 4 Marco Mattiolo 2023-02-05 17:34:58 UTC
This can be reproduced using a fresh image from [1], adding sid to the sources (that can be done by adding `deb http://deb.debian.org/debian/ unstable main` to /etc/apt/sources.list, but in a few days plasma-mobile will be accepted in Debian testing and this step will be no more needed), then `sudo apt update` and `sudo apt install plasma-mobile`, reboot and choose Plasma mobile session.

[1] https://images.mobian-project.org/pinephone/weekly/
Comment 5 Marco Mattiolo 2023-02-06 18:38:06 UTC
I have to correct myself, on the #plasmamobile:kde.org Matrix room, Bart (@PureTryOut, pmOS developer) confirmed they have seen this same issue on pmOS devices used for demoing during FOSDEM.

Now it's less likely to be a Debian-specific problem...
Comment 6 Devin Lin 2023-02-08 05:58:48 UTC
(In reply to Marco Mattiolo from comment #5)
> I have to correct myself, on the #plasmamobile:kde.org Matrix room, Bart
> (@PureTryOut, pmOS developer) confirmed they have seen this same issue on
> pmOS devices used for demoing during FOSDEM.
> 
> Now it's less likely to be a Debian-specific problem...

Is there a place where I can get debian images with plasma for the PinePhone? I currently can't replicate this on Manjaro stable, haven't yet tried PMOS stable, but dev packages on PMOS also don't seem to have this at the moment...
Comment 7 Marco Mattiolo 2023-02-08 18:10:00 UTC
(In reply to Devin Lin from comment #6)
> Is there a place where I can get debian images with plasma for the
> PinePhone? I currently can't replicate this on Manjaro stable, haven't yet
> tried PMOS stable, but dev packages on PMOS also don't seem to have this at
> the moment...

Hi Devin! Sadly no Plasma-mobile specific image at the moment [1]. Easiest way to test this is
1. wait until plasma-mobile package is promoted to Debian testing branch, should be there in a couple of days. You can check [2]
2. take latest available image from [3], extract and flash it to an SD card (or to a test OG PP)
3. boot it and tolerate phosh for a few minutes :) [4]
4. open the console (or log into serial console) and "sudo apt update" then "sudo apt install plasma-mobile". As all needed packages are in Debian testing (the branch Mobian images use by default), it should install everything what's needed.
5. reboot, then the phog greeter will give you chance to choose "Plasma mobile" session
6. to avoid running into some weird behavior linked to interaction between phog and plasma-mobile, I suggest logging into serial console and "sudo systemctl stop greetd && sudo systemctl start plasma-mobile" (greetd is the service which starts phog greeter)

Last time I did that on my OG PP (literally 3 days ago), lockscreen appeared (seemingly normal), but the session crashed when unlocking.

[1] explanation is, for the moment and until Debian bookworm is released, we have only plasma-mobile core apps in Debian, then the general consensus inside developer team is plasma-mobile specific image makes no sense for now. After bookworm release, more Plasma apps could make it into Debian and PlaMo image will definitely be added to automatic image-creation tools.
[2] packages.debian.org/plasma-mobile
[3] https://images.mobian-project.org/pinephone/weekly/
[4] https://wiki.mobian-project.org/doku.php?id=install#default-pin-and-password
Comment 8 Marco Mattiolo 2023-02-09 20:52:23 UTC
Created attachment 156111 [details]
journalctl log of two unlocking: first successful, second failing

Today I unlocked the lockscreen and it did not crashed! Following unlocking led to crash, but I hope comparing logs between the unlockings can bring to something...

Please check attached log: at row 3988 lockscreen unlocks succesfully, at row 6591 it fails to unlock.
In the latter case, a couple of
feb 09 19:35:51 mobian kwin_wayland_wrapper[1778]: Error: DataSource type expected
messages are printed, that I cannot see in the successful unlock.
Comment 9 Marco Mattiolo 2023-02-11 21:58:41 UTC
This issue is not present on a test system targeting Debian snapshot of 29/12/2022. White writing on black background "loginctl unlock-session 1" is still present after device is suspended with "sudo systemctl suspend".

29/12/2022 snapshot means following source versions:
qtbase-opensource-src 5.15.7+dfsg-2 [1]
plasma-framework 5.101.0-1 [2]
plasma-workspace 5.26.4-1 [3]
plasma-mobile 5.26.4-1 (built locally on the test system)

Will now try to upgrade small sets of packages to find what broke this...

[1] https://tracker.debian.org/pkg/qtbase-opensource-src
[2] https://tracker.debian.org/pkg/plasma-framework
[3] https://tracker.debian.org/pkg/plasma-workspace
Comment 10 Marco Mattiolo 2023-02-12 21:32:15 UTC
After one day of upgrading day-by-day through snapshot.debian.org, the problem seems to lie IN plasma-mobile.
Moreover,
5.26.4 works (built on the device, both using build-deps from 29/12/2022 and today)
5.26.5 works (built on the device, using build-deps from today)
5.26.90 does not (taken from Debian repo)
then problems seems to reside in Plasma/5.27 branch.

Next steps:
- copy plasma-mobile-5.26.5 packages onto my daily driver system to confirm my assumptions
- git bisect the 5.27 branch
Comment 11 Marco Mattiolo 2023-02-13 21:46:16 UTC
Issue is found starting at 2a779900 [1] commit.

Tbh, that crash with the white "loginctl unlock-session" writing on black background happens from time to time on older commits, too, but that general instability is another topic for another day. From 2a779900 on, it always crashes at unlocking.

[1] https://invent.kde.org/plasma/plasma-mobile/-/commit/2a779900f35360e974420552fae0c10ecab961f5
Comment 12 Devin Lin 2023-02-13 22:40:11 UTC
(In reply to Marco Mattiolo from comment #11)
> Issue is found starting at 2a779900 [1] commit.
> 
> Tbh, that crash with the white "loginctl unlock-session" writing on black
> background happens from time to time on older commits, too, but that general
> instability is another topic for another day. From 2a779900 on, it always
> crashes at unlocking.
> 
> [1]
> https://invent.kde.org/plasma/plasma-mobile/-/commit/
> 2a779900f35360e974420552fae0c10ecab961f5

Hi Marco,

Thanks for looking into this so deeply, I'll need to try setting up a debian environment on my phone to investigate, for some reason I can't seem to replicate it on postmarketOS or desktop.
Comment 13 Devin Lin 2023-02-14 07:21:58 UTC
Created attachment 156218 [details]
backtrace-qfeedback
Comment 14 Devin Lin 2023-02-14 07:24:08 UTC
It seems to be an issue where kscreenlocker crashes right when the greeter app quits (ex. at successful login), which seems to be more likely to trigger the white text on black screen on Debian.

I was able to reproduce a segfault as the screen locker crashes, but the backtrace strangely ends up somewhere in qtfeedback, likely when the hapticseffect deinitializes (for the lockscreen keypad buttons). Attached is the backtrace. I am not totally sure what to do here yet...
Comment 15 Marco Mattiolo 2023-02-14 22:06:37 UTC
As your analysis led to QtFeedback and one source file imports it [1], I've also tried building plasma-mobile 5.26.90 including qtfeedback5-dev as build-time dependency (even if not specified in CMakeLists.txt) but outcome remains crashy.

Ignorant question: I see in my logs that successful unlocking prints
feb 09 19:33:00 mobian kscreenlocker_greet[1126]: pam_unix(kde:auth): authentication failure; logname= uid=1000 euid=1000 tty= ruser= rhost=  user=marco
to journalctl, is that the correct behaviour? I mean, I unlock using correct PIN but pam_unix/kscreenlocker_greet log an "authentication failure"?

[1] https://invent.kde.org/search?search=qtfeedback&nav_source=navbar&project_id=12&group_id=1568&search_code=true&repository_ref=master
Comment 17 Devin Lin 2023-02-17 07:15:02 UTC
(In reply to Marco Mattiolo from comment #16)
> I forgot to add: packages with that commit reverted are available at Salsa's
> plasma-mobile repo [1].
> plasma-mobile [2]
> plasma-mobile-tweaks [3]
> After installing those, issue seems solved on my OG PP.
> 
> [1]
> https://salsa.debian.org/DebianOnMobile-team/plasma-mobile/-/compare/
> debian%2Flatest...
> wip%2Ftiol%2Fbugskde465269?from_project_id=71804&straight=false
> [2]
> https://salsa.debian.org/DebianOnMobile-team/plasma-mobile/-/jobs/3948626/
> artifacts/raw/debian/output/plasma-mobile_5.26.90-
> 3+salsaci+20230214+10_arm64.deb
> [3]
> https://salsa.debian.org/DebianOnMobile-team/plasma-mobile/-/jobs/3948626/
> artifacts/raw/debian/output/plasma-mobile-tweaks_5.26.90-
> 3+salsaci+20230214+10_all.deb

I've cherry picked a revert for that commit to Plasma 5.27 for now so it isn't just borked: https://invent.kde.org/plasma/plasma-mobile/-/commit/e08f8f4a843b2cd7d69b053627408387aabfe214

We are still looking into the haptics stack for Plasma 6, so this may be resolved on master with changes regarding that...
Comment 18 Marco Mattiolo 2023-02-23 20:13:34 UTC
Can confirm, this is resolved in plasma-mobile 5.27.1 .

Shall we keep this bug open and to be checked again on plasma-mobile 6?
Comment 19 Devin Lin 2023-06-15 15:08:55 UTC
(In reply to Marco Mattiolo from comment #18)
> Can confirm, this is resolved in plasma-mobile 5.27.1 .
> 
> Shall we keep this bug open and to be checked again on plasma-mobile 6?

I think we'll close this bug for now then, and open a new one if it is observed with Plasma 6.
Comment 20 Marco Mattiolo 2023-06-15 20:02:58 UTC
(In reply to Devin Lin from comment #19)
> 
> I think we'll close this bug for now then, and open a new one if it is
> observed with Plasma 6.

Please, during the Plasma6 general rework, do not forget to add as many logging as possible inside the code base.

It was already discussed in the past, that lack of debugging logs makes hard to understand who/when/where is breaking. I am now seeing again that "The screen locker is broken and unlocking is not possible anymore. In order to unlock it, switch to a virtual terminal ..." on pmOS&mobian on op6: of course this is not a Plasma6 fault, but it confirms the need for better debugging logs. Thank you!