Bug 466914 - Kded5 crash when switchin between monitor and tv
Summary: Kded5 crash when switchin between monitor and tv
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: OSD and Plasma applet (show other bugs)
Version: 5.27.2
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-05 20:59 UTC by Bucior
Modified: 2023-03-28 14:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.4


Attachments
kded5 crash (33.57 KB, text/plain)
2023-03-05 20:59 UTC, Bucior
Details
kscreen crash (19.85 KB, text/plain)
2023-03-09 17:46 UTC, Bucior
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bucior 2023-03-05 20:59:22 UTC
Created attachment 157024 [details]
kded5 crash

I have one monitor connected via DP and tv connected via HDMI, only one is used at the same time, when i switch to tv as main display and then try to switch back to monitor osd (super + p) is not working


Operating System: Arch Linux 
KDE Plasma Version: 5.27.2
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.2.2-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 31.2 GiB of RAM
Graphics Processor: AMD Radeon RX 6800 XT
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: X570S AORUS ELITE AX
System Version: -CF
Comment 1 Nate Graham 2023-03-08 04:54:12 UTC
I genuinely cannot tell which KDED module is crashing based on the backtrace. I see a lot of glib and GObject function calls though... Luca, do you think it could be the GTK settings daemon?
Comment 2 Luca Bacci 2023-03-08 12:58:59 UTC
Yeah, may be. I'm gonna take a look at this!
Comment 3 Luca Bacci 2023-03-08 15:38:01 UTC
This seems to be an issue in the dconf GSettingsBackend. I have opened an issue at https://gitlab.gnome.org/GNOME/dconf/-/issues/79 for now, but will investigate more!
Comment 4 Bucior 2023-03-09 17:46:16 UTC
Created attachment 157154 [details]
kscreen crash

I also had this crash, just switching monitors, previous i was using tv more i will try to reproduce once more
Comment 5 Bug Janitor Service 2023-03-24 03:45:37 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Luca Bacci 2023-03-24 13:20:47 UTC
Thanks for the report, Bucior!

Seems to be a different issue according to the stacktrace, most probably in KScreen. The stacktrace is very useful! :)

KScreen::Osd keeps a reference to a LibKScreen::Output. When Osd instances are destroyed, their references to LibKScreen::Output instances are dropped, and that can cause their immediate destruction.

Osd also subscribes as an observeer for its member LibKScreen::Output's destruction: https://invent.kde.org/plasma/kscreen/-/blob/v5.27.2/osd/osd.cpp#L33. The handler method is Osd::hideOsd() is executed, but at that time Osd is already in the process of being destructed...

As for fixes, we may ::disconnect() in Osd's destructor. However I don't get why Osd observes its member object for destruction if it keeps a reference to it?
Comment 7 Luca Bacci 2023-03-24 13:37:17 UTC
Observing the member output object for destruction was done as part of https://invent.kde.org/plasma/kscreen/-/commit/071282f545, which sends to https://phabricator.kde.org/D9414
Comment 8 Bug Janitor Service 2023-03-24 13:54:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kscreen/-/merge_requests/199
Comment 9 Luca Bacci 2023-03-27 21:12:14 UTC
Git commit 8f5fc740065e38dd37cbd966a5abebfaeccaa495 by Luca Bacci.
Committed on 26/03/2023 at 10:18.
Pushed by davidedmundson into branch 'master'.

OSD: Do not connect to member QObject's destroyed signal

We're keeping a strong reference to it

M  +0    -1    osd/osd.cpp

https://invent.kde.org/plasma/kscreen/commit/8f5fc740065e38dd37cbd966a5abebfaeccaa495
Comment 10 Nate Graham 2023-03-28 14:41:00 UTC
Git commit 7a5e79edf6d12e1da6377a277a905d47424d688c by Nate Graham, on behalf of Luca Bacci.
Committed on 28/03/2023 at 14:40.
Pushed by ngraham into branch 'Plasma/5.27'.

OSD: Do not connect to member QObject's destroyed signal

We're keeping a strong reference to it


(cherry picked from commit 8f5fc740065e38dd37cbd966a5abebfaeccaa495)

M  +0    -1    osd/osd.cpp

https://invent.kde.org/plasma/kscreen/commit/7a5e79edf6d12e1da6377a277a905d47424d688c