Bug 450050 - Desktop functionality degrades after a notification can't be shown (DBus connection instability?)
Summary: Desktop functionality degrades after a notification can't be shown (DBus conn...
Status: RESOLVED UPSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: 5.25.2
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-11 22:05 UTC by torokati44
Modified: 2023-04-27 21:26 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screenshot of Bustle erroring out when the glitch happens (122.32 KB, image/png)
2022-02-23 22:41 UTC, torokati44
Details
screenshot of corrupted-looking messages on the Session bus after the glitch (32.15 KB, image/png)
2022-02-23 22:42 UTC, torokati44
Details

Note You need to log in before you can comment on or make changes to this bug.
Description torokati44 2022-02-11 22:05:19 UTC
SUMMARY

From time to time, when Firefox tries to show a desktop notification about an incoming email in an open GMail tab, it is unable to do so, and instead, gets locked up for several seconds; then either crashes, or causes the whole desktop to enter a strangely degraded state.

STEPS TO REPRODUCE

1. Have GMail open in a Firefox tab
2. Receive a desktop notification about an incoming email
3. Repeat sufficiently many times in different conditions - it does not occur every time

I think GMail is most likely not relevant, and any "Notification API Tester" application could potentially trigger this.
Maybe Firefox isn't important either
I just happen to always have this happen in these circumstances - and I noticed the correlation because my phone also pops up the notification at the exact same time these freezes happen.

OBSERVED RESULT

Firefox is unable to show the desktop notification, instead, becomes completely unresponsive for several seconds, and sometimes crashes after a while. If it doesn't, these effects (the degraded state) come into play:

 - Notifications about any further incoming mail are not shown as the usual notification popup, instead, as a fallback within Firefox (I suppose) - in proper popup windows, with frames and taskbar entries, and with completely different appearance than my system theme, and in random positions on the screen, with a Firefox icon.
- System tray icons for applications (such as Discord, Steam, KTorrent) are no longer responding to selecting any item of their context menus; nor does the set of visible icons change anymore when I open or close applications that normally have icons in the system tray.
- The Shut Down/Restart/Sleep options in the Application Launcher no longer do anything.
- The volume up/down keys on my keyboard no longer do anything.
- The panel otherwise remains mostly operational: switching between windows works, the list of windows is up to date, launching applications from the panel works, and interacting with other widgets and non-application icons on the system tray are also operational, such as those for volume adjustment or network management.

EXPECTED RESULT

All notifications from all applications are shown normally, and no element of the degraded state described above is ever realized.

SOFTWARE/OS VERSIONS
Linux: Fedora 35 KDE
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION

Not much at the moment, but I am happy to provide any logs or config files when instructed on how to make or retrieve them.
I have a habit of running plasmashell from a terminal window, so that I can quickly kill and restart it in case this happens again, and I used to see some DBus-related error messages in the degraded state - also, the missing interactivity between applications hints at maybe the server crashing, or plasma's connection being dropped?
Comment 1 David Edmundson 2022-02-14 23:24:23 UTC
If firefox gets locked up that is a firefox bug and needs to be reported there. That's not on us.

You can capture a log with dbus-monitor or bustle (for a UI) when the situation occurs.

>or causes the whole desktop to enter a strangely degraded state.

can you expand on what this entails. You said the panel is behaving throughout.

