Bug 389551 - kwin_wayland crash when monitor is switched off (or input is changed)
Summary: kwin_wayland crash when monitor is switched off (or input is changed)
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (show other bugs)
Version: 5.11.95
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 390234 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-01-28 13:12 UTC by Greg White
Modified: 2020-01-08 09:12 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:
mgraesslin: Wayland+
mgraesslin: X11-


Attachments
Backtrace of kwin_wayland crash (2.44 KB, text/plain)
2018-02-23 06:10 UTC, Daniel Schaal
Details
Backtrace of ksmserver crash (8.43 KB, text/plain)
2018-02-23 06:11 UTC, Daniel Schaal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg White 2018-01-28 13:12:37 UTC
kwin_wayland crashes and session is killed when monitor is switched off or when monitor's input is changed to another source.

The error produced is "running on a compositor with no screens is not supported."
Comment 1 Martin Flöser 2018-01-28 17:58:10 UTC
How exactly are you turning off the monitor? How do you change the input?
Comment 2 Greg White 2018-01-28 19:57:59 UTC
With the power button or by using the monitor's menu to switch the input from DP to HDMI.
Comment 3 Greg White 2018-01-28 20:00:10 UTC
Just verified it also reproduces with kwin and the current git head, and that it also reproduces if you simply unplug the cable.
Comment 4 Greg White 2018-01-28 20:39:33 UTC
KWin Support Information:
The following information should be used when requesting support on e.g. http://forum.kde.org.
It provides information about the currently running instance, which options are used,
what OpenGL driver and which effects are running.
Please post the information provided underneath this introductory text to a paste bin service
like http://paste.kde.org instead of pasting into support threads.

==========================

Version
=======
KWin version: 5.12.80
Qt Version: 5.10.0
Qt compile version: 5.10.0
XCB compile version: 1.12

Operation Mode: Xwayland

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_INPUT: yes
HAVE_DRM: yes
HAVE_GBM: yes
HAVE_X11_XCB: yes
HAVE_EPOXY_GLX: yes
HAVE_WAYLAND_EGL: yes

X11
===
Vendor: The X.Org Foundation
Vendor Release: 11906000
Protocol Version/Revision: 11/0
SHAPE: yes; Version: 0x11
RANDR: yes; Version: 0x14
DAMAGE: yes; Version: 0x11
Composite: yes; Version: 0x4
RENDER: yes; Version: 0xb
XFIXES: yes; Version: 0x50
SYNC: yes; Version: 0x31
GLX: yes; Version: 0x0

Decoration
==========
Plugin: org.kde.breeze
Theme: 
Blur: 0
onAllDesktopsAvailable: false
alphaChannelSupported: true
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 0, 2
decorationButtonsRight: 6, 3, 4, 5
borderSize: 2
gridUnit: 16
font: Noto Sans,10,-1,5,50,0,0,0,0,0,Regular
smallSpacing: 4
largeSpacing: 16

Platform
==========
Name: DRM
Active: true
Atomic Mode Setting: false

Options
=======
focusPolicy: 0
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
placement: 4
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: true
focusStealingPreventionLevel: 1
legacyFullscreenSupport: false
operationTitlebarDblClick: 5000
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: 0
commandActiveTitlebar2: 30
commandActiveTitlebar3: 2
commandInactiveTitlebar1: 4
commandInactiveTitlebar2: 30
commandInactiveTitlebar3: 2
commandWindow1: 7
commandWindow2: 8
commandWindow3: 8
commandWindowWheel: 31
commandAll1: 10
commandAll2: 3
commandAll3: 14
keyCmdAllModKey: 16777251
showGeometryTip: false
condensedTitle: false
electricBorderMaximize: false
electricBorderTiling: false
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
inactiveTabsSkipTaskbar: false
autogroupSimilarWindows: false
autogroupInForeground: true
compositingMode: 1
useCompositing: true
compositingInitialized: true
hiddenPreviews: 1
glSmoothScale: 1
xrenderSmoothScale: false
maxFpsInterval: 16666666
refreshRate: 0
vBlankTime: 6000000
glStrictBinding: false
glStrictBindingFollowsDriver: true
glCoreProfile: true
glPreferBufferSwap: 101
glPlatformInterface: 2
windowsBlockCompositing: true

Screen Edges
============
desktopSwitching: false
desktopSwitchingMovingClients: false
cursorPushBackDistance: 1x1
timeThreshold: 150
reActivateThreshold: 350
actionTopLeft: 0
actionTop: 0
actionTopRight: 0
actionRight: 0
actionBottomRight: 0
actionBottom: 0
actionBottomLeft: 0
actionLeft: 0

Screens
=======
Multi-Head: no
Active screen follows mouse:  no
Number of Screens: 1

Screen 0:
---------
Name: DEL DP-1-DELL P2715Q/32R1F4CR361L
Geometry: 0,0,3840x2160
Scale: 1
Refresh Rate: 59.997


Compositing
===========
Compositing is active
Compositing Type: OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Radeon RX 550 Series (POLARIS12 / DRM 3.23.0 / 4.15.0-rc9-GTW1+, LLVM 5.0.1)
OpenGL version string: 4.5 (Core Profile) Mesa 17.3.3
OpenGL platform interface: EGL
OpenGL shading language version string: 4.50
Driver: Unknown
GPU class: Unknown
OpenGL version: 4.5
GLSL version: 4.50
Mesa version: 17.3.3
Linux kernel version: 4.15
Direct rendering: Requires strict binding: no
GLSL shaders:  yes
Texture NPOT support:  yes
Virtual Machine:  no
OpenGL 2 Shaders are used
Painting blocks for vertical retrace:  no

