Comment 14 for bug 373961

Revision history for this message
fuzzyBSc (benjamincarlyle-soundadvice) wrote :

Ok. I have a workaround in code, and remain confident that the root cause is switching virtual terminals while a key is being pressed or has just been pressed causing a keyboard repeat.
I modified gdmopen.c and getvt.c. Wherever I saw the ioctl to switch virtual terminals (VT_ACTIVATE) I added a sleep(1) beforehand. My theory is that this places additional time between my enter key press and the virtual terminal switch, possibly allowing a keyup event to come through. The result for me is that this switches from a 100% occurrence to a 0% occurrence.
My conclusion is that either the ioctl handling or the x-server handling of keystrokes is wrong somewhere, which is further than I think I can take this myself. My workaround could be included trivially in gdm, but I don't think it is an optimal solution.
I would request that whoever this bug ends up with carefully walks through the steps to reproduce. If it can't be reproduced then we can perhaps compare notes as to which x-server is in use, etc. Perhaps it is something unique to my hardware configuration. However, I don't at this stage see any reason why this should be unique to my machine. I suspect any machine with a similar set of software running will experience this if the fast user switch is being used frequently.
Again, the steps to reproduce are:
1. Log in as user 1 on a freshly-booted machine
2. Fast user switch to user 2 without logging out
3. Fast user switch back to user 1 without logging out
4. Log out of user 1 only
5. Note that user 2 is still logged in, but we have returned to the gdm prompt. This is the starting condition for the bug, and always happens for me from this point regardless of how I got here.
6. Enter the login details of user 2, leading to a virtual terminal switch to the still-running user 2 session while gdm continues to run on its own virtual terminal
7. Observe the drumming sound as gdm repeatedly tries to log in with an empty user name and password string. The cycle is approximately 2s, the time that gdm pauses between user login retries

Available workarounds:
* Patch gdm as indicated, adding a sleep before any virtual terminal switch ioctls (ie VT_ACTIVATE)
* or Ctrl+Alt+F-whatever to get back to the virtual terminal that is stuck in a login cycle. This stops the repeating keystrokes and halts the login cycle until the next time you enter the login details of a user who already has a running session on a different virtual terminal.

Thanks.