Bug 1010 - SSH sometimes hangs on exit when multiple forwarded X11 clients are closed
Summary: SSH sometimes hangs on exit when multiple forwarded X11 clients are closed
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 4.0p1
Hardware: All Linux
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-06 06:38 AEST by Tomas Mraz
Modified: 2008-07-22 12:07 AEST (History)
1 user (show)

See Also:


Attachments
Proposed patch (472 bytes, patch)
2005-04-06 06:41 AEST, Tomas Mraz
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Mraz 2005-04-06 06:38:47 AEST
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.
Comment 1 Tomas Mraz 2005-04-06 06:41:59 AEST
Created attachment 868 [details]
Proposed patch

This patch solves the problem for me however I'm not sure if it's completely
correct.
Comment 2 Damien Miller 2008-06-13 13:42:57 AEST
I can't replicate this with -current. Could you please try a snapshot to see if you can replicate the bug?
Comment 3 Tomas Mraz 2008-06-13 18:59:07 AEST
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.
Comment 4 Damien Miller 2008-07-22 12:07:21 AEST
Mass update RESOLVED->CLOSED after release of openssh-5.1