Bug 10995 - rsync -aFF crashes when parent directory of source directory has a .rsync-filter file with a dir-merge rule in it
Summary: rsync -aFF crashes when parent directory of source directory has a .rsync-fil...
Status: RESOLVED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.0
Hardware: x64 Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-08 13:52 UTC by Lars Tiede
Modified: 2015-07-13 18:49 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Tiede 2014-12-08 13:52:00 UTC
Run the following in an empty directory to reproduce:

mkdir src-parent
echo "dir-merge,- .gitignore" > src-parent/.rsync-filter
mkdir src-parent/src
mkdir src-parent/src/subdir
mkdir dest

rsync -aFF src-parent/src/ dest/


On Ubuntu 14.04 with the rsync version that ships with Ubuntu (rsync  version 3.1.0  protocol version 31), I get the following output:

rsync: exclude.c:584: pop_local_filters: Assertion `mergelist_cnt == old_mergelist_cnt' failed.
Aborted (core dumped)


On OS X 10.10 with rsync version 2.6.9  protocol version 29, this runs without problems.


It looks like rsync looks too far up the directory tree for filter rules, and then gets confused.

Note that the above steps are minimal as far as I was able to isolate the bug: remove the filter rule and it works. Remove the -a flag and it works. Remove src-parent/src/subdir and it doesn't crash (the empty subdir is not copied over, though).
Comment 1 Lars Tiede 2014-12-08 14:02:36 UTC
Sorry, my last paragraph came out confusing. It should read:

Note that the above steps are minimal with respect to as far as I was able to isolate the bug: remove the filter rule and it works. Remove src-parent/src/subdir and it works. Remove the -a flag and it doesn't crash (the empty subdir is not copied over, though).
Comment 2 Wayne Davison 2015-07-13 18:49:53 UTC
I just made some changes to the dir-merge code that fixed up the issue you were seeing.  It will be in the next release.