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.
fixed in current: Markus Friedl commited this patch ages ago (last year)
*** Bug 121 has been marked as a duplicate of this bug. ***
Mass change of RESOLVED bugs to CLOSED