Bug 452398

Summary: Kwin crashed in KWin::PresentWindowsEffect::setActive() when invoking Present Windows immediately after disconnecting external display
Product: [Plasma] kwin Reporter: Kishore Gopalakrishnan <kishore96>
Component: effects-present-windowsAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: nate
Priority: NOR Keywords: drkonqi
Version First Reported In: 5.24.4   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.25
Sentry Crash Report:

Description Kishore Gopalakrishnan 2022-04-08 11:36:42 UTC
Application: kwin_x11 (5.24.4)

Qt Version: 5.15.3
Frameworks Version: 5.92.0
Operating System: Linux 5.15.32-1-lts x86_64
Windowing System: X11
Distribution: Arch Linux
DrKonqi: 5.24.4 [KCrashBackend]

-- Information about the crash:
- What I was doing when the application crashed:

I disconnected a monitor (connected via a VGA-to-HDMI adapter, HDMI port on my laptop), and while the window manager was adjusting the display, I tried to activate the desktop grid effect from the screen corner.

The reporter is unsure if this crash is reproducible.

-- Backtrace:
Application: கேவின் (kwin_x11), signal: Segmentation fault
Content of s_kcrashErrorMessage: {_M_t = {<std::__uniq_ptr_impl<char, std::default_delete<char []> >> = {_M_t = std::tuple containing = {[1] = 0x0, [2] = {<No data fields>}}}, <No data fields>}}
[KCrash Handler]
#6  0x0000000000000000 in  ()
#7  0x0000559a8f96d785 in KWin::PresentWindowsEffect::setActive(bool) (this=0x559a922061e0, active=<optimized out>) at /usr/src/debug/kwin-5.24.4/src/effects/presentwindows/presentwindows.cpp:1710
#8  0x00007fda51e559e8 in KWin::Workspace::workspaceEvent(QEvent*) (this=<optimized out>, e=0x7ffdaa7b3450) at /usr/src/debug/kwin-5.24.4/src/events.cpp:316
#9  KWin::Workspace::workspaceEvent(QEvent*) (this=<optimized out>, e=e@entry=0x7ffdaa7b3450) at /usr/src/debug/kwin-5.24.4/src/events.cpp:312
#10 0x0000559a8f938cab in KWin::ApplicationX11::notify(QObject*, QEvent*) (this=0x7ffdaa7b3690, o=0x559a8ffac000, e=0x7ffdaa7b3450) at /usr/src/debug/kwin-5.24.4/src/main_x11.cpp:270
#11 0x00007fda5053e5aa in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x559a8ffac000, event=0x7ffdaa7b3450) at kernel/qcoreapplication.cpp:1064
#12 0x00007fda50911e94 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) (e=0x7fda4404e920) at kernel/qguiapplication.cpp:2414
#13 0x00007fda508fc6e5 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169
#14 0x00007fda4a424f9a in QXcbUnixEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x559a8fbd24b0, flags=...) at /usr/src/debug/qtbase/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:63
#15 0x00007fda5053688b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x7ffdaa7b35a0, flags=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#16 0x00007fda50541fd7 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#17 0x00007fda5090c432 in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1867
#18 0x00007fda4fb6a54a in QApplication::exec() () at kernel/qapplication.cpp:2829
#19 0x0000559a8f933e8c in main(int, char**) (argc=<optimized out>, argv=0x7ffdaa7b3868) at /usr/src/debug/kwin-5.24.4/src/main_x11.cpp:482
[Inferior 1 (process 3529) detached]

Possible duplicates by query: bug 452375, bug 452083, bug 451693, bug 451425, bug 450954.

Reported using DrKonqi
Comment 1 Nate Graham 2022-05-05 15:11:27 UTC
This has been fixed with the rewrite in Plasma 5.25, done by Marco Martin with https://invent.kde.org/plasma/kwin/-/commit/376ee357dbc50fec3b6e71c40938171ddb2e726a!