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

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Fri Nov 17 07:44:15 EST 2006


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


sethi.varun at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CLOSED                      |REOPENED
         Resolution|FIXED                       |




------- Comment #16 from sethi.varun at gmail.com  2006-11-17 07:44 -------
(In reply to comment #12)
> Created an attachment (id=1147)
 --> (http://bugzilla.mindrot.org/attachment.cgi?id=1147&action=view) [details]
> Handle zero-length reads on AIX only
> I was wondering if there's any platforms out there that don't set
> errno... so this ought to be safer (although admittedly uglier).
> Unless there are objections I'd like to commit this one

Shouldn't the fix in channels.c 
+#ifndef PTY_ZEROREAD
                if (len <= 0) {
+#else
+               if (len < 0 || (len == 0 && errno != 0)) {
+#endif

Actuall be 
+#ifdef PTY_ZEROREAD
                if (len <= 0) {
+#else
+               if (len < 0 || (len == 0 && errno != 0)) {
+#endif

After applying the modified (changing ifndef to ifdef in channels.c)
fix on AIX. The problem of ssh session hang is resolved. But now I face
another problem on AIX. 
Task: Login with ssh WITH the -X or -Y option and start and ending wish
and trying to logout
Result: DISPLAY variable correctly set. After ending wish and trying to
logout from the ssh shell the shell displayed: logout and then hangs
there. The hanging ssh shell must be ended with CRTL-C
Steps to reproduce:
client  prompt$ ssh -X server
server  prompt$ wish
     wish prompt: exit
server prompt $ exit
   logout




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