Bug 466771 - Some windows are painted black on X11, processes freeze
Summary: Some windows are painted black on X11, processes freeze
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 5.27.0
Platform: Fedora RPMs Linux
: NOR critical
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
: 466317 466774 471011 471962 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-03-03 15:45 UTC by Stephen
Modified: 2024-03-18 04:18 UTC (History)
17 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
journald logs from the incident (2.35 MB, text/x-log)
2023-03-30 19:14 UTC, Douglas Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen 2023-03-03 15:45:57 UTC
KDE starts beautifully, then eventually decays to visible un-usability ...

***
After a reboot KDE/Plasma runs beautifully.  However after a certain amount of time,
usually 3-5 days, windows "appear" to be (re)painted completely black, or are not painted
at all (it's hard to tell since it happens so fast).  (In X, everything is a window of some type;
menus, window contents (I haven't seen decorations do this behaviour yet, but have seen it
with all components of the task bar.))  When this happens the following are sometimes TRUE:
1. when resizing is available, sometimes resizing the window provides visibility to its
    painted contents (this is hit or miss and the contents will flash correctly or not);
2. sometimes iconifing the window, or closing and re-opening the window will allow visibility
   to its painted contents; and likewise dismissing and reengaging a menu (window) will
   allow the menu to be visibility painted.
3. This happens across all applications, even programs written in basic X (e.g. /usr/bin/xv) to
   wildly complex programs like firefox and everything in between.
My workspace consists of 4 virtual desktops and switching to another desktop and back has
no effect on windows painted as "black."
> I really don't know if the window is "properly" rendered then over-painted as the process
   is too quick for the eye ...?
When it happens, I have to exit the workspace and init S/control-D to reload everything back
to "clean the slate," but this is temporary and eventually the cycle repeats.
I had hoped 5.27 would have cleaned this up, but it's still there.
***

STEPS TO REPRODUCE:
1. Run the workspace for several days including cycles of screen locking, etc.
2. Use the workspace normally (I run several konsoles, firefox, thunderbird, and
    a few other applications on and off).

OBSERVED RESULT
Eventually, some windows will be painted as "black."  Kinda happens infrequently
at first, then becomes more and more common as time progresses.

EXPECTED RESULT
I'm used to uptimes measured in the years and expect no less from my workspace.
I upgraded from Fedora 34 KDE (exactly the same hardware) and have never seen this happen.

HACKS TRIED:
- most of the kernels released under Fedora 37
- NVIDIA-Linux-x86_64-515.76.run,
  NVIDIA-Linux-x86_64-520.56.06.run,
  NVIDIA-Linux-x86_64-525.60.11.run, and
  NVIDIA-Linux-x86_64-525.89.02.run.
- I did NOT think to disable desktop effects (I will if it happens again) to see what happens.

SOFTWARE/OS VERSIONS:
  Operating System: Fedora Linux 37
  KDE Plasma Version: 5.27.0
  KDE Frameworks Version: 5.103.0
  Qt Version: 5.15.8
  Kernel Version: 6.1.12-200.fc37.x86_64 (64-bit)
  Graphics Platform: X11
  Processors: 16 × AMD Ryzen 7 1700 Eight-Core Processor
  Memory: 62.7 GiB of RAM
  Graphics Processor: NVIDIA GeForce GTX 1060 3GB/PCIe/SSE2

ADDITIONAL INFORMATION
  Appearance - Breeze Dark
  Application style - Breeze
  Plasma Style - Infinity-plasma
  Windows decorations - Breeze
  DESKTOP EFFECTS:
    Magnifier, Mouse Mark, Translucency, Wobbly Windows
    Virtual Desktop Switching - slide w/desktop background DISABLEd
  WINDOW BEHAVIOUR:
    Focus under mouse w/raise on hover after 750ms
    4x Virtual desktops on TWO physical monitors

