Bug 462399 - [CRASH/LOCKUP] ScrollView in notification applet causes freeze when popup is sized exactly right to oscillate between scrollable and non-scrollable states
Summary: [CRASH/LOCKUP] ScrollView in notification applet causes freeze when popup is ...
Status: RESOLVED DUPLICATE of bug 460895
Alias: None
Product: plasmashell
Classification: Plasma
Component: Notifications (other bugs)
Version First Reported In: master
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-29 15:35 UTC by Naxdy
Modified: 2024-06-03 14:39 UTC (History)
4 users (show)

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


Attachments
demo of the bug (2.41 MB, video/mp4)
2022-11-29 15:35 UTC, Naxdy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Naxdy 2022-11-29 15:35:31 UTC
Created attachment 154140 [details]
demo of the bug

SUMMARY

Since the ScrollBar component does not occupy any physical space when hidden, notifications occupy a little more space. Conversely, when the ScrollBar is visible, notifications get shrunk down by a bit.

Although this is intended behavior, this causes the component to enter an infinite loop whenever the notification applet is at a certain size where notifications without a ScrollBar occupy enough space to warrant a ScrollBar, but once the ScrollBar is present, shrink down to a size to where it's no longer needed.

We then rapidly go back and forth between big(ger) notifs and no ScrollBar (but overflow) and smal(ler) notifs and a ScrollBar (but no overflow), causing the entire plasmashell to lock up.


STEPS TO REPRODUCE
0. Clear your notification history
1. Take two screenshots with spectacle
2. Open the notification applet twice (so that the "show more" button is visible)
3. Open the notification history
4. Slowly increase its vertical size

OBSERVED RESULT
Plasmashell locks up and becomes entirely unresponsive


EXPECTED RESULT
Plasmashell does NOT lock up
Comment 1 Nate Graham 2023-04-27 23:37:58 UTC
The scrollview has been changed a lot for Plasma 5.27; can you try again with that release?
Comment 2 Naxdy 2023-04-27 23:41:42 UTC
Yep, still happens. The problem is that some notification elements (like images, e.g. when taking a screenshot) change their vertical size in conjunction with their horizontal size.

Images are easy to use as an example: If an image is supposed to preserve its aspect ratio, it will also shrink vertically if it is supposed to shrink horizontally (-> due to scrollbar appearing). Now, the notification is no longer too tall for the view, and the scrollbar is not needed. The image now expands horizontally since the scrollbar is gone, which also causes it to expand vertically (thus requiring a scrollbar again), and this dance continues ad infinitum.
Comment 3 Nate Graham 2023-04-28 16:41:40 UTC
Ah that makes sense. Can reproduce that.
Comment 4 Akseli Lahtinen 2024-05-30 11:13:11 UTC
Seems this is still reproducable in Plasma 6.

Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.80
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.0
Kernel Version: 6.8.10-300.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 6600
Comment 5 Fushan Wen 2024-05-30 12:00:21 UTC

*** This bug has been marked as a duplicate of bug 460895 ***
Comment 6 Naxdy 2024-05-30 12:03:59 UTC
@Fushan, are you sure this is the same as 460895 ?
Comment 7 Fushan Wen 2024-05-30 12:28:56 UTC
Mostly, because I worked around the bug.
Comment 8 Bug Janitor Service 2024-06-03 11:07:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4398
Comment 9 Akseli Lahtinen 2024-06-03 13:28:35 UTC
Git commit 1cfa672b8b81d17d2f0d469d31395a94b18cb62a by Akseli Lahtinen.
Committed on 03/06/2024 at 13:28.
Pushed by akselmo into branch 'master'.

notifications/ThumbnailStrip.qml: Set thumbnail to fixed size

Setting the `implicitHeight` of a thumbnail to a fixed size
fixes freezing with plasmashell, where it was constantly
calculating a new size for the image, which in turn made
the scrollbar calculate a new size for itself, thus freezing
plasmashell.
Related: bug 460895

M  +2    -3    applets/notifications/package/contents/ui/ThumbnailStrip.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/1cfa672b8b81d17d2f0d469d31395a94b18cb62a
Comment 10 Bug Janitor Service 2024-06-03 13:29:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4400
Comment 11 Akseli Lahtinen 2024-06-03 14:39:00 UTC
Git commit 5bcad43e21b63cd83ad37eb35ec359103f3acd46 by Akseli Lahtinen.
Committed on 03/06/2024 at 13:28.
Pushed by akselmo into branch 'Plasma/6.1'.

notifications/ThumbnailStrip.qml: Set thumbnail to fixed size

Setting the `implicitHeight` of a thumbnail to a fixed size
fixes freezing with plasmashell, where it was constantly
calculating a new size for the image, which in turn made
the scrollbar calculate a new size for itself, thus freezing
plasmashell.
Related: bug 460895


(cherry picked from commit 1cfa672b8b81d17d2f0d469d31395a94b18cb62a)

83c7b84e notifications/ThumbnailStrip.qml: Set thumbnail to fixed size

Co-authored-by: Akseli Lahtinen <akselmo@akselmo.dev>

M  +2    -3    applets/notifications/package/contents/ui/ThumbnailStrip.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/5bcad43e21b63cd83ad37eb35ec359103f3acd46