Bug 381154 - Certain notifications freeze plasma
Summary: Certain notifications freeze plasma
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Notifications (show other bugs)
Version: 5.10.1
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Kai Uwe Broulik
URL:
Keywords:
: 390837 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-06-13 12:34 UTC by kyrimis
Modified: 2019-05-20 10:49 UTC (History)
6 users (show)

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


Attachments
Screen shot of the bottom right of the screen (6.39 KB, image/jpeg)
2017-06-13 12:34 UTC, kyrimis
Details
Backtrace from frozen plasmashell (3.77 KB, text/plain)
2018-04-13 08:00 UTC, kyrimis
Details
Yet another backtrace. (6.04 KB, text/plain)
2018-05-11 08:06 UTC, kyrimis
Details
kdeglobals (4.57 KB, text/plain)
2018-10-16 14:09 UTC, Aleksey Kontsevich
Details
kcmfonts (51 bytes, text/plain)
2018-10-16 14:10 UTC, Aleksey Kontsevich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kyrimis 2017-06-13 12:34:30 UTC
Created attachment 106073 [details]
Screen shot of the bottom right of the screen

Certain types of notifications cause plasmashell to use 100% of a CPU and stop responding.

I can reproduce it consistently using desktop notes, But I've also seen this happen inconsistently with various other notifications, as well.

To reproduce:

1. Create a note on the desktop, by middle clicking on it. (I use the icon view, if it is relevant.)

2. Right-click on the tool icon, and select close.

3.The note closes, and the outline of a notification (but not the actual notification) appears on the task bar. (See attachment, containing a screen shot of the bottom right of my screen.) Plasmashell is now using up 100% of a CPU.

Restarting plasmashell will unfreeze it, but the closed note will reappear. To really close the note, I have to go to the system tray settings and select not to show notifications.

This has been happening for quite some time now, both in openSUSE Tumbleweed, which I am using right now, and in the last few versions of Fedora (25 and earlier) that came with plasma 5, which I had been using before. The problem seems to be related to bug #356479, except that that bug was supposed to happen only with Intel GPUs. (I am currently using an nVidia GT 730 card with the latest driver from nVidia. The problem also used to appear with my older 9600 card and the legacy nVidia driver.)

I am using auto-hide for the task bar, but the problem persists even if I switch it to being always visible.
Comment 1 Bruno Cornec 2017-08-31 18:27:16 UTC
I'm able to reproduce this on the latest Mageia 6 Linux distro with the following conf attached:

https://paste.kde.org/peehvdosf

Similar 1. 2. and 3. steps upper gives the same result.
Comment 2 Kai Uwe Broulik 2018-01-23 15:45:59 UTC
Git commit a3c0565ace32ce91cc0c5ef2528b19fe9d8635d8 by Kai Uwe Broulik.
Committed on 23/01/2018 at 15:44.
Pushed by broulik into branch 'Plasma/5.12'.

[Notifications] Unset Heading default height

Plasma's Label has a default height based on the contentHeight of the text.
However, this interferes with QtQuick Layout's logic and might cause an infinite loop.

This can easily be triggered by sending a notification with a multi-line heading/summary.

CHANGELOG: Fixed a freeze caused by certain notifications
FIXED-IN: 5.12.0

M  +1    -0    applets/notifications/package/contents/ui/NotificationItem.qml

https://commits.kde.org/plasma-workspace/a3c0565ace32ce91cc0c5ef2528b19fe9d8635d8
Comment 3 Kai Uwe Broulik 2018-01-24 15:01:18 UTC
Git commit 5e230a6290b1ff61e54c43da48821eb2bf3192ae by Kai Uwe Broulik.
Committed on 23/01/2018 at 16:25.
Pushed by broulik into branch 'Plasma/5.12'.

[Notifications] Unset Heading default height

Plasma's Label has a default height based on the contentHeight of the text.
However, this interferes with QtQuick Layout's logic and might cause an infinite loop.

This can easily be triggered by sending a notification with a multi-line heading/summary.

CHANGELOG: Fixed a freeze caused by certain notifications
FIXED-IN: 5.12.0
(cherry picked from commit a3c0565ace32ce91cc0c5ef2528b19fe9d8635d8)

