Bug 468159 - After waking from sleep with complex triple-monitor setup, middle screen's desktop has the wrong size and windows leave ghost trails
Summary: After waking from sleep with complex triple-monitor setup, middle screen's de...
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: 5.27.9
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen, wayland
: 464674 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-04-05 00:18 UTC by Beyley Thomas
Modified: 2024-05-22 13:11 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Video of after the problem starts (2.44 MB, video/mp4)
2023-04-05 00:18 UTC, Beyley Thomas
Details
kscreen-doctor, wayland-info, journalctl (169.72 KB, text/plain)
2023-12-01 15:23 UTC, 13k
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Beyley Thomas 2023-04-05 00:18:52 UTC
Created attachment 157856 [details]
Video of after the problem starts

SUMMARY
The desktop (eg. the background and icons) will resize themselves to a 1920x1080 window when my computer comes out of sleep, leaving an empty void, this only happens to my main monitor (which is 3440x1440)
This does not happen consistently, it only happens some of the times after my computer wakes up from sleep

STEPS TO REPRODUCE
1. Put computer to sleep, wait some amount of time
2. Wake computer up
3. Login, and try to interact with the desktop

OBSERVED RESULT
Desktop will immediately resize itself upon interaction, and the empty part of the display never gets cleared, so things have a ghost

EXPECTED RESULT
Desktop acts as intended, at my full monitor resolution

SOFTWARE/OS VERSIONS
Linux/KDE kernel 6.2.8-zen1-1-zen (64 bit)
(available in About System)
KDE Plasma Version: 5.27.3
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
This *may* be caused by it getting confused when a new monitor is connected (my TV [1920x1080] takes a second to be recognized by my computer after waking up from sleep), but i was unable to replicate this by just unplugging and replugging in my monitors at random, and it doesnt happen *every* time i put my computer in and out of sleep
(computer info in the attached video)

