Re: rsync 2.6.5 segfault using --fuzzy & --link-dest

2005-06-12 Thread Erik Jan Tromp
On Sat, 11 Jun 2005 23:22:39 -0700
Wayne Davison <[EMAIL PROTECTED]> wrote:

> OK, the crash turned out to be caused by an empty file-list not getting
> its "high" value set correctly.  If such an empty list gets passed to
> flist_find(), it would crash.  This is not something that normally
> happens, but in the case where an empty destination directory is matched
> up with a list-dest directory that has a file that is present but not
> up-to-date, rsync triggers the bug.  Attached is a patch to fix this.

I seem to have a habit of doing stuff that doesn't 'normally happen'. :)

> Thanks for your help!

Rebuilt with this & the max verbosity patches, deployed, tested. Works like an 
absolute charm.

Thanks for the quick turnaround on these fixes.

Erik

-- 
"I really want a license to do just two things: make the code available
to others, and make sure that improvements stay that way. That's really
it. Nothing more, nothing less. Everything else is fluff."
 -- Linus Torvalds

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: rsync 2.6.5 segfault using --fuzzy & --link-dest

2005-06-11 Thread Wayne Davison
On Sat, Jun 11, 2005 at 02:05:48PM -0400, Erik Jan Tromp wrote:
> #0  0x08060566 in flist_find ()
> #1  0x0804c6cd in recv_generator ()

OK, the crash turned out to be caused by an empty file-list not getting
its "high" value set correctly.  If such an empty list gets passed to
flist_find(), it would crash.  This is not something that normally
happens, but in the case where an empty destination directory is matched
up with a list-dest directory that has a file that is present but not
up-to-date, rsync triggers the bug.  Attached is a patch to fix this.

Thanks for your help!

..wayne..
--- flist.c 27 May 2005 18:15:18 -  1.297
+++ flist.c 12 Jun 2005 06:04:10 -
@@ -1471,8 +1471,12 @@ static void clean_flist(struct file_list
 {
int i, prev_i = 0;
 
-   if (!flist || flist->count == 0)
+   if (!flist)
return;
+   if (flist->count == 0) {
+   flist->high = -1;
+   return;
+   }
 
sorting_flist = flist;
qsort(flist->files, flist->count,
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Re: rsync 2.6.5 segfault using --fuzzy & --link-dest

2005-06-11 Thread Erik Jan Tromp
On Sat, 11 Jun 2005 09:03:07 -0700
Wayne Davison <[EMAIL PROTECTED]> wrote:

> On Fri, Jun 10, 2005 at 05:14:57AM -0400, Erik Jan Tromp wrote:
> > if I remove every possible option except --fuzzy & --link-dest,
> > segfault every time.
> 
> I haven't seen that in my testing.  One easy thing to do is to make sure
> that core dumping is enabled and look at a backtrace:
> 
> ulimit -c unlimited
> /path/to/non-stripped/rsync ...
> gdb /path/to/non-stripped/rsync /path/to/core
> bt

Concise directions.. perfect.

> The backtract (bt) command will tell us where the program is crashing,
> and should help me to find the bug.  Note that a non-stripped rsync can
> be found in the build dir, and that the core file will probably be in
> the destination directory of your pull transfer.

Source tree was wiped after I packaged, so did a quick rebuild & tossed the 
non-stripped bin in ~/bin/. No dev tools on oxygen (backup server), so into 
~/bin/ for gdb as well. 

Following is a complete dump.

-- 8< --

[EMAIL PROTECTED] ~]# ulimit -c unlimited
[EMAIL PROTECTED] ~]# ~/bin/rsync --archive --delete-during --fuzzy 
--hard-links --nu
meric-ids --quiet --sparse --temp-dir /backup/helium/ --link-dest /backup/hydrog
en/saturday/ --password-file /backup/helium/.password rsync://[EMAIL 
PROTECTED]/back
up/ /backup/helium/saturday/
Segmentation fault (core dumped)
[EMAIL PROTECTED] ~]# ~/bin/gdb ~/bin/rsync /backup/helium/saturday/core
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-slackware-linux"...Using host libthread_db libr
ary "/lib/libthread_db.so.1".
  
Core was generated by `/root/bin/rsync --archive --delete-during --fuzzy --hard-
links --numeric-ids --'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libpopt.so.0...done.
Loaded symbols for /usr/lib/libpopt.so.0
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
#0  0x08060566 in flist_find ()
(gdb) bt
#0  0x08060566 in flist_find ()
#1  0x0804c6cd in recv_generator ()
#2  0x0804db9a in generate_files ()
#3  0x08056390 in do_recv ()
#4  0x08056942 in client_run ()
#5  0x0806ab2b in start_socket_client ()
#6  0x08056e9f in start_client ()
#7  0x080573fd in main ()
(gdb) quit

-- 8< --

Erik

-- 
"I really want a license to do just two things: make the code available
to others, and make sure that improvements stay that way. That's really
it. Nothing more, nothing less. Everything else is fluff."
 -- Linus Torvalds

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: rsync 2.6.5 segfault using --fuzzy & --link-dest

2005-06-11 Thread Wayne Davison
On Fri, Jun 10, 2005 at 05:14:57AM -0400, Erik Jan Tromp wrote:
> if I remove every possible option except --fuzzy & --link-dest,
> segfault every time.

I haven't seen that in my testing.  One easy thing to do is to make sure
that core dumping is enabled and look at a backtrace:

ulimit -c unlimited
/path/to/non-stripped/rsync ...
gdb /path/to/non-stripped/rsync /path/to/core
bt

The backtract (bt) command will tell us where the program is crashing,
and should help me to find the bug.  Note that a non-stripped rsync can
be found in the build dir, and that the core file will probably be in
the destination directory of your pull transfer.

..wayne..
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


rsync 2.6.5 segfault using --fuzzy & --link-dest

2005-06-10 Thread Erik Jan Tromp
I've been reworking my backup script & decided to give some of the newer 
options a try. It would appear I've found a combination that doesn't play nice.

$ rsync --archive --delete-during --fuzzy --hard-links --numeric-ids
 --quiet --sparse --temp-dir /backup/helium/
 --link-dest /backup/hydrogen/tuesday/
 --password-file /backup/helium/.password
 rsync://[EMAIL PROTECTED]/backup/ /backup/helium/tuesday/   
Segmentation fault

If I remove either of the --fuzzy or --link-dest options from the above 
command, no more segfault. Conversely, if I remove every possible option except 
--fuzzy & --link-dest, segfault every time.

You'll undoubtedly want more info to dig in further. Being that I'm unfamiliar 
with gdb & strace, example usage would be helpful.

Erik

-- 
"I really want a license to do just two things: make the code available
to others, and make sure that improvements stay that way. That's really
it. Nothing more, nothing less. Everything else is fluff."
 -- Linus Torvalds

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html