Please also confirm you're using plasmashell for notifcations not some third party notification tool.
Comment 2 torokati44 2022-02-15 20:54:46 UTC
(In reply to David Edmundson from comment #1)
> If firefox gets locked up that is a firefox bug and needs to be reported
> there. That's not on us.

Firefox looks more like it is completely blocked waiting for something external. No obvious resource bottleneck, such as CPU usage or memory consumption, disk operations, etc. And it's always when trying to show a notification - now that I think about it, it doesn't even have to be about an incoming mail, it could be about a new YouTube upload, or something else.
If I leave it alone, after several seconds, sometimes it resumes operation, then immediately shows the notification that triggered the glitch, but not in plasmashell, in its own little window instead. And after this, all further notifications are also shown using the internal fallback (as described), instead of by plasmashell.

I was in fact not sure at all where to start reporting this: to dbus-broker, Firefox, the Fedora project, or here.
It seemed like a fairly complex issue with all these pieces not properly cooperating.
Sorry if it ends up not being the appropriate place, I just experienced most symptoms to be affecting Plasma.

> You can capture a log with dbus-monitor or bustle (for a UI) when the
> situation occurs.

Thanks for the tip, Bustle looks really good! I'm going to try catching this occurrence with it, and will report back if I managed to do so.

> >or causes the whole desktop to enter a strangely degraded state.
> 
> can you expand on what this entails. You said the panel is behaving
> throughout.

This is what the bullet points under the "OBSERVED RESULT" section describe. Overall the system is sort of usable, but a lot of small (inter-application) functionality stops working as it is supposed to, or as it did until that.

> Please also confirm you're using plasmashell for notifcations not some third
> party notification tool.

I am not using anything out of the ordinary for notifications, just a plain Fedora KDE installation - granted, I have been updating it through a fair few major releases, I think I originally installed it as Fedora 28.
I also have KDE Connect running, but it is not currently set up to mirror notifications from my phone to my desktop (nor the other way around), so I don't think that would interfere.
Comment 3 torokati44 2022-02-23 22:40:58 UTC
I think I'm a bit closer to a semi-reliable reproduction method.
The problem is, it only works on my main system, the one affected by this issue - but not on my laptop, which is very similar software-wise.

Anyway, the steps I devised for triggering the glitch:
1.: Open https://www.bennish.net/web-notifications.html in Firefox (on Wayland, which may or may not matter), and make sure the page is a completely fresh tab, by pressing Ctrl+F5
2.: Click the "Authorize" button, and grant notification permissions to the site
3.: Verify that the notifications work by pressing the "Show" button a few times, then wait for all notifications to disappear
4.: Open the Web Developer Console on the page, and enter this: `setInterval(notify.show, 1000)`. This might rely on the fact that the default timeout is a whole number of seconds, so there can be race conditions between queueing a new notification, and receiving callback about it being shown, and an older one closing.
5.: Don't hover over any of the notifications and don't close them, so this potential race condition is kept going
6.: Open LibreOffice Writer, and copy a few lines of text from the page in Firefox into a new document in Writer (yes, for some reason, this also seems to be needed)
7.: Wait for a few more notifications to come and go, and not much later, Firefox should lock up, maybe crash, and plasmashell is now in the mentioned degraded state.

If Bustle is recording the Session Bus in the meantime, it errors out and stops recording (see attached screenshot).
Then, if I start a new Bustle recording, I see some corrupted-looking messages going around on the Session bus (see another attached screenshot).
Also, in this degraded state, if I enter `notify-send test` to a terminal, it does nothing, but doesn't return either - it's just blocked indefinitely.
Comment 4 torokati44 2022-02-23 22:41:50 UTC
Created attachment 147085 [details]
screenshot of Bustle erroring out when the glitch happens
Comment 5 torokati44 2022-02-23 22:42:43 UTC
Created attachment 147086 [details]
screenshot of corrupted-looking messages on the Session bus after the glitch
Comment 6 torokati44 2022-02-23 22:50:07 UTC
One more thing: After Firefox crashes, then I restart it, I see this message printed in the console in which plasmashell is running:
`kf.kio.gui: Failed to register new cgroup: "app-firefox\\x2dwayland-e15c52a3550c4762a2160b5e11b424cc.scope" "org.freedesktop.DBus.Error.Disconnected" "Not connected to D-Bus server"`

And about the degraded state: Pressing the volume control keys, or the Super/Meta key does send a `globalShortcutPressed` or `activateLauncherMenu` (respectively) message on the Session bus. I can see them in Bustle, but plasmashell doesn't react by adjusting the volume and showing the OSD, or by popping up the application menu.
Comment 7 torokati44 2022-02-26 17:13:43 UTC
FYI I cross-posted this bug as a dbus-broker issue: https://github.com/bus1/dbus-broker/issues/284
Comment 8 Bug Janitor Service 2022-03-13 04:35:17 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 9 Bug Janitor Service 2022-03-28 04:35:33 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now 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

Thank you for helping us make KDE software even better for everyone!
Comment 10 torokati44 2022-07-02 20:51:56 UTC
I can still easily reproduce this with Plasma 5.24.5 on the affected machine using the steps in Comment 3.
Waiting for 5.25 to be deployed in Fedora 36 so I can test that too.
Comment 11 torokati44 2022-07-06 19:43:12 UTC
Plasma just got updated to 5.25.2 in Fedora, and the issue persists unchanged.
I am willing and glad to provide any and all relevant information I can - even interactively in a live chat or screen sharing session, or similar - to any developer interested in getting to the end of this.
Comment 12 Nate Graham 2023-04-27 21:26:34 UTC
I don't see how this could be a KDE issue. It could be a Firefox issue or a DBus server issue, but it seems extremely unlikely that any KDE code is to blame here. let's follow up on the upstream reports and if they bounce back here, we can re-open the bug.