Loaded Effects:
---------------
zoom
kwin4_effect_morphingpopups
kwin4_effect_maximize
kwin4_effect_frozenapp
kwin4_effect_logout
kwin4_effect_translucency
kwin4_effect_dialogparent
kwin4_effect_fade
slidingpopups
wobblywindows
screenshot
magiclamp
colorpicker
presentwindows
highlightwindow
blur
startupfeedback
kscreen

Currently Active Effects:
-------------------------
blur

Effect Settings:
----------------
zoom:
zoomFactor: 1.2
mousePointer: 0
mouseTracking: 0
enableFocusTracking: false
followFocus: true
focusDelay: 350
moveFactor: 20
targetZoom: 1

kwin4_effect_morphingpopups:

kwin4_effect_maximize:

kwin4_effect_frozenapp:

kwin4_effect_logout:

kwin4_effect_translucency:

kwin4_effect_dialogparent:

kwin4_effect_fade:

slidingpopups:
fadeInTime: 150
fadeOutTime: 250

wobblywindows:
stiffness: 0.08
drag: 0.9
moveFactor: 0.1
xTesselation: 20
yTesselation: 20
minVelocity: 0
maxVelocity: 1000
stopVelocity: 0.5
minAcceleration: 0
maxAcceleration: 1000
stopAcceleration: 0.5
moveEffectEnabled: true
openEffectEnabled: false
closeEffectEnabled: false
moveWobble: true
resizeWobble: true

screenshot:

magiclamp:
animationDuration: 200

colorpicker:

presentwindows:
layoutMode: 0
showCaptions: true
showIcons: true
doNotCloseWindows: false
ignoreMinimized: false
accuracy: 20
fillGaps: true
fadeDuration: 150
showPanel: false
leftButtonWindow: 1
rightButtonWindow: 2
middleButtonWindow: 0
leftButtonDesktop: 2
middleButtonDesktop: 0
rightButtonDesktop: 0

highlightwindow:

blur:

startupfeedback:
type: 1

kscreen:
Comment 5 Martin Flöser 2018-02-10 20:24:41 UTC
*** Bug 390234 has been marked as a duplicate of this bug. ***
Comment 6 Martin Flöser 2018-02-11 08:29:53 UTC
Some explanation: when initially implementing the DRM platform I operated on the assumption that there is always at least one screen. Not having any screens doesn't make much sense as there is nothing to render to.

And that kind of still holds. If we remove all screens, the wayland outputs get removed and we run into issues in the clients. They would start to destroy windows, terminate, crash - anything is possible.

What is a possibility would be to add a fake screen with the same dimension than the last unplugged screen.
Comment 7 Pieter David 2018-02-12 09:07:11 UTC
In my case one screen does stay connected at all time... but I just tried again, and it turns out that I can disable the external monitor without problem, I only get the crash when disabling the screen of my laptop. Maybe the problem is with disabling the "first" screen?
Comment 8 Daniel Schaal 2018-02-23 06:10:50 UTC
Created attachment 110919 [details]
Backtrace of kwin_wayland crash

Trying to turn of my laptop monitor and only having an external monitor active, kwin_wayland crashes and leaves the attached backtrace. (Not sure if related, but shortly before kwin_wayland crashes, ksmserver also crashes)

This is on Debian unstable, with kwin 5.12.1 and Qt 5.9.2
Comment 9 Daniel Schaal 2018-02-23 06:11:20 UTC
Created attachment 110920 [details]
Backtrace of ksmserver crash
Comment 10 Martin Kostolný 2018-03-08 16:40:03 UTC
I'm experiencing a kwin_wayland crash when disconnecting external monitor which is set as primary (and placed above internal laptop monitor). My laptop monitor is always active. I believe it can be related to this issue.

This is not always reproducible though. It usually happen when multiple windows are opened but I cannot provide anything 100%.

Stupid question: please tell me how to get backtrace from crashed kwin_wayland. Run ksmserver with gdb somehow? Thanks!
Comment 11 Timo Kalliomäki 2018-11-14 10:39:37 UTC
Still present on Debian testing with version 5.13.5/Qt 5.11.2. Starting with a ”screen extended to both monitors” state under Wayland and then switching laptop monitor to ”disabled” in KScreen causes a crash.

(Also, bug 390306 might be a duplicate of this one?)
Comment 12 Daniel Schaal 2019-02-16 08:13:56 UTC
Just tested this again and turning off my laptop display doesn't lead to a crash anymore (using current Debian unstable with KDE 5.14.5/Qt 5.11.3)
Comment 13 Roman Gilg 2020-01-08 09:12:01 UTC
Git commit 2632e4182c658178af82be175575b094002468af by Roman Gilg.
Committed on 08/01/2020 at 09:12.
Pushed by romangilg into branch 'master'.

[platforms/drm] Allow running without outputs

Summary:
Set outputs enablement also when none outputs are present. This patch is
similar to earlier attempt at D17985.
Related: bug 402827, bug 398680, bug 413758

Test Plan:
Starting without outputs, manual disconnects and DPMS changes. There is still
an issue when an output gets disconnected while the DPMS is off. But it's an
improvement already.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T10016

Differential Revision: https://phabricator.kde.org/D26511

M  +2    -6    plugins/platforms/drm/drm_backend.cpp

https://commits.kde.org/kwin/2632e4182c658178af82be175575b094002468af