Bug 79

Summary: A race with select() in SIGCHLD handling causes hangs occasionally
Product: Portable OpenSSH Reporter: Nicolas Williams <Nicolas.Williams>
Component: sshdAssignee: OpenSSH Bugzilla mailing list <openssh-bugs>
Status: CLOSED FIXED    
Severity: major CC: openssh-bugs
Priority: P2    
Version: -current   
Hardware: All   
OS: All   
URL: http://marc.theaimsgroup.com/?l=openssh-unix-dev&m=100454673601558&w=2

Description Nicolas Williams 2002-01-26 04:30:17 AEDT
There's a race condition in OpenSSH (all versions - haven't checked -current)
such that if SIGCHLD arrives after the check for child_terminated, but before
entering select() (with no timeout) AND if the session's pty/pipes have
received EOF before SIGCHLD is handled, then sshd will block in select()
forever, while the client hangs waiting for the session-exit message that
will never arrive (because sshd will never send it, because it's blocking
in select()).

Markus Friedl posted a fix for it (see URL associated with this bug report).
It works. It should be applied.

Thanks.
Comment 1 Markus Friedl 2002-01-26 04:49:15 AEDT
fixed in current:
Markus Friedl commited this patch ages ago (last year)
Comment 2 Joshua Mehlman 2002-02-21 08:05:36 AEDT
*** Bug 121 has been marked as a duplicate of this bug. ***
Comment 3 Damien Miller 2004-04-14 12:24:17 AEST
Mass change of RESOLVED bugs to CLOSED