Bug 1413 - SEGV using --delete and multiple sources
Summary: SEGV using --delete and multiple sources
Status: CLOSED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.2
Hardware: All FreeBSD
: P3 critical (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
: 1448 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-30 00:32 UTC by Wayne Davison
Modified: 2005-03-16 16:48 UTC (History)
1 user (show)

See Also:


Attachments
Fixed the crash bug in make_file(). (567 bytes, patch)
2004-05-30 00:33 UTC, Wayne Davison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wayne Davison 2004-05-30 00:32:36 UTC
Albert Chin reports:

I'm getting a SEGV on a FreeBSD 4.8-STABLE box. The client is Solaris
9/SPARC. Both boxes run 2.6.2.

The command I'm running is:
  $ rsync -arHRv --numeric-ids --delete --exclude=/opt/dist/cdrom \
  [paths] [server]:[path]

If I whittle down what appears in [paths], then it works.

$ gdb rsync rsync.core
gdb> bt
#0  0x280faf0d in strncmp () from /usr/lib/libc.so.4
#1  0x7 in ?? ()
#2  0x80597f7 in send_file_name (f=-1, flist=0x808a100,
    fname=0xbfbfe994 "etc/opt/TWWfsw", recursive=1, base_flags=1)
    at flist.c:929
#3  0x805a2fc in send_file_list (f=-1, argc=0, argv=0xbfbffa44) at flist.c:1178
#4  0x804c0ff in delete_files (flist=0x808a0c0) at receiver.c:102
#5  0x805177e in do_recv (f_in=0, f_out=1, flist=0x808a0c0, local_name=0x0)
    at main.c:426
#6  0x8051bae in do_server_recv (f_in=0, f_out=1, argc=1, argv=0x808a064)
    at main.c:547
#7  0x8051ca9 in start_server (f_in=0, f_out=1, argc=2, argv=0x808a060)
    at main.c:577
#8  0x8052a89 in main (argc=2, argv=0x808a060) at main.c:1041

Based on #2, seems the SEGV is in make_file but #1 doesn't show the
function name and line number. Odd.
Comment 1 Wayne Davison 2004-05-30 00:33:31 UTC
Created attachment 532 [details]
Fixed the crash bug in make_file().

When the --delete option iterates over all the specified [paths] it clears the
delete-file_list after each one.  This makes the "lastdir" pointer no longer
valid.	The appended patch fixes this bug and also a similar bug that could
affect the batch code.
Comment 2 Wayne Davison 2004-05-30 00:41:18 UTC
The attached fix is in CVS, and will appear in the next version of rsync.
Comment 3 Wayne Davison 2004-06-09 13:54:40 UTC
*** Bug 1448 has been marked as a duplicate of this bug. ***