X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Message-ID: <4AFD49EA.5020804@cs.umass.edu> Date: Fri, 13 Nov 2009 06:58:34 -0500 From: Eliot Moss User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: cygwin AT cygwin DOT com, cygwin AT cygwin DOT com Subject: Re: Problem with rsync 3.0.6-1 [and 3.0.5] under 1.7.0-62 and 63 [and 64] References: <4AF58831 DOT 3080306 AT cs DOT umass DOT edu> <4AFC2A57 DOT 60909 AT cs DOT umass DOT edu> <20091112154701 DOT GA21323 AT calimero DOT vinschen DOT de> <4AFC3204 DOT 8080505 AT cs DOT umass DOT edu> <4AFC8AF3 DOT 2040009 AT cs DOT umass DOT edu> <20091113112405 DOT GO26238 AT calimero DOT vinschen DOT de> In-Reply-To: <20091113112405.GO26238@calimero.vinschen.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Corinna Vinschen wrote: > On Nov 12 17:23, Eliot Moss wrote: >> I went ahead and wrote a little program that narrows >> down the rsync problem to a dup2 call. The program: >> creates two pipes (for talking to a child process), >> forks the child, and the child tries to dup2 the >> pipe fds to its stdin and stdout. If it wins (which >> it doesn't), it will then run sleep for 5 seconds >> and quit. The parent closes some fds it doesn't need >> and waits for the child, then quits. I attach the >> program in question, and strace output. >> >> Cheers -- Eliot Moss > > Thanks for the testcase. However, the problem is that I can't reproduce > any problem using your testcase. I ran it on Windows XP SP3, Server 2008 > SP1, and Windows 7. The result is this, just with changing PIDs: > > $ ./a_test > pid = 3272, fin = 5, fout = 4 > wait got 0 > > I assume you see some error, but you didn't explicitely write what error > you see. The strace output shows an error when closing a socket, which > is that dreaded Winsock error 10038, "socket operation on non-socket". > > The reason why this operation fails must be something on your machine. > I'm just not sure how we can find out what that is, and how to avoid the > error then. Simply ignoring error 10038 in close() doesn't sound like > a terribly good idea... Thank you for looking more closely! The actual failure is earlier in the strace output, I think. If you look for dup2 you see that the first dup2 call fails on my machine. Can this fail because of some permissions thing? I have UAC set to "Never notify". I am logged in as me (Eliot), and I have Administrator rights. I get the same result from a_test if I run bash as Administrator and run a_test. Here is sample program output for me: pid = 9064, fin = 5, fout = 4 error: first dup2 -1 9 wait got 65280 If I understand correctly, the wait code says the child terminated with result -1, which corresponds with what the code does when that dup2 fails. Any suggestions for the next step in debugging this? I can certainly accept that it's something about my machine, but I am rather at a loss of where to look ... Regards -- Eliot -- 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