tar dumps core when appending to empty file

Tim Kientzle kientzle at freebsd.org
Mon Oct 25 23:43:20 PDT 2004


Ryan Sommers wrote:
> Jason C. Wells wrote:
> 
>> What I am trying to do is:
>>
>> $ touch Makefiles.tar
>> $ find . -name Makefile.orig -exec tar -r -f Makefiles.tar {} \;
>>
>> This causes tar to dump core as fast as find can find the specified 
>> files.

This is clearly a bug in libarchive.
I'll commit Ryan's fix.  (Thanks, Ryan!)

In the interim, you might try this *much* faster
method:

find . -name Makefile.orig | tar -c -f Makefiles.tar -I-

This runs tar just once and also avoids the overhead
of scanning the entire archive to locate the last item
for an append.  Your approach gets awfully slow if you
have very many files to add.

Tim



More information about the freebsd-current mailing list