Bug 450501 - kwin_wayland crashes at KWin::EglGbmLayer::testBuffer() when enabling monitor in system settings
Summary: kwin_wayland crashes at KWin::EglGbmLayer::testBuffer() when enabling monitor...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: git master
Platform: OpenSUSE Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen, wayland
Depends on:
Blocks:
 
Reported: 2022-02-18 04:59 UTC by Fushan Wen
Modified: 2022-02-20 17:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.24.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fushan Wen 2022-02-18 04:59:52 UTC
SUMMARY
I have a laptop monitor and an external monitor. The external monitor is enabled. When I tried to enable the disabled laptop monitor in system settings, kwin_wayland crashed. 


STEPS TO REPRODUCE
1. Enable the laptop monitor in system settings
2. Apply
3. Crash

OBSERVED RESULT
Crash, and the laptop monitor was not enabled after recovery.

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220215
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Kernel Version: 5.16.8-1-default (64-bit)
Graphics Platform: Wayland
Processors: 8 × AMD Ryzen 7 4700U with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD RENOIR

Information for package kwin5:
------------------------------
Repository     : unstable-kde-frameworks
Name           : kwin5
Version        : 5.24.80git.20220217T155315~b1c1603c8c-ku.12.1
Arch           : x86_64
Vendor         : obs://build.opensuse.org/KDE:Unstable
Installed Size : 15.7 MiB
Installed      : Yes
Status         : out-of-date (version 5.24.80git.20220216T172906~2d56154fe8-ku.11.1 installed)
Source package : kwin5-5.24.80git.20220217T155315~b1c1603c8c-ku.12.1.src
Summary        : KDE Window Manager

