Bug 79 - A race with select() in SIGCHLD handling causes hangs occasionally
Summary: A race with select() in SIGCHLD handling causes hangs occasionally
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: -current
Hardware: All All
: P2 major
Assignee: OpenSSH Bugzilla mailing list
URL: http://marc.theaimsgroup.com/?l=opens...
Keywords:
: 121 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-01-26 04:30 AEDT by Nicolas Williams
Modified: 2004-04-14 12:24 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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