SSH sometimes hangs on exit when multiple forwarded X11 clients are closed. This is not easy to reproduce however here are the steps which make it to reproduce almost 100% for me: 1. ssh -Y host 2. xsm ; exit in the ssh session 3. for i in `seq 1 50` ; do (nice -20 xterm &) ; done in the xterm which was started from xsm 4. after all the xterms are up and running shutdown immediately the xsm Expected result: ssh session ended normally What really happens: ssh session hangs After looking at the debug log from the sshd it seems that some of the X11 channels are stuck waiting for output drain however it won't happen as the other end - the xterm - already exited.
Created attachment 868 [details] Proposed patch This patch solves the problem for me however I'm not sure if it's completely correct.
I can't replicate this with -current. Could you please try a snapshot to see if you can replicate the bug?
I cannot reproduce the problem anymore although I am not 100% sure it was fixed. I am now running completely different HW setup (more powerfull of course) so the race might not happen on it anymore, also the kernel is now 2.6.24... instead of 2.6.9 so that might also affect the race. But let's close it worksforme, I can reopen it later if it appears again.
Mass update RESOLVED->CLOSED after release of openssh-5.1