From owner-freebsd-current@FreeBSD.ORG Sun Mar 25 17:53:25 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D275D106566C; Sun, 25 Mar 2012 17:53:25 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id AA65B8FC0A; Sun, 25 Mar 2012 17:53:25 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id q2PHrIBw045581; Sun, 25 Mar 2012 17:53:18 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.119] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id fdta5a4ihs57k4mszqghrx4tzw; Sun, 25 Mar 2012 17:53:18 +0000 (UTC) (envelope-from tim@kientzle.com) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=windows-1252 From: Tim Kientzle In-Reply-To: <4F6F155E.30902@passap.ru> Date: Sun, 25 Mar 2012 10:53:16 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <38D08B05-58E1-4266-9628-2C22836806D3@kientzle.com> References: <4F6CD93D.70109@passap.ru> <4F6CEB1F.4040300@FreeBSD.org> <4F6D52DF.7080105@passap.ru> <4F34E618-DB66-464D-B5B2-900960D6C16B@kientzle.com> <4F6F155E.30902@passap.ru> To: Boris Samorodov X-Mailer: Apple Mail (2.1257) Cc: freebsd-current@freebsd.org, Dimitry Andric Subject: Re: /usr/bin/tar creates invalid lib file X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2012 17:53:25 -0000 On Mar 25, 2012, at 5:53 AM, Boris Samorodov wrote: > On 24.03.2012 21:00, Tim Kientzle wrote: >>=20 >> On Mar 23, 2012, at 9:51 PM, Boris Samorodov wrote: >>=20 >> Can you send me the output of: >>=20 >> tar -cvf /tmp/test.tar = /usr/ports/devel/nspr/work/nspr-4.9/mozilla/nsprpub/build/dist/lib/../../p= r/src/./libnspr4.so.1 >>=20 >> (A tar archive containing only that one source file.) >>=20 >> This looks similar to a bug that we found in libarchive recently >> I didn't think that bug impacted FreeBSD, but I may have been >> wrong=85. if it did, it will be obvious from the structure of the >> created archive. >=20 > The following file is extracted after tarring: > ----- > % hd libnspr4.so.1 > 00000000 32 0a 30 0a 30 0a 32 34 31 39 37 31 0a 30 0a 00 = |2.0.0.241971.0..| > 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 = |................| > * > 00000200 > ----- >=20 > The tar file itself attached (3KB in length). Ugh. I'll probably need your help to diagnose this more precisely. Here is the root problem: tar thinks this is a sparse file with nothing in it. On FreeBSD, bsdtar now uses lseek(SEEK_HOLE) to identify holes in the file. For some reason, bsdtar is storing this file as just one big hole. There are a lot of things here that don't make sense: * The extracted file should be all zero bytes. (The 2.0.0.241971.0. = is the sparse file map, it's not really part of the file.) How are you = extracting this? * Can you run the tar command under truss or ktrace and look for calls = to lseek()? That would help verify that this is really a tar bug and = not a filesystem or kernel bug. I'll spend some time today to see if I can reproduce the problem here. Tim