drop drm master on xserver teardown to avoid crash on VT switch
Submitted by Oliver Henshaw
Assigned to Søren Sandmann Pedersen
With the sddm display manager and the qxl driver, logging out of an x11 session can kill the x11 session session of a user who logged in earlier. This can't be reproduced on common real hardware (and all signs point to a problem with the xorg qxl driver); it can't be reproduced with gdm afaik, presumably because gdm systems use logind to mediate VT/drm-master access rather than the xserver accessing it directly.
Steps to reproduce:
- Boot to sddm (which is on vt1)
- Log in as user1 (which is on vt1)
- Switch to new session (which is on vt2); login as user2
- Log out of user2
Results: User2 logs out, and after a few seconds I'm taken to a newly spawned sddm login screen on VT1 (on kde I briefly see a white dialog from ksmserver saying "Could not start ksmserver: check your installation"). Switching vt works and loginctl shows that the user1 session is in state 'closing'. The tail of Xorg.0.log.old shows:
[ 502.491] (WW) qxl(0): drmSetMaster failed: Invalid argument [ 502.491] (EE) qxl(0): failed to set mode: Permission denied(EE) Fatal server error: [ 502.491] (EE) EnterVT failed for screen 0 [ 502.491] (EE) [ 502.491] (EE) Please consult the Fedora Project support at http://wiki.x.org for help. [ 502.491] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information. [ 502.491] (EE) [ 502.492] (WW) qxl(0): drmDropMaster failed: Invalid argument [ 502.521] (EE) Server terminated with error (1). Closing log file.
user2 logs out and the system switches to user1's session on VT1.
Installed packages: xorg-x11-server-Xorg-1.18.4-4.fc24.x86_64 libdrm-2.4.71-2.fc24.x86_64 kernel-4.8.6-201.fc24.x86_64 (this is an old test VM) xorg-x11-drv-qxl-0.1.4-7.fc24.x86_64