An agy sign-in completes once its login has stored its credential: the runner closes the login's terminal before it kills and reaps it #192
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3936-an-agy-sign-in-hangs-after-its-login-suc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracker: #3936
What it delivers
A sign-in whose login runs on a terminal now closes that terminal before it asks the runner's main thread to kill and reap the login (
terminal_login,runner/sign_in.sx). An agy sign-in then completes with its models once the home's keychain holds the login, and the runner's main thread no longer blocks in its reap.The cause
A login that has opened its terminal as its controlling one, as agy does, cannot finish exiting while output it wrote there is still unread. XNU's
proc_exitdrains a session leader's controlling terminal withttywaitatt_timeout0, which has no bound. The bounded drain of a slave's last close (ptsclose, 60 ticks) never runs here, because opening/dev/ttyholds an extra reference on the terminal until the leader's exit.Before this change, the pump thread stopped reading the terminal once the home's login script found the login. It then asked for
parent.kill()while it still held the master, and the main thread'swait(true)waited on that exit for good.Checked on s32 against the real agy 1.4.11, run on a pty with a scratch HOME and its menu shown. agy holds the terminal on fds 0, 5 and 6. Killed with a redraw left unread, it stayed
?Esfor more than 10 s while the master was open, and exited the moment the master closed. Killed with the master closed first, its reap returned in 0.06 s.Regression
tests/stub_sign_in.sh's agy login, once signed in, now stays up redrawing its screen without pause on/dev/tty, as agy's interface does.tests/sign_in.sxcheck_agychecks that the sign-in is done ("the agy sign-in is done once the home's keychain holds a login, though its login stays up redrawing its terminal"). If the sign-in still waits afterWAIT_MS, the test prints its failure and ends, removing its sandbox and the login's home. It cannot stop a channel whose main thread is held, and this way it does not hang.git archivearm, giveFAIL the agy sign-in is done …andSIGN IN FAIL (1 checks), exit 1, about 33 s, in 4 of 4 runs.sampleof the test process while it waited matched the field report:Channel.serve → __wait4;terminal_login → Parent.kill → Slot.call → _pthread_cond_wait;?Es.SIGN IN OK(101 ok) in about 7 s, in 4 of 4 runs. No stub process and no/tmp/sak-sign-in-*home was left after either arm.Gates at the head
full, tracker gate run 948 (this run's gate #1), passed ate32207a5:The change touches nothing under
web/, so it declares no golden set.An agy sign-in completes once its login has stored its credential: the runner ends the login's terminal before it waits on the killed loginto An agy sign-in completes once its login has stored its credential: the runner closes the login's terminal before it kills and reaps it