https://bugs.kde.org/show_bug.cgi?id=508917

            Bug ID: 508917
           Summary: Wayland apps or kwin_wayland crash when plugging and
                    unplugging monitor quickly
    Classification: Plasma
           Product: kwin
      Version First 6.4.4
       Reported In:
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: generic-crash
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

SUMMARY
When I plug and unplug a monitor into a computer quickly, the kernel fails to
load DPCD, kwin_wayland fails to load EDID, and Wayland client apps crash with
"not a valid new object id (4278190410), message data_offer(n)".

STEPS TO REPRODUCE
1. Quickly plug and unplug a display cable before the kernel can finish reading
its EDID information.

I have two monitors, a HDMI cable to a BenQ GL2760H, and a Benfei USBC-to-VGA
adapter (from Amazon, dp/B076X2XS9R, IDK the chipset) to a VX720 CRT with
overridden EDID.
The CRT feeds through a VGA 4-port switch that only allows me to cycle inputs
sequentially, hence when I switch inputs sometimes I connect the CRT to my
computer for a split-second. I noticed this would trigger plasmashell crashes.

OBSERVED RESULT
Background: I found that Linux labels the HDMI port as DP-1, and USB-C alt mode
(to VGA) as DP-2.

If I briefly plug the CRT (which is not enabled) into the DAC and unplug the
VGA side (the DAC remains in the computer), the kernel and kwin can't read the
EDID, plasmashell and/or powerdevil crash.

Aug 29 20:46:35 ivy-fedora kernel: i915 0000:00:02.0: [drm] *ERROR* Failed to
read DPCD register 0x92
Aug 29 20:46:36 ivy-fedora kwin_wayland[1953]: kwin_wayland_drm: Could not find
edid for connector DrmConnector(id=112, gpu="/dev/dri/card1", name="DP-2",
connection="Connected", countMode=5)
Aug 29 20:46:38 ivy-fedora plasmashell[78388]: not a valid new object id
(4278190122), message data_offer(n)
Aug 29 20:46:38 ivy-fedora plasmashell[78388]: The Wayland connection
experienced a fatal error: Invalid argument
Aug 29 20:46:38 ivy-fedora systemd[1639]: plasma-plasmashell.service: Main
process exited, code=exited, status=255/EXCEPTION

(I tried attaching gdb to plasmashell, but it did not break on the Wayland
error site leading to program termination.)

----

If I plug and unplug the LCD's HDMI cable (I think the kernel reads the EDID,
and KDE tries switching from the CRT to LCD), kwin itself crashes.

(filtered journal:)
Aug 29 20:57:40 ivy-fedora kwin_wayland[1953]: kwin_wayland_drm: Atomic modeset
test failed! Invalid argument
Aug 29 20:57:40 ivy-fedora kwin_wayland[1953]: kwin_wayland_drm: Atomic modeset
test failed! Invalid argument
Aug 29 20:57:40 ivy-fedora kwin_wayland[1953]: kwin_xwl: Could not find a
matching X RandR CRTC/output to set as primary for
KWin::DrmOutput(0x555cc48d8950, name="DP-1", geometry=QRect(0,0 1920x1080),
scale=1)
Aug 29 20:57:41 ivy-fedora audit[1953]: ANOM_ABEND auid=1000 uid=1000 gid=1000
ses=3 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=1953
comm="kwin_wayland" exe="/usr/bin/kwin_wayland" sig=11 res=1
Aug 29 20:57:41 ivy-fedora kwin_wayland[1953]: kwin_xwl: Could not find a
matching X RandR CRTC/output to set as primary for
KWin::DrmOutput(0x555cc2b5e8d0, name="DP-2", geometry=QRect(0,0 1152x864),
scale=1)
Aug 29 20:57:41 ivy-fedora kwin_wayland_wrapper[1953]: KCrash: Application
'kwin_wayland' crashing... crashRecursionCounter = 2
Aug 29 20:57:41 ivy-fedora kwin_wayland[1953]: kwin_xwl: Could not find a
matching X RandR CRTC/output to set as primary for
KWin::DrmOutput(0x555cc2b5e8d0, name="DP-2", geometry=QRect(0,0 1152x864),
scale=1)
Aug 29 20:57:41 ivy-fedora kwin_wayland[1953]: kwin_xwl: Could not find a
matching X RandR CRTC/output to set as primary for
KWin::DrmOutput(0x555cc2b5e8d0, name="DP-2", geometry=QRect(0,0 1152x864),
scale=1)
Aug 29 20:57:41 ivy-fedora kwin_wayland[1953]: kwin_xwl: Could not find a
matching X RandR CRTC/output to set as primary for
KWin::DrmOutput(0x555cc2b5e8d0, name="DP-2", geometry=QRect(0,0 1152x864),
scale=1)
Aug 29 20:57:41 ivy-fedora systemd-coredump[80628]: Process 1953 (kwin_wayland)
of user 1000 terminated abnormally with signal 11/SEGV, processing...