xwininfo: Window id: 0x1c00011 "Desktop — Plasma"

  Absolute upper-left X:  2560
  Absolute upper-left Y:  0
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 2560
  Height: 1440
  Depth: 32
  Visual: 0x7a
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x1c00010 (not installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +2560+0  -0+0  -0-0  +2560-0
  -geometry 2560x1440-0+0
Comment 1 Stephen 2023-03-03 19:10:39 UTC
Immediately after I filed this report, it started happening again.
I tried toggling the desktop effects (Alt+Shift+F12) and its seems to have cleared it up ...
Comment 2 Stephen 2023-03-04 16:32:37 UTC
toggling the desktop effects...

After toggling the desktop effects, it clears up the painting issue, but only briefly.
Between minutes to maybe an hour or two.  It's a temporary hack to return the
desktop's usability, but whatever's causing issue is not corrected entirely (resetting
via init S or rebooting resets things to the 2-3 days state before the issue appears).
Comment 3 Fushan Wen 2023-03-04 17:18:47 UTC
Can reproduce in 5.27.1 with amdgpu
Comment 4 Fushan Wen 2023-03-04 17:27:12 UTC
*** Bug 466774 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2023-03-06 23:16:56 UTC
Likely a driver bug somewhere.
Comment 6 Félim Whiteley 2023-03-08 08:50:46 UTC
I think this is a regression. I've been using Plasma since forever and I only started seeing this since switching to Plasma 5.27. I tried reverting to an older kernel (5.15.0) in neon and the error persisted. Main kernel is now 5.19.0.
Comment 7 Félim Whiteley 2023-03-08 08:53:27 UTC
I should add the 5.15 kernel was what I was using on 5.26 with no issue.
Comment 8 nttkde 2023-03-08 13:36:57 UTC
Just to confirm, I started noticing windows/menus/tooltips sometimes opening black in Plasma 5.26 and still happens in 5.27.
Minimizing the affected app or reopening the menu seems to fix it.
Specifically I've seen the bug to happen when a minimized window is maximized/menu is opened/tooltip pops up; I don't at least remember seeing an already-open window go suddenly black.

Back then I wondered if it could be some remnant of bug #456511 that got fixed in 5.26 but probably not related.

(KDE Neon User Edition, X11, amdgpu, Radeon RX Vega 56)
Comment 9 Félim Whiteley 2023-03-22 13:52:50 UTC
Apologies for the late reply (work trip over weekend) but update Neon to 5.27.3 and unfortunately this is still an issue.
Comment 10 Félim Whiteley 2023-03-22 15:48:21 UTC
Just in case it isn't clear, for me, only way to get system back is a logout/restart, notifications turn to black boxes, but the Kicker/systray is un-clickable. It doesn't update as I close apps down. At the moment this is a restart every day.
Comment 11 Aleix Pol 2023-03-22 15:55:15 UTC
Updating the title and raising the priority since it seems the symptom is graver than it reads at first.
Comment 12 Douglas Silva 2023-03-30 19:14:14 UTC
Created attachment 157729 [details]
journald logs from the incident

Operating System: Kubuntu 22.10
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 5.19.0-38-generic (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i3-10100 CPU @ 3.60GHz
Memory: 15,6 GiB of RAM
Graphics Processor: AMD Radeon RX 6600
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B460MDS3H
Comment 13 Fushan Wen 2023-04-02 00:49:58 UTC
Cannot reproduce recently. I think a Mesa update fixed it.
Comment 14 Félim Whiteley 2023-04-04 10:44:42 UTC
KDE Neon latest update still seeing this, just had it this morning. Effectively I need to log out and back in every 24hrs as once it starts it becomes unusable.
Comment 15 Eric S 2023-04-29 09:09:12 UTC
I think I'm seeing the same thing (openSUSE Tumbleweed), except that I can make the problem go away by closing a lot of things. Typically what I close to fix it, at least temporarily is Firefox. I am someone who tends to have a pathological number of browser tabs and windows open so this closes a lot. Sometimes I can make the problem go away for a shorter amount of time by closing some other large application instead.

It feels to me as if there were some system resource like window handles or some such that gets exhausted, something that the system is not cleaning up for reuse quickly enough. I'm not saying it must be that, but that's the feel of the behavior.
Comment 16 Félim Whiteley 2023-05-26 11:48:18 UTC
This appears to be fixed for me since the Mesa updates on Neon on 2023-05-24, something in here fixed. 

Upgrade: libgles2-mesa-dev:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libglx-mesa0:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libglx-mesa0:i386 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libgbm1:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libgbm1:i386 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2),libgbm-dev:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libxatracker2:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), mesa-va-drivers:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), mesa-va-drivers:i386 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libgl1-mesa-dev:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libgl1-mesa-dri:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libgl1-mesa-dri:i386 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libegl1-mesa-dev:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), mesa-vulkan-drivers:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), mesa-vulkan-drivers:i386 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libglapi-mesa:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libglapi-mesa:i386 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libegl-mesa0:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), libegl-mesa0:i386 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2), mesa-vdpau-drivers:amd64 (22.2.5-0ubuntu0.1~22.04.1, 22.2.5-0ubuntu0.1~22.04.2)
Comment 17 nttkde 2023-05-28 08:33:16 UTC
Hmm, I have an up-to-date KDE Neon and saw a black window just yesterday. Doesn't seem to be fixed here.
Comment 18 David Edmundson 2023-06-12 21:46:17 UTC
*** Bug 466317 has been marked as a duplicate of this bug. ***
Comment 19 nttkde 2023-06-26 16:10:30 UTC Comment hidden (spam)
Comment 20 e.insafutdinov 2023-07-08 21:27:58 UTC
*** Bug 471962 has been marked as a duplicate of this bug. ***
Comment 21 e.insafutdinov 2023-07-08 21:32:34 UTC
This is still a problem on OpenSUSE Tumbleweed using the latest NVIDIA drivers 535.54.03 and KDE Plasma 5.27.6 X11.
Comment 22 Nate Graham 2023-07-25 19:13:26 UTC
*** Bug 471011 has been marked as a duplicate of this bug. ***
Comment 23 Eric S 2023-08-16 02:14:28 UTC
Could any plasma developer comment as to whether what I said in my previous comment (#15) makes any sense? Tthat is, whether there is any sort of windowing resource which the system can "run out" of? 

The behavior I see effects not just windows but thing like menus and tool tips. Sometimes I just have to open and close a menu repeatedly to get it to paint, as if some of this resource which the system ran out of eventually got garbage collected (or something like that).
Comment 24 Nate Graham 2023-10-07 02:43:56 UTC
Could be inodes or inotify watches. Might wanna check up on those.

Lowering priority since we haven't gotten any new reports in a while and no developer has been able to reproduce it yet.
Comment 25 Fushan Wen 2023-10-07 02:47:17 UTC
I can still see frozen windows sometimes, but they are all Firefox windows.
Comment 26 kx 2023-10-07 08:28:52 UTC
I'm also not able to replicate it anymore. Not sure if it's entirely resolved, but I haven't encountered it anymore since I reported it. Might've been related to nvidia / mesa graphics.
Comment 27 Eric S 2023-10-07 14:01:01 UTC
I still see it (using 5.27.8). Possibly less often / it takes longer to start occurring. I do have nvidia.
Comment 28 Marcin P 2023-10-29 11:09:39 UTC
I've been experiencing this bug ever since switching to KDE about a year ago. I'm pretty sure it's not memory exhaustion, since both my RAM and VRAM rarely cross 50% used. Perhaps it's related to what apps are being run. I have Firefox, another Firefox (Librewolf), Chromium, Jetbrains IDEA, Zim the desktop wiki and Yakuake running 24/7. Black windows start appearing every couple of days or weeks, I have a `kwin_x11 --replace` shortcut on my desktop for this reason. To be noted that after restarting kwin this way all Firefox windows are filled with garbage or pure transparency until they repaint.

Currently reproducible on:

Operating System: Gentoo
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.5
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 5800X3D 8-Core Processor
Memory: 125,7 GiB of RAM
Graphics Processor: AMD Radeon RX 5700 8GB
Comment 29 mirh 2024-01-22 01:15:24 UTC
This is still a thing btw, and I can also report that locking has nothing to do with anything (I have everything disabled here, but screen dimming and sleep).

Operating System: Manjaro Linux 
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.113.0
Qt Version: 5.15.12
Kernel Version: 6.6.10-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 6 × Intel® Core™ i5-9600K CPU @ 3.70GHz
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 2080 SUPER/PCIe/SSE2 (545.29.06)
Comment 30 fanyo@me.com 2024-03-10 03:43:19 UTC
A few days of bliss and then blackouts. Using Slackware, updating often, so I'm at Plasma Version 5.27.10, Frameworks Version 5.115.0, Qt Version 5.15.12, and Kernel Version 6.6.20 (64-bit), Graphics Platform X11. I first noticed the issue at kernel version roughly 6.1.15. Stephen's description of the issue mirrors my symptoms exactly.

1. I have discovered is that even though the pointer doesn't change when over buttons in the blacked out window, the button will still respond to a click. The window is not inactive, just unpainted. 

2. If the graphics can be recovered by resizing the affected window, the window will often black out again once it is sized back to the original "black out" size. Something is remembering the blacked out state of the window in its original blacked out size. If the window is resized enough, it seems to force a more basic repainting of the window and it appears normally.

3. It seems to affect pop-ups, program windows, terminal windows, pop-outs, drop downs, panels, almost everything. The one window/panel that has never appeared blacked out is the drop down when you enter Edit Mode (Alt-D, E).

HTH