Created attachment 171305 [details] coredump-backtrace *** If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** SUMMARY The crash happens after disconnecting a laptop from an external display (connected via a docking station), this only started happening on 6.1 I think Might be related to https://bugs.kde.org/show_bug.cgi?id=489414 STEPS TO REPRODUCE 1. Disconnect the display OBSERVED RESULT Crash! Sometimes it might result in all windows crashing and kwin restarting EXPECTED RESULT No crash! SOFTWARE/OS VERSIONS Operating System: NixOS 24.11 KDE Plasma Version: 6.1.1 KDE Frameworks Version: 6.3.0 Qt Version: 6.7.2 Kernel Version: 6.6.36 (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 7 7840U w/ Radeon 780M Graphics Memory: 27,2 GiB of RAM Graphics Processor: AMD Radeon Graphics
Created attachment 171306 [details] another backtrace
Please get a complete backtrace following https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl
(In reply to Zamundaaa from comment #2) > Please get a complete backtrace following > https://community.kde.org/Guidelines_and_HOWTOs/Debugging/ > How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl This is the backtrace I get with `coredumpctl gdb` I am figuring out how to get debug symbols on NixOS ``` (gdb) backtrace #0 0x00007fe9f39d9729 in QMetaObjectPrivate::disconnect(QObject const*, int, QMetaObject const*, QObject const*, int, void**, QMetaObjectPrivate::DisconnectType) () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Core.so.6 #1 0x00007fe9f39da05a in QObject::disconnectImpl(QObject const*, void**, QObject const*, void**, QMetaObject const*) () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Core.so.6 #2 0x00007fe9f6c724d9 in KWin::Window::setMoveResizeOutput(KWin::Output*) () from /nix/store/ybw0sy554h8raglxmbm5wkj3arxc1rwg-kwin-6.1.0/lib/libkwin.so.6 #3 0x00007fe9f6c727bd in KWin::Window::setMoveResizeGeometry(QRectF const&) () from /nix/store/ybw0sy554h8raglxmbm5wkj3arxc1rwg-kwin-6.1.0/lib/libkwin.so.6 #4 0x00007fe9f6cb921a in KWin::XdgSurfaceWindow::handleNextWindowGeometry() () from /nix/store/ybw0sy554h8raglxmbm5wkj3arxc1rwg-kwin-6.1.0/lib/libkwin.so.6 #5 0x00007fe9f6cb93ce in KWin::XdgSurfaceWindow::handleCommit() () from /nix/store/ybw0sy554h8raglxmbm5wkj3arxc1rwg-kwin-6.1.0/lib/libkwin.so.6 #6 0x00007fe9f39e4ec0 in void doActivate<false>(QObject*, int, void**) () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Core.so.6 #7 0x00007fe9f6e508a8 in KWin::SurfaceInterfacePrivate::applyState(KWin::SurfaceState*) () from /nix/store/ybw0sy554h8raglxmbm5wkj3arxc1rwg-kwin-6.1.0/lib/libkwin.so.6 #8 0x00007fe9f6e7f252 in KWin::Transaction::apply() () from /nix/store/ybw0sy554h8raglxmbm5wkj3arxc1rwg-kwin-6.1.0/lib/libkwin.so.6 #9 0x00007fe9f6e7eddc in KWin::Transaction::tryApply() () from /nix/store/ybw0sy554h8raglxmbm5wkj3arxc1rwg-kwin-6.1.0/lib/libkwin.so.6 #10 0x00007fe9f6e80d03 in KWin::Transaction::commit() () from /nix/store/ybw0sy554h8raglxmbm5wkj3arxc1rwg-kwin-6.1.0/lib/libkwin.so.6 #11 0x00007fe9f6e4f170 in KWin::SurfaceInterfacePrivate::surface_commit(QtWaylandServer::wl_surface::Resource*) () from /nix/store/ybw0sy554h8raglxmbm5wkj3arxc1rwg-kwin-6.1.0/lib/libkwin.so.6 #12 0x00007fe9f2a44052 in ffi_call_unix64 () from /nix/store/nj9g42fdsm8l2z43kfcahch3px2q209a-libffi-3.4.6/lib/libffi.so.8 #13 0x00007fe9f2a41ee5 in ffi_call_int () from /nix/store/nj9g42fdsm8l2z43kfcahch3px2q209a-libffi-3.4.6/lib/libffi.so.8 #14 0x00007fe9f2a42ad8 in ffi_call () from /nix/store/nj9g42fdsm8l2z43kfcahch3px2q209a-libffi-3.4.6/lib/libffi.so.8 #15 0x00007fe9f7503841 in wl_closure_invoke () from /nix/store/p70yz972riakl5l0k7nzakyybi5r8481-wayland-1.22.0/lib/libwayland-server.so.0 #16 0x00007fe9f74fec4b in wl_client_connection_data () from /nix/store/p70yz972riakl5l0k7nzakyybi5r8481-wayland-1.22.0/lib/libwayland-server.so.0 #17 0x00007fe9f75018f2 in wl_event_loop_dispatch () from /nix/store/p70yz972riakl5l0k7nzakyybi5r8481-wayland-1.22.0/lib/libwayland-server.so.0 #18 0x00007fe9f6ddfa52 in KWin::Display::dispatchEvents() () from /nix/store/ybw0sy554h8raglxmbm5wkj3arxc1rwg-kwin-6.1.0/lib/libkwin.so.6 #19 0x00007fe9f39e4ec0 in void doActivate<false>(QObject*, int, void**) () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Core.so.6 #20 0x00007fe9f39f1eef in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Core.so.6 #21 0x00007fe9f39f26a5 in QSocketNotifier::event(QEvent*) () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Core.so.6 #22 0x00007fe9f4b94d21 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Widgets.so.6 #23 0x00007fe9f3981d60 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Core.so.6 #24 0x00007fe9f3b2f4de in QEventDispatcherUNIXPrivate::activateSocketNotifiers() () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Core.so.6 #25 0x00007fe9f3b2fb81 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Core.so.6 #26 0x00007fe9f46e260d in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Gui.so.6 #27 0x00007fe9f398eaf3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Core.so.6 #28 0x00007fe9f398ac86 in QCoreApplication::exec() () from /nix/store/vzhlcx5vzicjkbb9i37ryslaa6s3gb57-qtbase-6.7.1/lib/libQt6Core.so.6 #29 0x00000000004450d5 in main () (gdb) ```
after getting debug symbols in: ``` Core was generated by `/run/wrappers/bin/kwin_wayland --wayland-fd 7 --socket wayland-0 --xwayland-fd'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007eff057d9609 in QMetaObjectPrivate::disconnect(QObject const*, int, QMetaObject const*, QObject const*, int, void**, QMetaObjectPrivate::DisconnectType) () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Core.so.6 [Current thread is 1 (Thread 0x7efeff43db00 (LWP 2580))] (gdb) backtrace #0 0x00007eff057d9609 in QMetaObjectPrivate::disconnect(QObject const*, int, QMetaObject const*, QObject const*, int, void**, QMetaObjectPrivate::DisconnectType) () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Core.so.6 #1 0x00007eff057d9f3a in QObject::disconnectImpl(QObject const*, void**, QObject const*, void**, QMetaObject const*) () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Core.so.6 #2 0x00007eff08c73ca9 in QObject::disconnect<void (KWin::Output::*)(), void (KWin::Window::*)()> ( slot=(void (KWin::Window::*)(KWin::Window * const)) 0x7eff08c73a80 <KWin::Window::updatePreferredBufferScale()>, receiver=0x64ee7e0, signal=(void (KWin::Output::*)(KWin::Output * const)) 0x7eff08a1fbb0 <KWin::Output::scaleChanged()>, sender=<optimized out>) at /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/include/QtCore/qobject.h:306 #3 KWin::Window::setMoveResizeOutput (this=0x64ee7e0, output=0x5c928e0) at /build/kwin-6.1.1.2/src/window.cpp:3322 #4 0x00007eff08c73f8d in KWin::Window::setMoveResizeGeometry (this=0x64ee7e0, geo=...) at /build/kwin-6.1.1.2/src/window.cpp:3307 #5 0x00007eff08cbab0a in KWin::XdgSurfaceWindow::handleNextWindowGeometry ( this=this@entry=0x64ee7e0) at /build/kwin-6.1.1.2/src/xdgshellwindow.cpp:233 #6 0x00007eff08cbacbe in KWin::XdgSurfaceWindow::handleCommit (this=0x64ee7e0) at /build/kwin-6.1.1.2/src/xdgshellwindow.cpp:154 #7 0x00007eff057e4da0 in void doActivate<false>(QObject*, int, void**) () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Core.so.6 #8 0x00007eff08e52028 in KWin::SurfaceInterfacePrivate::applyState (this=0x501a940, next=0x50780c0) at /build/kwin-6.1.1.2/src/wayland/surface.cpp:729 #9 0x00007eff08e809d2 in KWin::Transaction::apply (this=0x6224190) at /build/kwin-6.1.1.2/src/wayland/transaction.cpp:229 #10 0x00007eff08e8055c in KWin::Transaction::tryApply (this=this@entry=0x6224190) at /build/kwin-6.1.1.2/src/wayland/transaction.cpp:262 #11 0x00007eff08e82483 in KWin::Transaction::commit (this=this@entry=0x6224190) at /build/kwin-6.1.1.2/src/wayland/transaction.cpp:296 #12 0x00007eff08e508f0 in KWin::SurfaceInterfacePrivate::surface_commit (this=0x501a940, resource=<optimized out>) at /build/kwin-6.1.1.2/src/wayland/surface.cpp:379 #13 0x00007eff04a0c052 in ffi_call_unix64 () from /nix/store/nj9g42fdsm8l2z43kfcahch3px2q209a-libffi-3.4.6/lib/libffi.so.8 #14 0x00007eff04a09ee5 in ffi_call_int () from /nix/store/nj9g42fdsm8l2z43kfcahch3px2q209a-libffi-3.4.6/lib/libffi.so.8 #15 0x00007eff04a0aad8 in ffi_call () from /nix/store/nj9g42fdsm8l2z43kfcahch3px2q209a-libffi-3.4.6/lib/libffi.so.8 #16 0x00007eff094ca841 in wl_closure_invoke (closure=0x61a1600, flags=<optimized out>, target=<optimized out>, opcode=6, data=<optimized out>) at ../src/connection.c:1025 #17 0x00007eff094c5c4b in wl_client_connection_data (fd=<optimized out>, mask=<optimized out>, data=0x5ef0420) at ../src/wayland-server.c:438 #18 0x00007eff094c88f2 in wl_event_loop_dispatch (loop=0x4d6e960, timeout=<optimized out>) at ../src/event-loop.c:1034 #19 0x00007eff08de1122 in KWin::Display::dispatchEvents (this=<optimized out>) at /build/kwin-6.1.1.2/src/wayland/display.cpp:118 #20 0x00007eff057e4da0 in void doActivate<false>(QObject*, int, void**) () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Core.so.6 --Type <RET> for more, q to quit, c to continue without paging-- e, QSocketNotifier::QPrivateSignal) () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Core.so.6 #22 0x00007eff057f2585 in QSocketNotifier::event(QEvent*) () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Core.so.6 #23 0x00007eff06b94d21 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Widgets.so.6 #24 0x00007eff05781c10 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Core.so.6 #25 0x00007eff0592f4ce in QEventDispatcherUNIXPrivate::activateSocketNotifiers() () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Core.so.6 #26 0x00007eff0592fb71 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Core.so.6 #27 0x00007eff064e27ed in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Gui.so.6 #28 0x00007eff0578e9d3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Core.so.6 #29 0x00007eff0578ab66 in QCoreApplication::exec() () from /nix/store/4qrmlniaj7x49sl6i1w4c2sjjdx00ghh-qtbase-6.7.2/lib/libQt6Core.so.6 #30 0x00000000004451b5 in main (argc=<optimized out>, argv=<optimized out>) at /build/kwin-6.1.1.2/src/main_wayland.cpp:642 ```
Hmm, the move resize output is most likely a dangling pointer.
Can reproduce 100% of the time when unplugging my USB-C monitor, with the same stack trace. Operating System: KDE neon 6.0 KDE Plasma Version: 6.1.2 KDE Frameworks Version: 6.3.0 Qt Version: 6.7.0 Kernel Version: 6.5.0-41-generic (64-bit) Graphics Platform: Wayland Processors: 8 × Intel® Core™ i5-10310U CPU @ 1.70GHz Memory: 15.3 Gio of RAM Graphics Processor: Mesa Intel® UHD Graphics Manufacturer: Dell Inc. Product Name: Latitude 7410
(In reply to Louis Moureaux from comment #6) > Can reproduce 100% of the time when unplugging my USB-C monitor, with the > same stack trace. Is it reproducible when you have no apps open on desktop?
> Is it reproducible when you have no apps open on desktop? Actually not. This is reliably reproducible with a Firefox window on the external screen, which I hadn't noticed because it's my standard setup.
(In reply to Louis Moureaux from comment #8) > > Is it reproducible when you have no apps open on desktop? > > Actually not. This is reliably reproducible with a Firefox window on the > external screen, which I hadn't noticed because it's my standard setup. Hmm, it doesn't crash for me with firefox on an external screen. What's your output setup? does firefox create any new windows? can you please check what exactly in ff makes kwin crash?
Thank you for trying to reproduce! The external monitor is a Samsung 1560x1440 panel connected over USB-C with attached mouse and keyboard. The laptop gets power from the external screen as well. The built-in screen has lower resolution, 1920x1280. Unfortunately I am away from this specific setup for the coming weeks, but I'll try to recreate in another environment.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6152
Git commit 02fbeeae78188c6e7aa4dd90c582faef1d678c01 by Vlad Zahorodnii. Committed on 23/07/2024 at 13:46. Pushed by vladz into branch 'master'. Make Workspace::desktopResized() reassign outputs of uninitialized windows If an output is deleted, the Workspace::desktopResized() is going to re-assign windows to the new outputs. It is done so so the workspace re-arrangement procedure is deterministic and has concrete order. However, with the current Window lifecycle management, it's possible to encounter the follwing case: - xdg_toplevel gets created on output A - xdg_toplevel initial state is committed - output A is removed - a wl_buffer is attached to the xdg_toplevel, which results in a geometry change and an output change - Window::setMoveResizeOutput() is called, but the previous output is a dangling pointer M +2 -0 autotests/integration/CMakeLists.txt A +115 -0 autotests/integration/workspace_test.cpp [License: GPL(v2.0+)] M +9 -0 src/workspace.cpp https://invent.kde.org/plasma/kwin/-/commit/02fbeeae78188c6e7aa4dd90c582faef1d678c01
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6162
Git commit 65073ce6796fb6033929b5ce413612148eb7908e by Vlad Zahorodnii. Committed on 23/07/2024 at 13:55. Pushed by vladz into branch 'Plasma/6.1'. Make Workspace::desktopResized() reassign outputs of uninitialized windows If an output is deleted, the Workspace::desktopResized() is going to re-assign windows to the new outputs. It is done so so the workspace re-arrangement procedure is deterministic and has concrete order. However, with the current Window lifecycle management, it's possible to encounter the follwing case: - xdg_toplevel gets created on output A - xdg_toplevel initial state is committed - output A is removed - a wl_buffer is attached to the xdg_toplevel, which results in a geometry change and an output change - Window::setMoveResizeOutput() is called, but the previous output is a dangling pointer (cherry picked from commit 02fbeeae78188c6e7aa4dd90c582faef1d678c01) Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> M +2 -0 autotests/integration/CMakeLists.txt A +115 -0 autotests/integration/workspace_test.cpp [License: GPL(v2.0+)] M +9 -0 src/workspace.cpp https://invent.kde.org/plasma/kwin/-/commit/65073ce6796fb6033929b5ce413612148eb7908e
I'm on KDE Plasma Version 6.1.4 and it seems I'm not hitting this bug anymore, Thanks a lot for your work! I still note some behavior that can be improved: when the external display is disconnected, the windows do not necessarily get moved to the now only screen.
Great! That other issue is Bug 479694, which hopefully will be fully fixed in Plasma 6.1.5