https://bugzilla.mindrot.org/show_bug.cgi?id=1467
Summary: SFTP stalls
Classification: Unclassified
Product: Portable OpenSSH
Version: 5.0p1
Platform: Other
OS/Version: Other
Status: NEW
Severity: normal
Priority: P2
Component: ssh
AssignedTo: bitbucket at mindrot.org
ReportedBy: sconeu at yahoo.com
This issue was first noted on SFTP, but the cause was down in the
spawned ssh process.
On some systems (e.g. HP NonStop), read or write to a nonblocking
socket will fail with EWOULDBLOCK instead of EAGAIN. The code in
channels.c does not handle EAGAIN, causing the socket to be closed, but
the parent process does not recieve notification, leading to a stall.
in channel_handle_[erw]fd, the calls to read/write should check for
EWOULDBLOCK as well as EAGAIN:
e.g, in channel_handle_wfd:
len = write(c->wfd, buf, dlen);
if (len < 0 &&
(errno == EINTR ||
#ifdef EWOULDBLOCK
errno == EWOULDBLOCK ||
#endif
errno == EAGAIN))
This appears to be pervasive throughout the code, not just in
channels.c.
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
https://bugzilla.mindrot.org/show_bug.cgi?id=1467
sconeu at yahoo.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sconeu at yahoo.com
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
https://bugzilla.mindrot.org/show_bug.cgi?id=1467
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|bitbucket at mindrot.org |djm at mindrot.org
--- Comment #1 from Damien Miller <djm at mindrot.org> 2008-05-22
03:36:37 ---
Created an attachment (id=1506)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=1506)
test for EWOULDBLOCK everywhere we currently check for EAGAIN
I guess we could do something like this patch.
Does Nonstop define EAGAIN? If so, what is the difference between
EAGAIN and EWOULDBLOCK?
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
https://bugzilla.mindrot.org/show_bug.cgi?id=1467
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |1452
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
https://bugzilla.mindrot.org/show_bug.cgi?id=1467 --- Comment #2 from sconeu at yahoo.com 2008-05-22 04:55:39 --- Yes, NonStop defines EAGAIN, but doesn't use it in the case of a nonblocking socket. The proposed fix is essentially what i've done in our internal port.>From the NonStop man page for write(2) (read is similar):[EAGAIN] One of these conditions exists: o An attempt was made to write to a file descriptor that cannot accept data, and the O_NONBLOCK flag is set. o A write to a pipe (FIFO file) of PIPE_BUF bytes or less is requested, O_NONBLOCK is set, and fewer than nbytes of free space are available. o The O_NONBLOCK flag is set on this file, and the process would be delayed in the write operation. [EWOULDBLOCK] The process attempted an operation on a socket for which O_NONBLOCK is set, there is no space available, and no error has occurred. My understanding is that EWOULDBLOCK is an older errno condition and newer systems don't use it. The NonStop sockets implementation is apparently based on the older code. -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.
https://bugzilla.mindrot.org/show_bug.cgi?id=1467 --- Comment #3 from sconeu at yahoo.com 2008-05-22 05:01:58 --- I'm relatively new here, and am not sure of the proper etiquette. I realize I gave a bad summary line (the effects rather than the cause). The summary line to this bug should probably be changed to something more descriptive (e.g. "No check for EWOULDBLOCK"). -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-May-22 00:24 UTC
[Bug 1467] improper handling of EWOULDBLOCK on HP
https://bugzilla.mindrot.org/show_bug.cgi?id=1467
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|SFTP stalls |improper handling of
| |EWOULDBLOCK on HP
Platform|Other |All
OS/Version|Other |HP-UX
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-May-22 00:25 UTC
[Bug 1467] improper handling of EWOULDBLOCK on HP
https://bugzilla.mindrot.org/show_bug.cgi?id=1467
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #1506| |ok?(dtucker at zip.com.au)
Flag| |
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-May-22 02:41 UTC
[Bug 1467] improper handling of EWOULDBLOCK on HP
https://bugzilla.mindrot.org/show_bug.cgi?id=1467 --- Comment #4 from sconeu at yahoo.com 2008-05-22 12:41:12 --- Thanks, djm. As an additional comment on this bug, the code in atomicio.c handled EWOULDBLOCK properly. -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Jul-04 12:32 UTC
[Bug 1467] improper handling of EWOULDBLOCK on HP
https://bugzilla.mindrot.org/show_bug.cgi?id=1467
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #1506|0 |1
is obsolete| |
Attachment #1506|ok?(dtucker at zip.com.au) |
Flag| |
Attachment #1541| |ok?
Flag| |
--- Comment #5 from Damien Miller <djm at mindrot.org> 2008-07-04
22:32:46 ---
Created an attachment (id=1541)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=1541)
revised patch
updated to -current
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Jul-04 13:03 UTC
[Bug 1467] improper handling of EWOULDBLOCK on HP
https://bugzilla.mindrot.org/show_bug.cgi?id=1467
Darren Tucker <dtucker at zip.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #1541| |ok+
Flag| |
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Jul-04 13:11 UTC
[Bug 1467] improper handling of EWOULDBLOCK on HP
https://bugzilla.mindrot.org/show_bug.cgi?id=1467
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #6 from Damien Miller <djm at mindrot.org> 2008-07-04
23:11:10 ---
patch applied - this will be in openssh-5.1. Thanks!
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.