Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VT switching is broken #373

Closed
AlanGriffiths opened this issue May 17, 2018 · 8 comments
Closed

VT switching is broken #373

AlanGriffiths opened this issue May 17, 2018 · 8 comments
Assignees
Labels

Comments

@AlanGriffiths
Copy link
Collaborator

On Bionic and Artful using ppa:mir-team/dev, or ppa:mir-team/release

  1. run miral-desktop
  2. Ctrl-Alt-F2 switches back to VT2
  3. Ctrl-Alt-F4

Expect: switch back to VT4
Actual: nothing, and now input doesn't work at all

@AlanGriffiths
Copy link
Collaborator Author

Actually, using Mir 0.28 from the Artful archive I still see this.

I don't think this can be simply a Mir issue, we'd have seen it long ago.

@gerboland
Copy link
Contributor

gerboland commented May 17, 2018

I can repro on 18.04 and Mir 0.31.1

Watching logs as I VT switch: https://pastebin.ubuntu.com/p/P9gCGnZPRN/
GDB after hang: https://pastebin.ubuntu.com/p/25n6J9RGFw/

@wmww
Copy link
Contributor

wmww commented May 17, 2018

Fun fact: If you go [normal desktop -> Miral Desktop -> normal desktop -> another VT -> Miral Desktop] there is no problem. It doesn't if you're logged in on "another VT" or not.

@AlanGriffiths
Copy link
Collaborator Author

@RAOF I guess you are the best person to investigate this?

@RAOF
Copy link
Contributor

RAOF commented May 18, 2018 via email

@RAOF
Copy link
Contributor

RAOF commented May 21, 2018

Harumph.

Conveniently, this is a race somewhere in VT handling; if gdb stops the server upon receiving the SIGUSR1 signal everything works fine.

Presumably this means that we're trying to use something before it's been fully released by the thing we're switching from. This might actually be a bug in Xorg or logind; the switchee is meant to have released all resources from their VT switch signal already…

@RAOF
Copy link
Contributor

RAOF commented May 21, 2018

Oh, huh.

So, the problem here is that our drmSetMaster() call is falling.

Additional problems:

  • It seems that the VT subsystem doesn't properly handle failing to resume
  • There's no mechanism to refuse a switch-to, so we should be retrying for a while and then dying hard
  • We print absolutely nothing in this situation.

@AlanGriffiths
Copy link
Collaborator Author

Yes, this seems to be a race. I hacked mgm::Display::resume() with a std::this_thread::sleep_for(std::chrono::milliseconds{100}) at the top and the problem was nicely hidden. I'll try to get a PR (with production code) together later.

bors bot added a commit that referenced this issue May 22, 2018
375: Retry loop for DRM master r=RAOF a=AlanGriffiths

Retry drmSetMaster() a few times and if it doesn't work die. (Fixes #373)

Co-authored-by: Alan Griffiths <alan@octopull.co.uk>
bors bot added a commit that referenced this issue May 22, 2018
375: Retry loop for DRM master r=RAOF a=AlanGriffiths

Retry drmSetMaster() a few times and if it doesn't work die. (Fixes #373)

Co-authored-by: Alan Griffiths <alan@octopull.co.uk>
@bors bors bot closed this as completed in #375 May 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants