From owner-freebsd-stable@FreeBSD.ORG Sat Jul 2 19:06:45 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 267841065673 for ; Sat, 2 Jul 2011 19:06:45 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id DBCB78FC1D for ; Sat, 2 Jul 2011 19:06:44 +0000 (UTC) Received: by gyf3 with SMTP id 3so2110201gyf.13 for ; Sat, 02 Jul 2011 12:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=WIRwp/u0xT6VTPZ2akTUqrHHbspjTvaZonhKn32A0AM=; b=OcFLY2Fth35QFiaFUyeKMOpBW0/gD1rkV2P2mKLqQ3GjJkO/WydPQ+eVi4bXp6C21h oXmZL/2SaVEAO/ukeQJkXP964XUVgqFTxmJCQf+7nP6TA7nIxPAB/Y+Kjf5eFZNoZahx 8de3eBfvXfHDQmAY9R+c/ruOtIg5zndPxn3XM= MIME-Version: 1.0 Received: by 10.150.171.15 with SMTP id t15mr1692118ybe.424.1309633603943; Sat, 02 Jul 2011 12:06:43 -0700 (PDT) Received: by 10.150.220.20 with HTTP; Sat, 2 Jul 2011 12:06:43 -0700 (PDT) In-Reply-To: References: Date: Sat, 2 Jul 2011 09:06:43 -1000 Message-ID: From: Kevin Oberman To: bf1783@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-stable@freebsd.org Subject: Re: libarchive, lzma, and xz interaction X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jul 2011 19:06:45 -0000 On Fri, Jul 1, 2011 at 11:32 PM, b. f. wrote: >> On Fri, Jul 1, 2011 at 7:19 PM, Kevin Oberman wro= te: >> > I'm trying to understand the problems I am having on some systems >> > regarding libarchive, lzma, and xz. >> > I have an 8-Stable system updated yesterday. As far as I can tell, >> > libarchive does include the lzma stuff >> > from libzma. At least I see the references. But several ports seem to >> > still pull in xz-5.0.1 and link to it. >> > This has a wonderful potential to cause library symbol conflicts. I ge= t: >> > /usr/lib/libarchive.so: undefined reference to `lzma_stream_encoder at= XZ_5.0' >> > /usr/lib/libarchive.so: undefined reference to `lzma_alone_decoder at = XZ_5.0' >> > /usr/lib/libarchive.so: undefined reference to `lzma_memusage at XZ_5.= 0' >> > /usr/lib/libarchive.so: undefined reference to `lzma_stream_decoder at= XZ_5.0' >> > /usr/lib/libarchive.so: undefined reference to `lzma_code at XZ_5.0' >> > /usr/lib/libarchive.so: undefined reference to `lzma_end at XZ_5.0' >> > /usr/lib/libarchive.so: undefined reference to `lzma_lzma_preset at XZ= _5.0' >> > /usr/lib/libarchive.so: undefined reference to `lzma_alone_encoder at = XZ_5.0' >> > >> > ldd shows libarchive linked against liblzma.so.5 and an objdump of the >> > dynamic symbols from liblzma.so.5 >> > shows the "undefined symbols" defined with the XZ_5.0 version, so I am >> > mystified. It looks o me like it is >> > there. Is confusion with xz-5.0.1 causing this? Should get rid of it? >> > Even so, I don't understand why the >> > loader is claiming that these symbols are undefined when they seem to >> > be defined as far as I can tell. >> > 0000000000007c60 g =C2=A0 =C2=A0DF .text =C2=A00000000000000084 =C2=A0= XZ_5.0 >> > lzma_stream_encoder >> > >> > Any clues to what i happening would be greatly appreciated! > > Nothing mysterious here: > > src/lib/libarchive/archive_write_set_compression_xz.c uses some code > from the base system /usr/lib/liblzma.so shared library, from > src/lib/liblzma, which is derived from the base system xz 5.0.1, =A0in > src/contrib/xz. =A0Hence the symbols are present, with the symbol > versions that you noted, but undefined in libarchive, because it is > obtaining them from liblzma at run-time. =A0It nudges rtld(1) to do this > in the usual way, via it's DT_NEEDED tag for that library: > > objdump -x /usr/lib/libarchive.so | egrep 'NEEDED.*lzma' > >> Replying to myself, I re-built all programs that depended on xz and >> then deleted the port. Now everything works fine. I still don't >> completely understand what I was seeing, but it is working, now. > > Perhaps you recently updated your base system, but were using old > ports or packages? =A0 With up-to-date ports and a recent version of > 8-stable you should not have been able to build the archivers/xz port, > even if other ports mistakenly tried to drag it in, because of the > following lines in the ports/archivers/xz Makefile: > > > .if ${OSVERSION} >=3D 900012 || (${OSVERSION} < 900000 && ${OSVERSION} >= =3D 800505) > IGNORE=3D is already in the base system > .endif > > Of course, you could have overridden this, by setting NO_IGNORE. Thanks! Now I understand what was happening much better. It does make sense= . And you were right about the sequence o events. Due to a bug in the atkbd driver in 8.1 and 8.2 I installed 8.0-RELEASE and, after installing a few critical ports (which must have pulled in xz), I csuped RELENG_8, I applied the required patch (which has now been MFCed), and built a stable system. Unfortunately, I now had xz and got into the problems I reported. I am a bit disturbed to note that there is no entry in either /usr/src/UPDATING or /usr/ports/UPDATING about lzma moving into the base system and the need to re-install ports that had depended on the xz port and delete xz. While googling for the problem I found many reports of the problem with no solutions. A note in UPDATING (in this case, probably both of them, but at least /usr/src) could have made them easily resolved. Thanks for taking the time to educate me. I've been working with FreeBSD for several years, but I still don't know a great many things about it. --=20 R. Kevin Oberman, Network Engineer - Retired E-mail: kob6558@gmail.com