X-Spam-Check-By: sourceware.org Message-Id: <1140298221.19483.254708795@webmail.messagingengine.com> From: "Brett Serkez" To: "Scott Bolte" Cc: cygwin AT cygwin DOT com Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="ISO-8859-1" MIME-Version: 1.0 References: <200602180325 DOT k1I3Pg94037642 AT crag DOT niss DOT com> Subject: Re: rsync fork/exec problem with odd twist for native windows programs In-Reply-To: <200602180325.k1I3Pg94037642@crag.niss.com> Date: Sat, 18 Feb 2006 16:30:21 -0500 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk 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 Scott, > Thanks for the suggestion. Switching from socketpair() to > pipe() does let ssh get going, but rsync later runs into > problems. A few minutes into the transfer it just hangs. I've actually been able to run fine once past the initial hang, but I've seen reports of random hangs at later points by others, usually around magic numbers. Not sure if there might be a buffering issue, but I think the hangs are usually the result of rsync on each end coming out of step with the other. > Since I exercised ssh by transferring 16MB files back and forth > for 10 minutes, I'm inclined to point the finger at rsync. > However, I use the same version of rsync on another system where > it runs like a champ. That doesn't leave any suspects. This issue forced me to look at the rsync protocol in some detail, and I am reasonably sure it is tight. Rsync, like similar protocols, it is highly dependent upon the socket to insure correct operation. That is the rsync protocol is lock-step, one side writes and then reads, while the other reads and then writes. This is a precise exchange, if one side misses data it will attempt to read or write while it should be doing the other and then hang endlessly as each end hopelessly waits for the other. Since rsync is creating ssh as the child, which owns the socket, and we've seen a different behavior between a socketpair and a pipe, I have to suspect there is something not right between rsync and ssh over the pipe, something not being relayed from/to the socket that is causing the loss of sync. > I'm still puzzled as to why even true.exe hung. I did not want > to make my problem report even longer, but I had another test > program which was literally "int main() { exit(0) }", just in > case true.exe was not as minimal as expected. That test program > also hung when spawned by rsync. Yes, interesting and puzzling. Brett ---------------------------------------------------------------- Brett C. Serkez, Techie -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/