bugzilla-daemon at mindrot.org
2006-Nov-16 20:44 UTC
[Bug 1102] C program 'write' with zero length hangs
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 oneShouldn'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.
bugzilla-daemon at mindrot.org
2006-Nov-16 20:46 UTC
[Bug 1102] C program 'write' with zero length hangs
http://bugzilla.mindrot.org/show_bug.cgi?id=1102 ------- Comment #17 from sethi.varun at gmail.com 2006-11-17 07:46 ------- (In reply to comment #16)> (In reply to comment #12) > > Created an attachment (id=1147)--> (http://bugzilla.mindrot.org/attachment.cgi?id=1147&action=view) [details] [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 > logoutForgot to mention that I applied tha patch on openssh-4.1 ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2006-Nov-16 22:19 UTC
[Bug 1102] C program 'write' with zero length hangs
http://bugzilla.mindrot.org/show_bug.cgi?id=1102 dtucker at zip.com.au changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #1147 is|0 |1 obsolete| | ------- Comment #18 from dtucker at zip.com.au 2006-11-17 09:19 ------- Created an attachment (id=1208) --> (http://bugzilla.mindrot.org/attachment.cgi?id=1208&action=view) Fixes for bug #1102 as applied to the tree.> Shouldn't the fix in channels.c > +#ifndef PTY_ZEROREADIt's the other way around, but yes the patch here is wrong. It got fixed in the tree, and the fixes are in the 4.4p1 and 4.5p1 releases. The changes were: - (dtucker) [channels.c configure.ac serverloop.c] Bug #1102: Around AIX 4.3.3 ML3 or so, the AIX pty layer starting passing zero-length writes on the pty slave as zero-length reads on the pty master, which sshd interprets as the descriptor closing. Since most things don't do zero length writes this rarely matters, but occasionally it happens, and when it does the SSH pty session appears to hang, so we add a special case for this condition. ok djm@ - (dtucker) [serverloop.c] Get ifdef/ifndef the right way around for the bug #1102 workaround. - (dtucker) [channels.c serverloop.c] Apply the bug #1102 workaround to ptys only, otherwise sshd can hang exiting non-interactive sessions. These are included in the attached patch. As for the thing with wish, if you are having a different problem with a current release then please open a new bug for it (mention this bug# if you want). I am going to re-close this bug. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2006-Nov-16 22:20 UTC
[Bug 1102] C program 'write' with zero length hangs
http://bugzilla.mindrot.org/show_bug.cgi?id=1102 dtucker at zip.com.au changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2006-Nov-16 22:21 UTC
[Bug 1102] C program 'write' with zero length hangs
http://bugzilla.mindrot.org/show_bug.cgi?id=1102 dtucker at zip.com.au changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.