Bug 489458

Summary: Plasmashell 6.1 segfault on wayland usb-c docking/undocking on QtWaylandClient::QWaylandWindow::devicePixelRatio
Product: [I don't know] kde Reporter: François <fanf42>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED DUPLICATE    
Severity: crash CC: fanf42, nate
Priority: NOR Keywords: wayland
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description François 2024-06-29 19:33:51 UTC
***
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

(opening that issue as asked in https://discuss.kde.org/t/plasmashell-6-1-segfault-on-wayland-usb-c-docking-undocking/17783/1)

I’m on archlinux and KDE6/wayland since beta release late february. Things were working mostly OK.
A week or two ago, I updated to KDE6.1 stack.

Since then, I have a crash almost each time I plug or unplug my usb-c dock. KDE is telling me it’s the culprit with a crash pop-up and that stack trace :


```
#0  0x00007dbc95ca8e44 in ?? () from /usr/lib/libc.so.6
#1  0x00007dbc95c50a30 in raise () from /usr/lib/libc.so.6
#2  0x00007dbc98b50643 in KCrash::defaultCrashHandler(int) () from /usr/lib/libKF6Crash.so.6
#3  <signal handler called>
#4  0x00007dbc971a540b in QtWaylandClient::QWaylandWindow::devicePixelRatio() const () from /usr/lib/libQt6WaylandClient.so.6
#5  0x00007dbc8f1cff0c in QtWaylandClient::QWaylandEglWindow::updateSurface(bool) ()
   from /usr/lib/qt6/plugins/wayland-graphics-integration-client/../../../libQt6WaylandEglClientHwIntegration.so.6
#6  0x00007dbc8f1d0905 in QtWaylandClient::QWaylandGLContext::makeCurrent(QPlatformSurface*) ()
   from /usr/lib/qt6/plugins/wayland-graphics-integration-client/../../../libQt6WaylandEglClientHwIntegration.so.6
#7  0x00007dbc96cadc28 in QOpenGLContext::makeCurrent(QSurface*) () from /usr/lib/libQt6Gui.so.6
#8  0x00007dbc96e6f112 in ?? () from /usr/lib/libQt6Gui.so.6
#9  0x00007dbc97c18647 in ?? () from /usr/lib/libQt6Quick.so.6
#10 0x00007dbc97c19f9a in ?? () from /usr/lib/libQt6Quick.so.6
#11 0x00007dbc964c9747 in ?? () from /usr/lib/libQt6Core.so.6
#12 0x00007dbc95ca6ded in ?? () from /usr/lib/libc.so.6
#13 0x00007dbc95d2a0dc in ?? () from /usr/lib/libc.so.6
```


STEPS TO REPRODUCE

I'm not sure how to reproduce it. It's not systematic. It looks like it happens more systematically if the laptop lid was closed (and so sleeping) when I plug/unplug. 
Each time it happens, there's at least: 

1. laptop was connected to an external usb-c 4 dock
2. I unplug the usb-c cable
3. KDE desktop flickers and a pop-up informs me of a crash. Sometime, some windows remain open

OBSERVED RESULT

There's a crash

EXPECTED RESULT

I can plug or unplug the laptop to/from the usb-c dock without a crash. 

SOFTWARE/OS VERSIONS
linux 6.9.6.arch1-1

wayland 1.23.0-1
wayland-protocols 1.36-1
wayland-utils 1.2.0-1
xorg-xwayland 24.1.0-1

kwayland 6.1.0-1
qt5-wayland 5.15.14+kde+r58-1
qt6-wayland 6.7.2-1

libplasma 6.1.0-1

ADDITIONAL INFORMATION

I configured KDE to switch primary screen to the external monitor, and my laptop screen has a different resolution that my externals screens (1920x1200 for the laptop, 1920x1080 for the screen). This looks like it kind be relevant since the crash seems to happens somewhere where display ratio are at play. 

The fact that I use several external monitor with different usb-c dock *might* be a relation, because usb-c docks are just chaotic evil aligned. I saw different behavior on the same dock depending if a windows laptop was pluged before mine, so I accept anything here.
Comment 1 Nate Graham 2024-07-02 20:00:52 UTC

*** This bug has been marked as a duplicate of bug 489180 ***