[Bug 1102] C program 'write' with zero length hangs

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Wed Oct 12 23:10:47 EST 2005


http://bugzilla.mindrot.org/show_bug.cgi?id=1102





------- Comment #5 from dtucker at zip.com.au  2005-10-12 23:10 -------
Which AIX Maintenance Levels do your systems have?  Does the problem occur with
other pty-using programs such as telnetd?

(In reply to comment #3)
> this looks like a kernel bug on your OS - I can't see what it has to do with
> OpenSSH.

I agree.  Now some history: way back when dinosaurs roamed the earth (around
AIX 4.3.3 ML 3 or so) the pty layer on AIX started returning zero for read()
syscalls after zero-length writes to the pty.

This was a problem for sshd, since POSIX says that a return code of zero from
read() means EOF; this effectively meant that a program performing zero-length
writes such as yours would result in sshd closing the session.  Since this
remained busted for quite a while, sshd was changed to ignore such zero-length
reads to work around it (see bug #124 for the gory details).

I'm wondering if maybe IBM has attempted to fix this and gone to the other
extreme?  AFAICT the zero-length write should be a no-op...  It's also possible
that the the work-around now has a side-effect.




------- 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