System Freeze When consoled Closes Keyboard FD
|Reported by:||bonefish||Owned by:||axeld|
|Has a Patch:||no||Platform:||x86|
With hrev20135 the problem can be reproduced by running
consoled /bin/sh --login
in a terminal and "exit" the shell started in consoled. consoled's main thread eventually tries to close the FD for the keyboard ("/dev/keyboard"). At that point the system visually freezes (no more mouse moves, the Deskbar time is not updated).
Entering KDL via F12 still worked. Everytime I did that, consoled's keyboard reader thread (performing a read() on the keyboard FD) was in state running. A stack crawl showed it to be in the keyboard driver in keyboard_read() somewhere in the "retry:" endless loop (different locations: mutex_lock()/unlock(), acquire_sem_etc()).
At the same time consoled's main thread (performing the close() on the keyboard FD) was shown to be in state ready. A stack trace located it in the keyboard driver in keyboard_close() in delete_sem(). continuing the system and re-entering KDL later did not advance the position of the main thread any further.
Tested in VMWare.