Subject: Re: rsync
From: Bill Petheram <[email-masked]>
To: Corinna Vinschen <[email-masked]>
Cc: Lapo Luchini <[email-masked]>
Date: Thu, 02 Aug 2001 15:17:30 +0100

To recap:

I am using rsync to copt a file from a remote linux box to a W2K box.

The linux box outputs the followin error: unexpected EOF in read_timeout
This is caused by select returning and a read of 0 bytes in rsync. The
socket is then closed and the W2K end gets a read error: Connection
reset by peer. 

The interesting part from the strace is as follows:
 2253 6092532 [main] rsh 280 _read: res 1 0
  714 6093246 [main] rsh 280 fhandler_socket::read: fhandler_read:
socket 376 len 1024
 1338 6094584 [main] rsh 280 fhandler_socket::read: fhandler_read: res 0
 1462 6096046 [main] rsh 280 _read: res 0
 1425 6097471 [main] rsh 280 _read: 0 = read (3</dev/tcp>, 0x240FA14,
1024), bin 4096, errno 0
 1298 6098769 [main] rsh 280 _kill: kill (1340, 9)
 1112 6099881 [main] rsh 280 sig_send: invalid pid 1340(2), signal 9
  326 6100207 [main] rsh 280 sig_send: returning 1 from sending signal 9
 2034 6102241 [main] rsh 280 kill_worker: 1 = sig_send, Win32 error 0
 2058 6104299 [main] rsh 280 kill_worker: -1 = kill_worker (1340, 9)
 1320 6105619 [main] rsh 280 do_exit: do_exit (0)

The question for me is how can I get a _kill immediately after _read?

What I think happens is rsh exits closing the socket which seems to
cause the remote end to return from select. This then seems to cause the
failure I experience. Though the socket should remain open becuase the
local rsync will have it open.

Where should I look now for more information?

thanks

bill

Corinna Vinschen wrote:
> 
> On Mon, Jul 09, 2001 at 12:56:39PM +0100, Bill Petheram wrote:
> > I can't get rsync to work on W2K except in daemon mode. I tried to debug
> > it with gdb but rsync exits on the first write statement. This means
> > that I cannot step through the program.
> 
> Did you try an strace? It can be pretty helpful, at least to see
> at which point in Cygwin the error occurs. Did you call gdb in
> default GUI mode or in non-GUI? Mostly the non-GUI version (started
> by calling gdb -nw) is a bit easier to control, especially if you're
> working with more than one partition since the GUI version only
> works with native paths.
> 
> > If I build cygwin from source would I be able to see where the write was
> > failing?
> 
> Sure. You can build with CFLAGS=-g instead of using the default of
> CFLAGS=-O2. That results in a easier source code level debugging.
> When you're running that dll (which is approx. 4MB in size) you can
> start rsync again under gdb control. In gdb you can load the DLL's
> symbol table by calling `dll cygwin1.dll'. Set a breakpoint on rsync's
> main() function and after running up to that point you can set
> breakpoints to Cygwin's internal functions.
> 
> Lapo, are you already investigating into that problem as well? Since
> you did the base port you have a clue what's going on, perhaps.
> 
> Corinna
> 
> --
> Corinna Vinschen                  Please, send mails regarding Cygwin to
> Cygwin Developer                                mailto:[email-masked]
> Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/