ADDITIONAL INFORMATION
(gdb) bt
#0  KWin::EglGbmLayer::testBuffer() (this=0x0) at /usr/include/qt5/QtCore/qsharedpointer_impl.h:301
#1  KWin::EglGbmBackend::testBuffer(KWin::DrmAbstractOutput*) (output=0x55a7a6772300, this=0x55a7a67966d0) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/backends/drm/egl_gbm_backend.cpp:300
#2  KWin::DrmPipeline::checkTestBuffer() (this=0x55a7a64b1680) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/backends/drm/drm_pipeline.cpp:307
#3  0x00007f1d63507d80 in KWin::DrmPipeline::commitPipelinesAtomic(QVector<KWin::DrmPipeline*> const&, KWin::DrmPipeline::CommitMode, QVector<KWin::DrmObject*> const&) (pipelines=<optimized out>, mode=<optimized out>, unusedObjects=<optimized out>) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/backends/drm/drm_pipeline.cpp:136
#4  0x00007f1d634ff1c9 in KWin::DrmGpu::testPipelines() (this=this@entry=0x55a7a653c0f0) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/backends/drm/drm_gpu.cpp:430
#5  0x00007f1d634ff3c2 in KWin::DrmGpu::checkCrtcAssignment(QVector<KWin::DrmConnector*>, QVector<KWin::DrmCrtc*> const&) (this=this@entry=0x55a7a653c0f0, connectors=..., crtcs=...) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/backends/drm/drm_gpu.cpp:338
#6  0x00007f1d634ff5fc in KWin::DrmGpu::checkCrtcAssignment(QVector<KWin::DrmConnector*>, QVector<KWin::DrmCrtc*> const&) (this=this@entry=0x55a7a653c0f0, connectors=..., crtcs=...) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/backends/drm/drm_gpu.cpp:369
#7  0x00007f1d634ff868 in KWin::DrmGpu::checkCrtcAssignment(QVector<KWin::DrmConnector*>, QVector<KWin::DrmCrtc*> const&) (this=0x55a7a653c0f0, connectors=..., crtcs=...) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/backends/drm/drm_gpu.cpp:359
#8  0x00007f1d6350fbee in operator() (__closure=<optimized out>) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/backends/drm/drm_gpu.cpp:401
#9  operator() (__closure=<optimized out>) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/backends/drm/drm_gpu.cpp:399
#10 KWin::DrmGpu::testPendingConfiguration(KWin::DrmGpu::TestMode) [clone .constprop.0] (this=0x55a7a653c0f0, mode=<optimized out>) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/backends/drm/drm_gpu.cpp:406
#11 0x00007f1d634ea2d3 in KWin::DrmBackend::applyOutputChanges(KWin::WaylandOutputConfig const&) (this=<optimized out>, config=...) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/backends/drm/drm_backend.cpp:641
#12 0x00007f1d6b6cc0e3 in KWin::Platform::requestOutputsChange(KWaylandServer::OutputConfigurationV2Interface*) (this=0x55a7a6537880, config=0x55a7a799e1c0) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/platform.cpp:133
#13 0x00007f1d6939b4e3 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffd067ccf60, r=0x55a7a64e9db0, this=0x55a7a6525bb0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#14 doActivate<false>(QObject*, int, void**) (sender=0x55a7a6525a80, signal_index=3, argv=0x7ffd067ccf60) at kernel/qobject.cpp:3886
#15 0x00007f1d693949af in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=<optimized out>, m=m@entry=0x7f1d69f34560 <KWaylandServer::OutputManagementV2Interface::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd067ccf60) at kernel/qobject.cpp:3946
#16 0x00007f1d69e36dcf in KWaylandServer::OutputManagementV2Interface::configurationChangeRequested(KWaylandServer::OutputConfigurationV2Interface*) (this=<optimized out>, _t1=<optimized out>) at /usr/src/debug/kwayland-server-5.24.80git.20220212T141424~53185505-ku.5.1.x86_64/build/src/server/KWaylandServer_autogen/EWIEGA46WW/moc_outputmanagement_v2_interface.cpp:136
#17 0x00007f1d67087572 in ffi_call_unix64 () at ../src/x86/unix64.S:105
#18 0x00007f1d67084296 in ffi_call_int (cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=<optimized out>) at ../src/x86/ffi64.c:672
#19 0x00007f1d683a0090 in wl_closure_invoke (closure=closure@entry=0x55a7a81b5940, target=<optimized out>, target@entry=0x55a7a7239960, opcode=opcode@entry=5, data=<optimized out>, data@entry=0x55a7a7e6be40, flags=<optimized out>) at ../src/connection.c:1025
#20 0x00007f1d683a4234 in wl_client_connection_data (fd=<optimized out>, mask=<optimized out>, data=0x55a7a7e6be40) at ../src/wayland-server.c:437
#21 0x00007f1d683a2cea in wl_event_loop_dispatch (loop=0x55a7a652a760, timeout=<optimized out>) at ../src/event-loop.c:1027
#22 0x00007f1d69e4bb16 in KWaylandServer::Display::dispatchEvents() (this=<optimized out>) at /usr/src/debug/kwayland-server-5.24.80git.20220212T141424~53185505-ku.5.1.x86_64/src/server/display.cpp:114
#23 0x00007f1d6939b4e3 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffd067cd7c0, r=0x55a7a6521870, this=0x55a7a6512fa0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#24 doActivate<false>(QObject*, int, void**) (sender=0x55a7a6c821a0, signal_index=3, argv=0x7ffd067cd7c0) at kernel/qobject.cpp:3886
#25 0x00007f1d693949af in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x55a7a6c821a0, m=m@entry=0x7f1d6963aac0, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd067cd7c0) at kernel/qobject.cpp:3946
#26 0x00007f1d6939e8bf in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) (this=this@entry=0x55a7a6c821a0, _t1=..., _t2=<optimized out>, _t3=...) at .moc/moc_qsocketnotifier.cpp:178
#27 0x00007f1d6939f0bb in QSocketNotifier::event(QEvent*) (this=0x55a7a6c821a0, e=0x7ffd067cd8e0) at kernel/qsocketnotifier.cpp:302
#28 0x00007f1d6a0e1a7f in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x55a7a6c821a0, e=0x7ffd067cd8e0) at kernel/qapplication.cpp:3632
#29 0x00007f1d69364e1a in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55a7a6c821a0, event=0x7ffd067cd8e0) at kernel/qcoreapplication.cpp:1064
#30 0x00007f1d693b971b in QEventDispatcherUNIXPrivate::activateSocketNotifiers() (this=0x55a7a64ec560) at kernel/qeventdispatcher_unix.cpp:304
#31 0x00007f1d693b9b7b in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at kernel/qeventdispatcher_unix.cpp:511
#32 0x000055a7a4d10bcd in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=<optimized out>, flags=...) at qunixeventdispatcher.cpp:63
#33 0x00007f1d6936381b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffd067cda70, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#34 0x00007f1d6936baf0 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#35 0x00007f1d697b525c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1867
#36 0x00007f1d6a0e19f5 in QApplication::exec() () at kernel/qapplication.cpp:2824
#37 0x000055a7a4c25015 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kwin5-5.24.80git.20220216T172906~2d56154fe8-ku.11.1.x86_64/src/main_wayland.cpp:727
Comment 2 Bug Janitor Service 2022-02-18 08:13:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2038
Comment 3 Bug Janitor Service 2022-02-18 17:00:38 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2043
Comment 4 Zamundaaa 2022-02-18 19:40:16 UTC
Git commit e9db27d05d7b76c8a4fc12a6f5c059680917052f by Xaver Hugl.
Committed on 18/02/2022 at 17:13.
Pushed by zamundaaa into branch 'master'.

backends/drm: ignore enabled state of outputs for the lifetime of layers

A buffer is needed for atomic tests before the output is actually enabled
Related: bug 450358

M  +2    -2    src/backends/drm/egl_gbm_backend.cpp

https://invent.kde.org/plasma/kwin/commit/e9db27d05d7b76c8a4fc12a6f5c059680917052f
Comment 5 Zamundaaa 2022-02-18 19:51:19 UTC
Git commit 29bc1173c70b2a31753c791aa60fb33ee320440a by Xaver Hugl.
Committed on 18/02/2022 at 19:50.
Pushed by zamundaaa into branch 'Plasma/5.24'.

backends/drm: ignore enabled state of outputs for the lifetime of surfaces

A buffer is needed for atomic tests before the output is actually enabled
Related: bug 450358
(cherry picked from commit e9db27d05d7b76c8a4fc12a6f5c059680917052f)

M  +8    -7    src/backends/drm/egl_gbm_backend.cpp
M  +2    -2    src/backends/drm/egl_gbm_backend.h

https://invent.kde.org/plasma/kwin/commit/29bc1173c70b2a31753c791aa60fb33ee320440a