samba-bugs@samba.org
2005-Aug-20 19:21 UTC
[Bug 3020] New: Mac OS X/Darwin incorrectly shows read sockets ready when they aren't
https://bugzilla.samba.org/show_bug.cgi?id=3020 Summary: Mac OS X/Darwin incorrectly shows read sockets ready when they aren't Product: rsync Version: 2.6.5 Platform: PPC OS/Version: Mac OS X Status: NEW Severity: critical Priority: P3 Component: core AssignedTo: wayned@samba.org ReportedBy: toasty@dragondata.com QAContact: rsync-qa@samba.org Occasionally (especially when the parent process has alarm signals running, which get inherited to the child rsync process, but even when no signal activity is happening) Mac OS X will return that a read socket is ready to be read from, but 0 bytes are returned from a read() call. Rsync assumes this means the connection is closed, which tears the session down. On OS X this seems not to be true. This only seems to occur on very busy systems, it's difficult to reproduce on a development machine, but nearly impossible to work around on a busy server. This bug also appears only to be present in OS X 10.4, reverting to 10.3 is fine. This patch has worked fine for me for a few weeks now, which changed things from "unusable on OS X" to "works flawlessly". I think it's safe to commit, I don't know of any OS that returns 0 on a read without setting errno when something really is wrong. --- io.c.orig 2005-08-20 18:44:34.000000000 +0000 +++ io.c 2005-08-20 19:02:37.000000000 +0000 @@ -570,7 +570,7 @@ n = read(fd, buf, len); - if (n <= 0) { + if ((n <= 0) && errno) { if (n == 0) whine_about_eof(fd); /* Doesn't return. */ if (errno == EINTR || errno == EWOULDBLOCK -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
Apparently Analagous Threads
- [Bug 3020] Mac OS X/Darwin incorrectly shows read sockets ready when they aren't
- [Bug 13433] New: out_of_memory in receive_sums on large files
- @RSYNC EXIT / @RSYNC EOF
- [PATCH libnbd 1/3] lib: socket: Add .send flags parameter.
- [PATCH libnbd discussion only 3/5] lib: Pass handle to socket recv and send calls.