backtrace:
Thread 1 (Thread 0x7f9cbfb17300 (LWP 1953)):
[KCrash Handler]
#4  0x00007f9cc8fd6f89 in
KWin::ColorManagementOutputV1::ColorManagementOutputV1 (this=0x7f9c91709c70,
client=<optimized out>, id=<optimized out>, version=<optimized out>,
output=0x0) at
/usr/src/debug/kwin-6.4.4-2.fc42.x86_64/src/wayland/colormanagement_v1.cpp:580
#5  KWin::ColorManagerV1::wp_color_manager_v1_get_output (this=<optimized out>,
resource=<optimized out>, id=<optimized out>, output=<optimized out>) at
/usr/src/debug/kwin-6.4.4-2.fc42.x86_64/src/wayland/colormanagement_v1.cpp:63
#6  0x00007f9cc42cd056 in ffi_call_unix64 () at ../src/x86/unix64.S:104
#7  0x00007f9cc42c8d08 in ffi_call_int (cif=cif@entry=0x7ffdd4978d40,
fn=fn@entry=0x7f9cc90ee510
<QtWaylandServer::wp_color_manager_v1::handle_get_output(wl_client*,
wl_resource*, unsigned int, wl_resource*)>, rvalue=<optimized out>,
rvalue@entry=0x0, avalue=avalue@entry=0x7ffdd4978e10,
closure=closure@entry=0x0) at ../src/x86/ffi64.c:673
#8  0x00007f9cc42cb70e in ffi_call (cif=cif@entry=0x7ffdd4978d40,
fn=0x7f9cc90ee510
<QtWaylandServer::wp_color_manager_v1::handle_get_output(wl_client*,
wl_resource*, unsigned int, wl_resource*)>, rvalue=rvalue@entry=0x0,
avalue=avalue@entry=0x7ffdd4978e10) at ../src/x86/ffi64.c:710
#9  0x00007f9cc7012440 in wl_closure_invoke
(closure=closure@entry=0x555cc39033f0, target=<optimized out>,
target@entry=0x555cc2ecf610, opcode=opcode@entry=1, data=<optimized out>,
data@entry=0x555cc30a7180, flags=2) at ../src/connection.c:1241
#10 0x00007f9cc7017aa0 in wl_client_connection_data (fd=<optimized out>,
mask=<optimized out>, data=<optimized out>) at ../src/wayland-server.c:483
#11 0x00007f9cc7015f42 in wl_event_loop_dispatch (loop=0x555cc17cbeb0,
timeout=<optimized out>) at ../src/event-loop.c:1059
#12 0x00007f9cc8fe3669 in KWin::Display::dispatchEvents (this=<optimized out>)
at /usr/src/debug/kwin-6.4.4-2.fc42.x86_64/src/wayland/display.cpp:138
#13 0x00007f9cc5f657ba in QtPrivate::QSlotObjectBase::call
(this=0x555cc28ee4c0, r=0x555cc17e7430, a=0x7ffdd4979420) at
/usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qobjectdefs_impl.h:461
#14 doActivate<false> (sender=0x555cc2a86e20, signal_index=3,
argv=argv@entry=0x7ffdd4979420) at
/usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qobject.cpp:4146
#15 0x00007f9cc5f5c089 in QMetaObject::activate
(sender=sender@entry=0x555cc1792a50, m=m@entry=0x7f9cc64a3f00,
local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffdd4979420)
at
/usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qobject.cpp:4206
#16 0x00007f9cc5f74593 in QMetaObject::activate<void, QSocketDescriptor,
QSocketNotifier::Type, QSocketNotifier::QPrivateSignal> (sender=0x555cc1792a50,
mo=0x7f9cc64a3f00, local_signal_index=0, ret=0x0) at
/usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qobjectdefs.h:306
#17 QSocketNotifier::activated (this=this@entry=0x555cc2a86e20, _t1=...,
_t2=<optimized out>, _t3=...) at
/usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/redhat-linux-build/src/corelib/Core_autogen/include/moc_qsocketnotifier.cpp:161
#18 0x00007f9cc5f74d6b in QSocketNotifier::event (this=0x555cc2a86e20,
e=<optimized out>) at
/usr/src/debug/qt6-qtbase-6.9.1-1.fc42.x86_64/src/corelib/kernel/qsocketnotifier.cpp:327
(...trimmed)

EXPECTED RESULT
No crash.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
Kernel Version: 6.15.10-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-8559U CPU @ 2.70GHz
Memory: 16 GiB of RAM (15.5 GiB usable)
Graphics Processor: Intel® Iris® Plus Graphics 655
Manufacturer: Intel(R) Client Systems
Product Name: NUC8i7BEH
System Version: J72992-303

ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to