(the titlebars being wonky has already been fixed in 5.27.4, but that isnt out on the arch repos yet)
Comment 1 Nate Graham 2023-04-05 15:23:31 UTC
How bizarre. When this happens, can you paste the output of `kscreen-doctor -o`?
Comment 2 Beyley Thomas 2023-04-06 00:28:29 UTC
(In reply to Nate Graham from comment #1)
> How bizarre. When this happens, can you paste the output of `kscreen-doctor
> -o`?

Output: 1 DP-4 enabled connected priority 2 DisplayPort Modes: 0:1280x1024@60! 1:1280x1024@75* 2:1280x800@60 3:1152x864@75 4:1280x720@60 5:1024x768@75 6:1024x768@60 7:800x600@75 8:800x600@60 9:640x480@75 10:640x480@60 11:720x400@70 12:1280x1024@60 13:1024x768@60 14:1280x800@60 15:1280x720@60 Geometry: 5360,0 1024x1280 Scale: 1 Rotation: 2 Overscan: 0 Vrr: incapable RgbRange: unknown
Output: 2 HDMI-A-5 enabled connected priority 3 HDMI Modes: 0:1920x1080@60*! 1:1920x1080@60 2:1920x1080@60 3:1920x1080@30 4:1920x1080@30 5:1920x1080@24 6:1920x1080@24 7:1600x1200@60 8:1680x1050@60 9:1280x1024@75 10:1280x1024@60 11:1440x900@75 12:1440x900@60 13:1280x960@60 14:1360x768@60 15:1280x800@60 16:1152x864@75 17:1280x720@60 18:1280x720@60 19:1280x720@60 20:1024x768@75 21:1024x768@70 22:1024x768@60 23:832x624@75 24:800x600@75 25:800x600@72 26:800x600@60 27:720x480@60 28:720x480@60 29:720x480@60 30:720x480@60 31:640x480@75 32:640x480@73 33:640x480@67 34:640x480@60 35:640x480@60 36:720x400@70 37:1280x1024@60 38:1024x768@60 39:1280x800@60 40:1920x1080@60 41:1600x900@60 42:1368x768@60 43:1280x720@60 Geometry: 0,100 1920x1080 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown
Output: 3 DP-3 enabled connected priority 1 DisplayPort Modes: 0:3440x1440@165*! 1:3440x1440@100 2:3440x1440@60 3:2560x1440@165 4:2560x1440@100 5:2560x1440@60 6:1920x1200@165 7:1920x1080@165 8:1920x1080@100 9:1920x1080@60 10:1920x1080@60 11:1920x1080@60 12:1920x1080@50 13:1600x1200@165 14:1680x1050@60 15:1600x900@60 16:1280x1024@75 17:1280x1024@60 18:1440x900@60 19:1280x800@60 20:1152x864@75 21:1280x720@60 22:1280x720@60 23:1280x720@60 24:1280x720@50 25:1024x768@75 26:1024x768@70 27:1024x768@60 28:832x624@75 29:800x600@75 30:800x600@72 31:800x600@60 32:800x600@56 33:720x576@50 34:720x480@60 35:720x480@60 36:640x480@75 37:640x480@73 38:640x480@67 39:640x480@60 40:640x480@60 41:720x400@70 42:1600x1200@60 43:1280x1024@60 44:1024x768@60 45:1920x1200@60 46:2560x1440@60 47:1920x1080@60 48:1600x900@60 49:1368x768@60 50:1280x720@60 Geometry: 1920,100 3440x1440 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: unknown

video of it occurring here https://www.youtube.com/watch?v=h_h6Higv_Mg
Comment 3 Nate Graham 2023-04-06 15:22:52 UTC
Well that's odd. Thanks for the logging and the video. Both show that KScreen is doing the right thing and the screen's resolution is set correctly. Looks like a KWin issue; keeping it here.

What GPU hardware are you using?
Comment 4 Beyley Thomas 2023-04-06 18:30:23 UTC
(In reply to Nate Graham from comment #3)
> Well that's odd. Thanks for the logging and the video. Both show that
> KScreen is doing the right thing and the screen's resolution is set
> correctly. Looks like a KWin issue; keeping it here.
> 
> What GPU hardware are you using?

A 6900XT from AMD, but i also have my iGPU enabled
Comment 5 Beyley Thomas 2023-07-11 20:14:08 UTC
Another result of this bug seems to be that any app that tries to use the screen capture portal after the bug happens causes plasma to hard crash and restart
Comment 6 Zamundaaa 2023-08-02 10:53:50 UTC
Please attach the output of wayland-info after reproducing the bug.

(In reply to Beyley Thomas from comment #5)
> Another result of this bug seems to be that any app that tries to use the
> screen capture portal after the bug happens causes plasma to hard crash and
> restart

Do you mean only plasmashell crashes, or the whole session? Also, if plasmashell restarts (or if you restart it with `plasmashell --replace`), does the problem go away?
Comment 7 Beyley Thomas 2023-08-02 22:55:52 UTC
(In reply to Zamundaaa from comment #6)
> Please attach the output of wayland-info after reproducing the bug.
> 
> (In reply to Beyley Thomas from comment #5)
> > Another result of this bug seems to be that any app that tries to use the
> > screen capture portal after the bug happens causes plasma to hard crash and
> > restart
> 
> Do you mean only plasmashell crashes, or the whole session? Also, if
> plasmashell restarts (or if you restart it with `plasmashell --replace`),
> does the problem go away?

the whole session crashes, and when it does, the bug goes away, i shall report back next time i trigger the bug to see if restarting plasmashell alone fixes it too
Comment 8 Zamundaaa 2023-08-02 23:01:33 UTC
Okay. When it crashes again, please afterwards start gdb with
coredumpctl debug kwin_wayland
and then get a backtrace with "bt" and attach that here
Comment 9 Beyley Thomas 2023-08-07 22:04:55 UTC
(In reply to Zamundaaa from comment #8)
> Okay. When it crashes again, please afterwards start gdb with
> coredumpctl debug kwin_wayland
> and then get a backtrace with "bt" and attach that here

[Current thread is 1 (Thread 0x7f19157c4640 (LWP 1176))]
(gdb) bt
#0  0x00007f191a29f26c in  () at /usr/lib/libc.so.6
#1  0x00007f191a24fa08 in raise () at /usr/lib/libc.so.6
#2  0x00007f191a238538 in abort () at /usr/lib/libc.so.6
#3  0x00007f191c38afee in  () at /usr/lib/libepoxy.so.0
#4  0x00007f191c38eab2 in  () at /usr/lib/libepoxy.so.0
#5  0x000055abe5bbed52 in  ()
#6  0x00007f191b2d15a7 in  () at /usr/lib/libQt5Core.so.5
#7  0x00007f191b2d2da4 in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () at /usr/lib/libQt5Core.so.5
#8  0x00007f191b2d2ee8 in QSocketNotifier::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#9  0x00007f191a97893f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#10 0x00007f191b29c668 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#11 0x00007f191b2ea09c in QEventDispatcherUNIXPrivate::activateSocketNotifiers() () at /usr/lib/libQt5Core.so.5
#12 0x00007f191b2eb0e5 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#13 0x000055abe5c79ba2 in  ()
#14 0x00007f191b29b374 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#15 0x00007f191b29c813 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#16 0x000055abe5b952fb in  ()
#17 0x00007f191a239850 in  () at /usr/lib/libc.so.6
#18 0x00007f191a23990a in __libc_start_main () at /usr/lib/libc.so.6
#19 0x000055abe5b96ed5 in  ()
Comment 10 Zamundaaa 2023-08-09 12:45:27 UTC
The backtrace is incomplete. Please install debuginfod and get a backtrace with debug symbols
Comment 11 Beyley Thomas 2023-08-22 00:36:32 UTC
(In reply to Zamundaaa from comment #10)
> The backtrace is incomplete. Please install debuginfod and get a backtrace
> with debug symbols

I do already have debuginfod, is there something else i need to pass to coredumpctl to get it to use it? (sorry for the late response ive been trying to replicate the crash, and it hasnt happened in a couple weeks), but i can confirm the bugged plasmashell desktop and compositor issues still happen on 5.27.7
Comment 12 Zamundaaa 2023-08-22 20:27:34 UTC
No, as long as your distro has everything set up correctly it should work without you needing to do anything
Comment 13 Bug Janitor Service 2023-09-06 03:45:20 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 14 Beyley Thomas 2023-09-08 02:41:17 UTC
after playing with it for awhile, i figured out that i needed to specify the debuginfod URLs, as sudo wasnt preserving the right ENV vars for debuginfod to work (i needed sudo for coredumpctl)

[Current thread is 1 (Thread 0x7f6d83ee9640 (LWP 1183))]
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007f6d8888e8a3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007f6d8883e668 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007f6d888264b8 in __GI_abort () at abort.c:79
#4  0x00007f6d8ab04fee in egl_provider_resolver (name=name@entry=0x7f6d8ab2bc44 <entrypoint_strings+1060> "eglDestroySyncKHR", providers=providers@entry=0x7f6d8ab2b784 <providers.19.lto_priv>, entrypoints=entrypoints@entry=0x7f6d8ab2b778 <entrypoints.18.lto_priv>) at src/egl_generated_dispatch.c:3911
#5  0x00007f6d8ab08ab2 in epoxy_eglDestroySyncKHR_resolver () at src/egl_generated_dispatch.c:4312
#6  epoxy_eglDestroySyncKHR_global_rewrite_ptr (dpy=0x5644b2350380, sync=0x5644b5cf7d20) at src/egl_generated_dispatch.c:5063
#7  0x00005644b0fb0d52 in KWin::EGLNativeFence::~EGLNativeFence() (this=0x5644b4de5320, this=<optimized out>) at /usr/src/debug/kwin/kwin-5.27.7/src/plugins/screencast/eglnativefence.cpp:36
#8  std::default_delete<KWin::EGLNativeFence>::operator()(KWin::EGLNativeFence*) const (this=<optimized out>, __ptr=0x5644b4de5320) at /usr/include/c++/13.1.1/bits/unique_ptr.h:99
#9  std::default_delete<KWin::EGLNativeFence>::operator()(KWin::EGLNativeFence*) const (__ptr=0x5644b4de5320, this=<optimized out>) at /usr/include/c++/13.1.1/bits/unique_ptr.h:93
#10 std::__uniq_ptr_impl<KWin::EGLNativeFence, std::default_delete<KWin::EGLNativeFence> >::reset(KWin::EGLNativeFence*) (__p=0x0, this=0x5644b4e27108) at /usr/include/c++/13.1.1/bits/unique_ptr.h:211
#11 std::unique_ptr<KWin::EGLNativeFence, std::default_delete<KWin::EGLNativeFence> >::reset(KWin::EGLNativeFence*) (__p=0x0, this=0x5644b4e27108) at /usr/include/c++/13.1.1/bits/unique_ptr.h:509
#12 KWin::ScreenCastStream::enqueue() (this=0x5644b4e26f40) at /usr/src/debug/kwin/kwin-5.27.7/src/plugins/screencast/screencaststream.cpp:680
#13 0x00007f6d89ad1637 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffd137295b0, r=<optimized out>, this=0x7f6d6c00a4c0, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#14 doActivate<false>(QObject*, int, void**) (sender=0x5644b52ed5f0, signal_index=3, argv=0x7ffd137295b0) at kernel/qobject.cpp:3925
#15 0x00007f6d89ad2e34 in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) (this=this@entry=0x5644b52ed5f0, _t1=..., _t2=<optimized out>, _t3=...) at .moc/moc_qsocketnotifier.cpp:178
#16 0x00007f6d89ad2f78 in QSocketNotifier::event(QEvent*) (this=0x5644b52ed5f0, e=<optimized out>) at kernel/qsocketnotifier.cpp:302
#17 0x00007f6d8917893f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#18 0x00007f6d89a9c6f8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x5644b52ed5f0, event=0x7ffd137296d0) at kernel/qcoreapplication.cpp:1064
#19 0x00007f6d89aea0dc in QEventDispatcherUNIXPrivate::activateSocketNotifiers() (this=this@entry=0x5644b1f44b20) at kernel/qeventdispatcher_unix.cpp:304
#20 0x00007f6d89aeb2a9 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at kernel/qeventdispatcher_unix.cpp:511
#21 0x00005644b106bba2 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
#22 0x00007f6d89a9b404 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffd13729860, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#23 0x00007f6d89a9c8a3 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#24 0x00005644b0f872fb in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kwin/kwin-5.27.7/src/main_wayland.cpp:628
Comment 15 Beyley Thomas 2023-12-01 00:09:21 UTC
I have recently started encountering another (perhaps related) issue in the past month or so
Whenever my computer goes to sleep, my main monitor (a Samsung LC34G55T) seems to "hard crash", in that it refuses to ever turn back online after plasma puts it to sleep, i can turn my computer off and on, restart it, and press every button on the monitor, nothing happens, the only solution to get it working again is to unplug and replug the monitor's power cable

This does not happen under hyprland or sway, so i'm assuming its a kwin bug
Comment 16 13k 2023-12-01 15:23:27 UTC
I can confirm this is happening with my setup too.

In my case, I have a 2 monitor setup (output1 DP-3 2560x1440@144, output2 DP-1 3440x1440@16; output2 is set to primary) and it happens on screenlock, no need to enter sleep mode (I don't have sleep enabled).

The thing is, this primary monitor (output2 on DP-1), when entering its own energy saving mode, behaves like it was completely turned off - as opposed to other monitors I owned where they simply turned off the screen but the DP/HDMI connection was still online - so all the unplug/re-plug events happen when the monitor goes to sleep (windows/panels are moved from primary monitor to secondary, then moved back when the monitor wakes up).

I've attached the logs for `kscreen-doctor -o`, `wayland-info` and `journalctl` right after the bug happens (you can see kernel USB events indicating the monitor was detected as plugged in, but it was simply sleeping).
Comment 17 13k 2023-12-01 15:23:59 UTC
Created attachment 163703 [details]
kscreen-doctor, wayland-info, journalctl
Comment 18 Zamundaaa 2024-05-22 13:11:16 UTC
*** Bug 464674 has been marked as a duplicate of this bug. ***