From owner-freebsd-stable@freebsd.org Thu Nov 14 19:30:44 2019 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B9A31B110B for ; Thu, 14 Nov 2019 19:30:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47DWmL4n8Rz40Nj for ; Thu, 14 Nov 2019 19:30:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xAEJUSIu082629 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 14 Nov 2019 21:30:32 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xAEJUSIu082629 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xAEJUSPp082627; Thu, 14 Nov 2019 21:30:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 14 Nov 2019 21:30:28 +0200 From: Konstantin Belousov To: mike tancsa Cc: FreeBSD-STABLE Mailing List Subject: Re: lib not found and found at the same time ? Message-ID: <20191114193028.GC2707@kib.kiev.ua> References: <20191113222525.GW2707@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 47DWmL4n8Rz40Nj X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-0.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; IP_SCORE(0.00)[ip: (-2.72), ipnet: 2001:470::/32(-4.62), asn: 6939(-3.49), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; R_SPF_SOFTFAIL(0.00)[~all:c]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; SUBJECT_ENDS_QUESTION(1.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Nov 2019 19:30:44 -0000 On Thu, Nov 14, 2019 at 08:46:13AM -0500, mike tancsa wrote: > > On 11/13/2019 5:25 PM, Konstantin Belousov wrote: > > On Wed, Nov 13, 2019 at 04:48:40PM -0500, mike tancsa wrote: > >> I was trying to upgrade (failed) and then re-install the > >> samba410-4.10.10 port on a RELENG12 box.  One of the Samba libs shows > >> some output I dont understand on ldd > >> > >> ldd /usr/local/lib/nss_wins.so.1 > >> /usr/local/lib/nss_wins.so.1: > >>         libwbclient.so.0 => /usr/local/lib/samba4/libwbclient.so.0 > >> (0x801003000) > >>         libwinbind-client-samba4.so => not found (0) > >>         libreplace-samba4.so => not found (0) > >>         libcrypt.so.5 => /lib/libcrypt.so.5 (0x80066b000) > >>         libc.so.7 => /lib/libc.so.7 (0x80024a000) > >>         libwinbind-client-samba4.so => > >> /usr/local/lib/samba4/private/libwinbind-client-samba4.so (0x801213000) > >>         libreplace-samba4.so => > >> /usr/local/lib/samba4/private/libreplace-samba4.so (0x801417000) > >> > >> > >> There are 2 libs it says it cannot find, but then a few lines below it > >> says it found them ? > > First instance (not found) is probably the direct dependency, which is > > probably not found because nss_wins.so does not have rpath recorded. > > Then, I guess, some other library also depends on libwinbind-client-samba4.so, > > but this library has rpath. > > > > You can check this with readelf, look for DT_NEEDED and DT_RPATH* > > dynamic entries. > > Thanks! > >  readelf -d nss_wins.so.1 > > Dynamic section at offset 0x1d20 contains 32 entries: >   Tag                Type                  Name/Value >  0x0000000000000001 NEEDED               Shared library: [libwbclient.so.0] >  0x0000000000000001 NEEDED               Shared library: > [libwinbind-client-samba4.so] >  0x0000000000000001 NEEDED               Shared library: > [libreplace-samba4.so] >  0x0000000000000001 NEEDED               Shared library: [libcrypt.so.5] >  0x0000000000000001 NEEDED               Shared library: [libc.so.7] >  0x000000000000000e SONAME               Library soname: [nss_wins.so.1] >  0x000000000000000f RPATH                Library rpath: [/usr/local/lib] >  0x000000000000001d RUNPATH              Library runpath: [/usr/local/lib] > > Looking at other libs, they have the settings > >  0x000000000000000f RPATH                Library rpath: > [/usr/local/lib/samba4/private:/usr/local/lib] >  0x000000000000001d RUNPATH              Library runpath: > [/usr/local/lib/samba4/private:/usr/local/lib] > > What is the best way to fix this ? It seems I can do a quick libmap > entry and it seems to correct it > > > [/usr/local/lib/nss_wins.so.1] > libwinbind-client-samba4.so      > /usr/local/lib/samba4/private/libwinbind-client-samba4.so > libreplace-samba4.so /usr/local/lib/samba4/private/libreplace-samba4.so > >  ldd nss_wins.so.1 > nss_wins.so.1: >         libwbclient.so.0 => /usr/local/lib/samba4/libwbclient.so.0 > (0x801003000) >         libwinbind-client-samba4.so => > /usr/local/lib/samba4/private/libwinbind-client-samba4.so (0x801213000) >         libreplace-samba4.so => > /usr/local/lib/samba4/private/libreplace-samba4.so (0x801417000) >         libcrypt.so.5 => /lib/libcrypt.so.5 (0x80066b000) >         libc.so.7 => /lib/libc.so.7 (0x80024a000) > > This is something that needs to be fixed in the port at build time ? Why is it a problem ? If the library is loaded from a binary that already linked to the depended lib it would just work. Otherwise yes, it is the ports' build issue, it must not be papered over with libmap or LD_LIBRARY_PATH.