From owner-freebsd-bugs@FreeBSD.ORG Wed Jan 31 18:00:45 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9DD3416A494 for ; Wed, 31 Jan 2007 18:00:45 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 8E58013C428 for ; Wed, 31 Jan 2007 18:00:45 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l0VI0j1k004549 for ; Wed, 31 Jan 2007 18:00:45 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l0VI0jGD004548; Wed, 31 Jan 2007 18:00:45 GMT (envelope-from gnats) Date: Wed, 31 Jan 2007 18:00:45 GMT Message-Id: <200701311800.l0VI0jGD004548@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Remko Lodder Cc: Subject: Re: bin/108607: [PATCH] lib/libarchive core dumps on 6.2 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Remko Lodder List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2007 18:00:45 -0000 The following reply was made to PR bin/108607; it has been noted by GNATS. From: Remko Lodder To: Artis Caune Cc: freebsd-gnats-submit@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@elvandar.org FreeBSD ** remko@FreeBSD.org /* Quis custodiet ipsos custodes */