X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,HK_OBFDOM X-Spam-Check-By: sourceware.org Date: Wed, 19 Aug 2009 14:07:31 -0400 From: "cygwin at sipxx.com" Subject: Re: Cygwin1.dll 1.7.0-5x: RSYNC failures in close() system call on pipe file descriptors In-reply-to: <4A87DCF6.5050504@alice.it> To: Cygwin Reply-to: cygwin AT sipxx DOT com Message-id: <4A8C3F63.6080409@sipxx.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-15; format=flowed Content-transfer-encoding: 7BIT References: <4A87DCF6 DOT 5050504 AT alice DOT it> User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Follow-up: I can confirm that your example using rsync to fetch a remote tree also fails on my system. I built a work-around into cygwin1.dll that solves the first failure cases in which socketpair() is involved on a system-wide basis, so individual applications don't have to be patched. The problem is not unique to rsync. Your case appears indeed different on the surface, but I suspect the underlying root cause is likely the same. $ rsync -av --delete --exclude=.svn tug.org::tldevsrc/Build/source/ /tmp/tl-src receiving incremental file list rsync: read error: Socket operation on non-socket (108) rsync error: error in rsync protocol data stream (code 12) at /home/lapo/packaging/rsync-3.0.5-1/src/rsync-3.0.5/io.c(759) [receiver=3.0.5] rsync: connection unexpectedly closed (363 bytes received so far) [generator] rsync error: error in rsync protocol data stream (code 12) at /home/lapo/packaging/rsync-3.0.5-1/src/rsync-3.0.5/io.c(600) [generator=3.0.5] The problem occurs when a socket gets dup()'ed, both file descriptors should work interchangeably for i/o, but the second descriptor clearly doesn't. It either hangs or produces exceptions on reading or writing, and fails on close. On my system, this happens only when using IPv4 transport, under IPv6 it seems to work fine. I reported initially that this only happens when duping to STDIN, but that was wrong, a result of a typo in the test program. I checked for interfering programs against the list, not running any of them. The system doesn't run any antivirus or firewalling software either. Since this works fine with cygwin 1.5, there must be some changes in 1.7 that interfere with some programs using the IPv4 stack somehow. -Karl [this is a resend, seems this didn't make it to the list in an earlier transmission] Angelo Graziosi wrote: > For the sake of completeness... > > I wrote: > >> May you give some more details? For example, should I rebuild under >> Cygwin-1.5 or 1.7? with cygport (but which uses rsync, sigh!)? which >> patch to apply?... > > I have rebuilt rsync-3.05 both on Cygwin-1.5 and 1.7 applying this patch: > > --- util.c.orig 2008-11-15 23:17:49.000000000 +0100 > +++ util.c 2009-08-16 03:07:20.390625000 +0200 > @@ -78,11 +78,7 @@ > { > int ret; > > -#ifdef HAVE_SOCKETPAIR > - ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd); > -#else > ret = pipe(fd); > -#endif > > if (ret == 0) { > set_nonblocking(fd[0]); > > Using the resulting binaries on Cygwin-1.7, there is a little step > forward. Now > > $ ./rsync -av downloads /tmp > > works, but > > ./rsync -av --delete --exclude=.svn tug.org::tldevsrc/Build/source/ > /tmp/tl-src > > does NOT! :-( > > > Cheers, > Angelo. > -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple