[Bug 52] ssh hangs on exit
bugzilla-daemon at mindrot.org
bugzilla-daemon at mindrot.org
Tue Nov 28 23:03:06 EST 2006
http://bugzilla.mindrot.org/show_bug.cgi?id=52
------- Comment #31 from dtucker at zip.com.au 2006-11-28 23:03 -------
(From update of attachment 1098)
The patch has not been applied, I simply pointed someone toward it.
>- FD_ISSET(c->rfd, readset)) {
>+ (c->detach_close || FD_ISSET(c->rfd, readset))) {
> len = read(c->rfd, buf, sizeof(buf));
>- if (len < 0 && (errno == EINTR || errno == EAGAIN))
>+ if (len < 0 && errno == EINTR)
I'm wondering if this could ever cause the channel to be shutdown if
the read fails with EAGAIN during normal operation.
POSIX says EAGAIN should be returned when the descriptor is set for
nonblocking IO and select should not mark the fd in that case so this
shouldn't happen.
On the other hand, comment #9 has one counterexample, plus Google finds
http://archives.neohapsis.com/archives/postfix/2003-09/0507.html, which
indicates that select can fire on on a non-ready fd (probably not an
issue here since it appears to affect only TCP sockets) but it makes me
wonder what other instances are out there...
[...]
>+ program_alive_scheduled = child_terminated;
Any reason this is a separate variable rather than just using
child_terminated? A possible race where a SIGCHLD arrives after the
read?
On a related note, I'm also wondering if we be aiming to carry this as
a portable-only change (since OpenBSD isn't directly affected and we
already have to deal with some pty wackiness from AIX in this area of
code, so patches won't apply cleanly already) or should we be aiming to
push the change to OpenBSD too?
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the openssh-bugs
mailing list