Bug 460188

Summary: Switching out displays via xrandr crashes plasmashell
Product: [Plasma] plasmashell Reporter: miranda
Component: generic-multiscreenAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: crash CC: aleixpol, kde, miranda, nate, nicolas.fella, notmart
Priority: NOR    
Version First Reported In: master   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Stack trace for plasmashell

Description miranda 2022-10-10 03:53:02 UTC
Created attachment 152680 [details]
Stack trace for plasmashell

SUMMARY
When attempting to switch out displays via xrandr (as in, disabling what's enabled and enabling what's disabled), plasmashell hits a plasma-workspace assertion error and causes a crash+coredump


STEPS TO REPRODUCE
1. Have more than one display
2. Have at least one display disabled
3. Switch out the displays via xrandr. For example:


```
xrandr --output DP-2 --off
xrandr --output HDMI-1 --mode 3840x2160 --rate 120.00
```

OBSERVED RESULT
Plasmashell crashes

EXPECTED RESULT
Plasmashell does not crash

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.26.80
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
Kernel Version: 5.19.13-arch1-1 (64-bit)
Graphics Platform: X11
Mesa Version: 22.1.7

Attached is the relevant stacktrace, as it's rather long, but here's the initial assertion error:

```
Oct 09 19:50:06 melchior kscreen_backend_launcher[1145]: kscreen.xrandr: Emitting configChanged()
Oct 09 19:50:06 melchior plasmashell[4108]: Trying to use rootObject before initialization is completed, whilst using setInitializationDelayed. Forcing completion
Oct 09 19:50:06 melchior plasmashell[4108]: kf.service.services: The desktop entry file "" has Type= "Application" but no Exec line
Oct 09 19:50:06 melchior plasmashell[4108]: ASSERT: "view->containment()->screen() == id || view->containment()->screen() == -1" in file /home/<username>/.cache/yay/plasma-workspace-git/src/plasma-workspace/shell/shellcorona.cpp, line 800
Oct 09 19:50:06 melchior plasmashell[4108]: 25 -- exe=/usr/bin/plasmashell
Oct 09 19:50:06 melchior plasmashell[4108]: 13 -- platform=xcb
Oct 09 19:50:06 melchior plasmashell[4108]: 11 -- display=:0
Oct 09 19:50:06 melchior plasmashell[4108]: 20 -- appname=plasmashell
Oct 09 19:50:06 melchior plasmashell[4108]: 17 -- apppath=/usr/bin
Oct 09 19:50:06 melchior plasmashell[4108]: 9 -- signal=6
Oct 09 19:50:06 melchior plasmashell[4108]: 9 -- pid=4108
Oct 09 19:50:06 melchior plasmashell[4108]: 19 -- appversion=5.26.80
Oct 09 19:50:06 melchior plasmashell[4108]: 19 -- programname=Plasma
Oct 09 19:50:06 melchior plasmashell[4108]: 31 -- bugaddress=submit@bugs.kde.org
Oct 09 19:50:06 melchior plasmashell[4108]: 12 -- startupid=0
Oct 09 19:50:06 melchior plasmashell[4108]: KCrash: crashing... crashRecursionCounter = 2
Oct 09 19:50:06 melchior plasmashell[4108]: KCrash: Application Name = plasmashell path = /usr/bin pid = 4108
Oct 09 19:50:06 melchior plasmashell[4108]: KCrash: Arguments: /usr/bin/plasmashell --no-respawn
Oct 09 19:50:06 melchior plasmashell[4108]: KCrash: Attempting to start /usr/lib/drkonqi
Oct 09 19:50:06 melchior kwin_x11[913]: kwin_core: Failed to focus 0x4000b0 (error 3)
Oct 09 19:50:06 melchior kwin_x11[913]: kwin_core: Failed to focus 0x4000b0 (error 3)
Oct 09 19:50:06 melchior kwin_x11[913]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 14317, resource id: 4194333, major code: 15 (QueryTree), minor code: 0
Oct 09 19:50:06 melchior kwin_x11[913]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 14338, resource id: 4194480, major code: 15 (QueryTree), minor code: 0
Oct 09 19:50:06 melchior kwin_x11[913]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 14346, resource id: 4194423, major code: 15 (QueryTree), minor code: 0
Oct 09 19:50:06 melchior kwin_x11[913]: qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 14353, resource id: 4194365, major code: 15 (QueryTree), minor code: 0
Oct 09 19:50:06 melchior kded5[912]: Service  "org.kde.StatusNotifierHost-4108" unregistered
Oct 09 19:50:06 melchior kded5[912]: org.kde.plasma.dataengine.geolocation: gpsd not found
Oct 09 19:50:06 melchior kded5[912]: "location"
Oct 09 19:50:07 melchior plasmashell[4108]: Unable to start Dr. Konqi
Oct 09 19:50:07 melchior plasmashell[4108]: Re-raising signal for core dump handling.
```
Comment 1 Nicolas Fella 2022-10-10 10:30:25 UTC
#0  0x00007f38a94a6688 pthread_sigmask (libc.so.6 + 0x8d688)
#1  0x00007f38a9451bfd sigprocmask (libc.so.6 + 0x38bfd)
#2  0x00007f38abe24967 _ZN6KCrash15setCrashHandlerEPFviE (libKF5Crash.so.5 + 0x4967)
#3  0x00007f38abe257d9 _ZN6KCrash19defaultCrashHandlerEi (libKF5Crash.so.5 + 0x57d9)
#4  0x00007f38a9451a00 n/a (libc.so.6 + 0x38a00)
#5  0x00007f38a94a164c n/a (libc.so.6 + 0x8864c)
#6  0x00007f38a9451958 raise (libc.so.6 + 0x38958)
#7  0x00007f38a943b53d abort (libc.so.6 + 0x2253d)
#8  0x00007f38a9a9fede _ZNK14QMessageLogger5fatalEPKcz (libQt5Core.so.5 + 0x9fede)
#9  0x00007f38a9a9ff3c _Z9qt_assertPKcS0_i (libQt5Core.so.5 + 0x9ff3c)
#10 0x000055666a9f00cd n/a (plasmashell + 0x220cd)
#11 0x00007f38a9cbd381 n/a (libQt5Core.so.5 + 0x2bd381)
#12 0x00007f38a9cbf8df _ZN6QTimer7timeoutENS_14QPrivateSignalE (libQt5Core.so.5 + 0x2bf8df)
#13 0x00007f38a9cb04c6 _ZN7QObject5eventEP6QEvent (libQt5Core.so.5 + 0x2b04c6)
#14 0x00007f38aa978b1c _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5 + 0x178b1c)
#15 0x00007f38a9c8cb88 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5 + 0x28cb88)
#16 0x00007f38a9cd6d53 _ZN14QTimerInfoList14activateTimersEv (libQt5Core.so.5 + 0x2d6d53)
#17 0x00007f38a9cd7392 n/a (libQt5Core.so.5 + 0x2d7392)
#18 0x00007f38a827081b g_main_context_dispatch (libglib-2.0.so.0 + 0x5581b)
#19 0x00007f38a82c6ec9 n/a (libglib-2.0.so.0 + 0xabec9)
#20 0x00007f38a826f0d2 g_main_context_iteration (libglib-2.0.so.0 + 0x540d2)
#21 0x00007f38a9cd750c _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2d750c)
#22 0x00007f38a9c8532c _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x28532c)
#23 0x00007f38a9c8fe59 _ZN16QCoreApplication4execEv (libQt5Core.so.5 + 0x28fe59)
#24 0x000055666a9f2446 n/a (plasmashell + 0x24446)
#25 0x00007f38a943c290 n/a (libc.so.6 + 0x23290)
#26 0x00007f38a943c34a __libc_start_main (libc.so.6 + 0x2334a)
#27 0x000055666a9f2585 n/a (plasmashell + 0x24585)
Comment 2 Nicolas Fella 2022-10-10 10:31:50 UTC
Relevant assert:
Oct 09 19:50:06 melchior plasmashell[4108]: ASSERT: "view->containment()->screen() == id || view->containment()->screen() == -1" in file /home/<username>/.cache/yay/plasma-workspace-git/src/plasma-workspace/shell/shellcorona.cpp, line 800
Comment 3 David Edmundson 2023-01-03 11:38:34 UTC
Should be fixed in 5.27.0