Enerccio / ewlc

Wayland compositor library - extended
MIT License
20 stars 3 forks source link

x11 crashes when switching from the wlc vt back to x11 vt #78

Open WLCIssuesBot opened 7 years ago

WLCIssuesBot commented 7 years ago

Issue by raboof Thursday Dec 29, 2016 at 16:45 GMT Originally opened as https://github.com/Cloudef/wlc/issues/217


When running a wlc-based session on vt1 and x11 on vt7, using nouveau as the display driver, switching from vt1 to vt7 crashes x11. The Xorg.log reveals:

modeset(0): drmSetMaster failed: Invalid argument
modeset(0): failed to set mode: Permission denied

It seems only one program can be DRM master at a time, and the wlc-based session hasn't given up its control before nouveau tried to get it. Indeed, when I switch from vt1 to vt2 (giving it time to release DRM master) and then to vt7, x11 does not crash.

In the wlc sources I do see some drmDropMaster in sensible places, but looking with gdb it doesn't seem to be ever called - not even in the 'successful' case where I go via vt2.

(I originally encountered this issue with way-cooler (https://github.com/Immington-Industries/way-cooler/issues/190) but can also reproduce it with orbment, leading to think this is a wlc issue)

WLCIssuesBot commented 7 years ago

Comment by Cloudef Wednesday Jan 04, 2017 at 08:34 GMT


In the wlc sources I do see some drmDropMaster in sensible places, but looking with gdb it doesn't seem to be ever called - not even in the 'successful' case where I go via vt2.

This sounds interesting. AFAIK the calls should always be before TTY switch signal is sent to kernel.

WLCIssuesBot commented 7 years ago

Comment by raboof Wednesday Jan 04, 2017 at 09:01 GMT


I did some more digging but don't have final conclusions yet.

I'm using logind, wlc correctly sees that and goes into the logind code instead of the tty code.

Looking at the logind code (and learning about VT switching :) ) I see some code that looks like it should do the right thing, but poking around with gdb/printf statements reveals in my case this code doesn't seem to be called at all.

I'm still kind of confused what's going on, I wrote up my observations and asked for help at https://plus.google.com/110534994903711886928/posts/GgVKKtU5d1u