bin/108607: [PATCH] lib/libarchive core dumps on 6.2

Remko Lodder remko at FreeBSD.org
Wed Jan 31 18:00:45 UTC 2007


The following reply was made to PR bin/108607; it has been noted by GNATS.

From: Remko Lodder <remko at FreeBSD.org>
To: Artis Caune <Artis.Caune at latnet.lv>
Cc: freebsd-gnats-submit at FreeBSD.org
Subject: Re: bin/108607: [PATCH] lib/libarchive core dumps on 6.2
Date: Wed, 31 Jan 2007 19:00:40 +0100

 Artis Caune wrote:
 After updating all boxes to 6.2, backup scripts don't work:
 > 
 > # tar -r -f /home/backup/pgsql.tar /home/backup/pgsql
 > INTERNAL ERROR: Function 'archive_read_next_header' invoked with archive structure in state 'new', should be in state 'header/data'
 > Segmentation fault: 11 (core dumped)
 > 
 >> How-To-Repeat:
 > # touch file.tar
 > # tar -r -f file.tar /COPYRIGHT
 > 
 >> Fix:
 > 
 > 
 > Patch attached with submission follows:
 > 
 > --- src/lib/libarchive/archive_read.c.orig	Tue Sep  5 08:23:51 2006
 > +++ src/lib/libarchive/archive_read.c	Wed Jan 31 17:23:46 2007
 > @@ -145,6 +145,7 @@
 >  	a->client_skipper = NULL;
 >  	a->client_closer = NULL;
 >  	a->client_data = NULL;
 > +	a->state = ARCHIVE_STATE_HEADER;
 >  
 >  	/* Open data source. */
 >  	if (client_opener != NULL) {
 > 
 As you can read with the -r option, it means append to an
 existing archive, the -c is being used to create a new archive;
 
 When i do that with
 
 # tar -cf /file.tar /etc
 
 I will get a /file.tar with the contents of /etc
 
 # tar -rf /file.tar /COPYRIGHT
 
 will add the COPYRIGHT file to the tarball.
 
 (# tar -r -f file.tar /COPYRIGHT
 tar: Removing leading '/' from member names)
 
 So, from my point of view you are using the wrong flags
 for the wrong kind of thing, i dont think setting the
 state hardcoded in the file is the idea, the state should
 be fetched from the file first.
 
 -- 
 Kind regards,
 
       Remko Lodder               ** remko at elvandar.org
       FreeBSD                    ** remko at FreeBSD.org
 
       /* Quis custodiet ipsos custodes */


More information about the freebsd-bugs mailing list