M  +1    -0    applets/notifications/package/contents/ui/NotificationItem.qml

https://commits.kde.org/plasma-workspace/5e230a6290b1ff61e54c43da48821eb2bf3192ae
Comment 4 kyrimis 2018-02-08 08:45:19 UTC
Unfortunately, the problem still remains with plasma 5.12. (Tested using OpenSUSE Tumbleweed's official 5.12 builds.)

If I understand correctly, the proposed patch consisted of a single line addition in NotificationItem.qml. I found that file in /usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationItem.qml, and verified that the line has indeed been added. I had also tried patching that file in the prerelease version (5.11.95), and that didn't fix the problem either. Given the simplicity of the patch, could it be that parts of the actual patch have not been committed?
Comment 5 Kai Uwe Broulik 2018-02-21 10:32:34 UTC
*** Bug 390837 has been marked as a duplicate of this bug. ***
Comment 6 kyrimis 2018-03-03 05:47:36 UTC
The problem is still there in plasma 5.12.2.
Comment 7 Aleksey Kontsevich 2018-03-11 23:23:34 UTC
(In reply to kyrimis from comment #6)
> The problem is still there in plasma 5.12.2.

And in Plasma 5.12.3 too.
Comment 8 kyrimis 2018-04-02 09:20:48 UTC
In plasma 5.12.4 the problem is even worse:

It used to be that disabling notifications from the task bar was enough to remove a note from the desktop. With recent versions of plasma, re-enabling notifications would make the note reappear, and to make it really disappear, I also had to log out. With 5.12.4, if I log out and log back in, the deleted note will reappear, even after a reboot. To make it completely disappear, I had to log out, kill plasma (which had been using a CPU at 100%, even with notifications disabled) manually, then edit .config/plasma-org.kde.plasma.desktop-appletsrc, and remove two entries that seemed to be related to the notes applet.
Comment 9 Aleksey Kontsevich 2018-04-02 13:51:16 UTC
(In reply to kyrimis from comment #8)
> In plasma 5.12.4 the problem is even worse:
> 
Totally confirm this!
Comment 10 David Edmundson 2018-04-12 18:12:56 UTC
Please can you provide a GDB backtrace whilst Plasma is frozen.

sudo gdb --pid `pidof plasmashell` from a terminal

followed by

"bt" then paste output here setting the bug status back to reopened
Comment 11 kyrimis 2018-04-13 08:00:11 UTC
Created attachment 111997 [details]
Backtrace from frozen plasmashell
Comment 12 kyrimis 2018-04-13 08:04:23 UTC
Added the backtrace as an attachment.

I hope this backtrace is adequate, as there were tons of warnings about missing debug symbols, and I couldn't figure out how to add them for OpenSUSE Tumbleweed: the "zypper -C" commands, suggested by gdb, did not work, and I couldn't find any plasma-related debuginfo packages.
Comment 13 Christoph Feck 2018-05-10 14:25:14 UTC
The backtrace is not useful. The debug packages you need to install are (at least):

libQtQuick5-debuginfo
libQt5Gui5-debuginfo
plasma-framework-debuginfo

I am not sure, though, if a better backtrace would help. There is no indication of either a recursion, a D-Bus interaction, or any other blocking action in the backtrace.
Comment 14 kyrimis 2018-05-11 08:06:52 UTC
Created attachment 112576 [details]
Yet another backtrace.
Comment 15 kyrimis 2018-05-11 08:16:41 UTC
I couldn't find any debuginfo packages with names remotely similar to what you describe.

In desperation, I installed every debuginfo package with "qt" or "plasma" in its name. Gdb still complained about missing debuginfo packages, but the stack trace looks very different from the previous one, so it might be worth taking a look at it.

Can you reproduce the problem in your setup? If so,you are probably in a much better position to produce a meaningful stack trace than I. If it helps, the problem was also present in Fedora, so you don't need a Tumbleweed installation, to reproduce it.
Comment 16 kyrimis 2018-05-14 16:42:21 UTC
For reasons I am too ashamed to mention, I had to start with a brand new /home directory in one of my two computers. To my surprise, the bug is no longer evident, and I'm seeing notifications that I've never seen before!

I am slowly configuring plasma the way I like it, and I'm checking every now and then to see if any setting that I make will trigger the bug.

If the bug does not appear after I'm done, I'd like to verify on my other computer that the problem does not exist when starting afresh, in which case we can close this bug with the proviso that it has been fixed for new profiles. As I'd rather not completely erase my profile, what should I delete so that I can start without any leftovers for plasma/kde/qt? Are there any specific files that I could try erasing, before erasing the entire plasma/kde/qt configuration, so that I can avoid even that?
Comment 17 Aleksey Kontsevich 2018-05-14 18:58:28 UTC
(In reply to kyrimis from comment #16)
> As I'd rather not completely erase my profile, what should I
> delete so that I can start without any leftovers for plasma/kde/qt? Are
> there any specific files that I could try erasing, before erasing the entire
> plasma/kde/qt configuration, so that I can avoid even that?

Good question for me also. I do not like to erase my home dir as it lives with me for ages. :) For a long time ago I also suspected KDE developers do not observe many bugs users have because they test new KDE's in fresh clean environment regardless old versions or settings. Also no mechanisms provided to upgrade/adjust or clean-up settings on KDE upgrades.
Comment 18 kyrimis 2018-05-16 10:10:13 UTC
After configuring plasma, notifications still work, so it looks like the problem was caused by something left over from a previous version of plasma.

I restored /home from backup and verified that the problem reappeared. I then removed .cache/*, .kde*, .config/kde*, and .config/plasma* from my home folder, rebooted, and notifications now work fine. This did not remove all of my plasma configuration, but it was enough to fix the problem, and it made re-configuring plasma quicker.

I guess this means that the problem has been fixed for new installations. For old installations the problem remains. I have kept around the removed files (apart from the files in .cache), in case anyone wants to have a look, to see if the problem can be fixed for upgraded installations, as well.
Comment 19 Aleksey Kontsevich 2018-05-16 10:33:14 UTC
(In reply to kyrimis from comment #18)
> then removed .cache/*, .kde*, .config/kde*, and .config/plasma* from my home
> folder, rebooted, and notifications now work fine. This did not remove all
> of my plasma configuration, but it was enough to fix the problem, and it
> made re-configuring plasma quicker.

Thanks, this works for me also!
Comment 20 Aleksey Kontsevich 2018-05-16 12:30:42 UTC
(In reply to Aleksey Kontsevich from comment #19)
> Thanks, this works for me also!

Ups... no! After some time just another notification forced plasma to freeze and load one CPU core to 100%.
Comment 21 kyrimis 2018-05-16 12:38:32 UTC
> Ups... no! After some time just another notification forced plasma to freeze
> and load one CPU core to 100%.

It may be significant that the order in which I did things was actually reboot, remove files, then log into plasma, not remove files then reboot.

It's still working on my end.
Comment 22 Aleksey Kontsevich 2018-05-16 12:41:47 UTC
(In reply to kyrimis from comment #21)
> It may be significant that the order in which I did things was actually
> reboot, remove files, then log into plasma, not remove files then reboot.

Do not see any difference. As I removed files, killed X and reboot, so nothing was written there.
Comment 23 Bruno Cornec 2018-05-19 13:56:49 UTC
FTR: since I rebooted after the big plasma/KDE updates from may, I have a very stable environmenet in KDE since more than 40 hours. No plasmasheel hung, nothing talink 100% CPU. So IMO, people should check again with an updated mga6 system as I think it should now work flawlessly for everybody.
Comment 24 Aleksey Kontsevich 2018-05-19 14:21:30 UTC
(In reply to Bruno Cornec from comment #23)
> FTR: since I rebooted after the big plasma/KDE updates from may, I have a
> very stable environmenet in KDE since more than 40 hours. No plasmasheel
> hung, nothing talink 100% CPU. So IMO, people should check again with an
> updated mga6 system as I think it should now work flawlessly for everybody.

What is mga6? I have latest KDE env in openSUSE Tumbleweed. Confirm, some notifications works stable. For me it freezes for Software Applet (in system tray) notification only for now.
Comment 25 Bruno Cornec 2018-05-19 14:34:39 UTC
Sorry wasn't clear :-( I'm running KDE 5.12.2 now under Mageia 6. The distribution decided earlier in may to make a massive update of KDE/Plasma to solve a lot of issues reported on the distro bugzilla.

I had very frequent freeze of plasmashell (and the eating 100% CPU) before that round of updates which I'm not seeing anymore. It seems that it's much more stable.

However, the bug mentioned in this BR and the method to make it appear is still there, I'm still able to reproduce it (with plasma-desktop-5.12.2-1.mga6 & plasma-workspace-5.12.2-1.mga6).

I has to be noted that I'm a very old user of KDE, with a home directory maintained between updates, so I'm pretty sure this is due to an old entry in a conf file somewhere that doesn't help here. No msg was clear enough however when plasmashell crashes so that I could find a way to fix it myself.
Comment 26 Aleksey Kontsevich 2018-08-11 14:03:11 UTC
Hi, when this be fixed?! I see that KDE/Plasma notifications work fine, but notifications from 3rd party applications freeze plasma - applications like:
- Riot
- Skype
- PackageKit update applet
- etc
You may easily reproduce this.
Comment 27 Aleksey Kontsevich 2018-08-11 14:06:16 UTC
P.S. If I run Dunst notifications passed to it fine and do not freeze plasma as caught and handled by Dunst - not beautiful however.
Comment 28 Aleksey Kontsevich 2018-10-14 06:23:06 UTC
Bug still exists in Plasma 5.14: when notification comes, for example from Skype, Riot or software update applet (Packagekit) Plasma freezes and starts to consume 100% core CPU. When it will be fixed???!!! Bug exists for years since 5.9, 5.10 versions till now!!!

https://bugs.kde.org/show_bug.cgi?id=390534
Comment 29 David Edmundson 2018-10-14 17:33:40 UTC
For whoever can reproduce it, What Plasma theme are you using? 
The comments about clean user setups imply it's worth looking at. We're in a resize loop - That could come from a dialog with interestingly defined margins.

Also, given it's "certain notifications" can you reproduce it with notify-send? If so exactly what?

Maybe you can capture the exact notification with dbus-monitor (note, that will contain sensitive info, be careful about bulk uploading, just the relevant message to org.freedesktop.Notification.
Comment 30 Aleksey Kontsevich 2018-10-14 17:48:34 UTC
(In reply to David Edmundson from comment #29)
> For whoever can reproduce it, What Plasma theme are you using? 
opensSUSE theme. Also reproducible with oxygen theme. Works fine with Breeze theme, however I do not want to use it - it is terrible!!!

> Also, given it's "certain notifications" can you reproduce it with
> notify-send? If so exactly what?
Yes, reproducible with openSSUE or oxygen theme.
Comment 31 Aleksey Kontsevich 2018-10-14 18:37:10 UTC
Created openSUSE bug: https://bugzilla.novell.com/show_bug.cgi?id=1111769
Comment 32 kyrimis 2018-10-14 19:02:14 UTC
Since we're discussing the possibility of themes affecting this bug, I'm using Oxygen Look and Feel, Air Desktop Theme and Oxygen Icons. I'd had the problem for a long time, as well, but after cleaning up my profile, as I described in comment #18, I've never seen it again.
Comment 33 David Edmundson 2018-10-15 08:22:11 UTC
>>can you reproduce it with
>> notify-send? If so exactly what?

>Yes, reproducible with openSSUE or oxygen theme.

Exactly what notify-send command then?
Comment 34 Aleksey Kontsevich 2018-10-15 08:35:38 UTC
(In reply to David Edmundson from comment #33)
> Exactly what notify-send command then?

Just any simple message: notify-send bla-bla-bla
Comment 35 Wolfgang Bauer 2018-10-15 11:16:42 UTC
Not sure if it helps to narrow down the problem, but it seems to be dependent on the exact font metrics.
Changing the font or font size avoids the freeze in my experience.

In particular, it doesn't happen with Plasma's default Noto 10, but it does with Arial 9 (only with the mentioned themes though, not Breeze e.g.)
Comment 36 Aleksey Kontsevich 2018-10-15 11:28:00 UTC
(In reply to Wolfgang Bauer from comment #35)
> Not sure if it helps to narrow down the problem, but it seems to be
> dependent on the exact font metrics.
> Changing the font or font size avoids the freeze in my experience.
> 
> In particular, it doesn't happen with Plasma's default Noto 10, but it does
> with Arial 9 (only with the mentioned themes though, not Breeze e.g.)

Yes, using Noto - is a workaround - no freezes. Weird! :) Not so beautiful as Liberation Sans, good to have this fixed any way.
Comment 37 Aleksey Kontsevich 2018-10-16 06:58:52 UTC
Nimbus Sans L font works fine also, will use it for now.
Comment 38 kyrimis 2018-10-16 08:29:08 UTC
I tried the reverse, which may help reproduce the problem:

In a working system (Oxygen Look and Feel, Air Desktop Theme and Oxygen Icons, Noto fonts) I changed the General font from Noto Sans 8 to Arial 8, and the problem appeared immediately. As soon as I hit "Apply", Plasma tried to show a notification, and it froze.

I suppose that when I reset my profile, I didn't change the fonts, so this is why I no longer see the problem.
Comment 39 Aleksey Kontsevich 2018-10-16 09:25:06 UTC
(In reply to kyrimis from comment #38)
> I suppose that when I reset my profile, I didn't change the fonts, so this
> is why I no longer see the problem.
Yes :) And I always change font to Liberation Sans so had it every time and resetting did not help me :)
Comment 40 David Edmundson 2018-10-16 10:07:25 UTC
@aleksey

> good to have this fixed any way.

To be clear the goal here isn't to help you find a workaround, but to help me break mine! 

I've tried oxygen theme, liberation sans 8, Arial 8

Please can you post your ~/.config/kdeglobals 

Also can someone who can reproduce this please try with a more modern Qt. Last backtrace I've seen was with 5.10
Comment 41 Wolfgang Bauer 2018-10-16 12:00:32 UTC
(In reply to David Edmundson from comment #40)
> I've tried oxygen theme, liberation sans 8, Arial 8

It happens with Arial 9 here, but not with Arial 8 (or 10)...

> Also can someone who can reproduce this please try with a more modern Qt.

I'm using Qt 5.11.2, and it's still reproducible.
Comment 42 David Edmundson 2018-10-16 12:16:16 UTC
Still nothing :(

Can I have the full kdeglobals and kcmfonts please.
Comment 43 Aleksey Kontsevich 2018-10-16 13:47:01 UTC
(In reply to David Edmundson from comment #40)
> @aleksey
> > good to have this fixed any way.
> 
> To be clear the goal here isn't to help you find a workaround, but to help
> me break mine! 
Ok, sure.
 
> I've tried oxygen theme, liberation sans 8, Arial 8
I have liberation sans 16 on Low DPI screen 42", 52 DPI, Full HD

> Please can you post your ~/.config/kdeglobals 
Ok, will send in attachment.

> Also can someone who can reproduce this please try with a more modern Qt.
> Last backtrace I've seen was with 5.10
I have the latest - 5.11.2
Comment 44 Aleksey Kontsevich 2018-10-16 14:09:33 UTC
Created attachment 115677 [details]
kdeglobals
Comment 45 Aleksey Kontsevich 2018-10-16 14:10:36 UTC
Created attachment 115678 [details]
kcmfonts
Comment 46 Wolfgang Bauer 2019-05-20 09:31:27 UTC
I cannot reproduce the freezes with Plasma 5.16 beta (5.15.90) anymore.

5.15.5 still froze reliably with Arial 9, but not anymore since I installed the beta (no other changes to the system).

It probably got fixed as a side effect of the notification rewrite/redesign, I suppose...
Comment 47 David Edmundson 2019-05-20 10:49:13 UTC
Probably. It now uses layouts which are less prone to a binding mess.

Please reopen if it's seen on 5.16