From nobody Wed Jun 15 17:04:48 2022 X-Original-To: freebsd-emulation@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3ED6F8335EC for ; Wed, 15 Jun 2022 17:04:59 +0000 (UTC) (envelope-from martin@lispworks.com) Received: from mail.lispworks.com (mail.lispworks.com [46.17.166.21]) by mx1.freebsd.org (Postfix) with ESMTP id 4LNWrV0l0cz3Fmc; Wed, 15 Jun 2022 17:04:57 +0000 (UTC) (envelope-from martin@lispworks.com) Received: from higson.cam.lispworks.com (higson.cam.lispworks.com [192.168.1.7]) by lwfs1-cam.cam.lispworks.com (8.16.1/8.16.1) with ESMTP id 25FH4mgw078502; Wed, 15 Jun 2022 18:04:48 +0100 (BST) (envelope-from martin@lispworks.com) Received: from higson.cam.lispworks.com (localhost.localdomain [127.0.0.1]) by higson.cam.lispworks.com (8.14.4) id 25FH4mHK019073; Wed, 15 Jun 2022 18:04:48 +0100 Received: (from martin@localhost) by higson.cam.lispworks.com (8.14.4/8.14.4/Submit) id 25FH4m4d019069; Wed, 15 Jun 2022 18:04:48 +0100 Date: Wed, 15 Jun 2022 18:04:48 +0100 Message-Id: <202206151704.25FH4m4d019069@higson.cam.lispworks.com> From: Martin Simmons To: Sysadmin Lists CC: freebsd-emulation@freebsd.org, dchagin@freebsd.org In-reply-to: <2033861928.1354940.1655236558393@ichabod.co-bxl> (message from Sysadmin Lists on Tue, 14 Jun 2022 21:55:58 +0200 (CEST)) Subject: Re: libc6 Compatibility References: <1236409007.1125724.1655169963971@ichabod.co-bxl> <2033861928.1354940.1655236558393@ichabod.co-bxl> X-Rspamd-Queue-Id: 4LNWrV0l0cz3Fmc X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of martin@lispworks.com has no SPF policy when checking 46.17.166.21) smtp.mailfrom=martin@lispworks.com X-Spamd-Result: default: False [-0.27 / 15.00]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[martin]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.996]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[lispworks.com]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.70)[0.697]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.969]; MLMMJ_DEST(0.00)[freebsd-emulation]; R_SPF_NA(0.00)[no SPF record]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:51055, ipnet:46.17.160.0/21, country:GB] X-ThisMailContainsUnwantedMimeParts: N List-Id: Development of Emulators of other operating systems List-Archive: https://lists.freebsd.org/archives/freebsd-emulation List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-emulation@freebsd.org >>>>> On Tue, 14 Jun 2022 21:55:58 +0200 (CEST), Sysadmin Lists said: > > > ---------------------------------------- > > From: Dmitry Chagin > > Sent: Tue Jun 14 09:24:37 CEST 2022 > > To: Sysadmin Lists > > Cc: Freebsd Emulation > > Subject: Re: libc6 Compatibility > > > > > > On Tue, Jun 14, 2022 at 03:26:03AM +0200, Sysadmin Lists wrote: > > > Does Linux compat not work with Ubuntu's newest libc6 update? > > > I used to run Brave browser from it, but now I get this error message: > > > > > > $ /compat/ubuntu/opt/brave.com/brave/brave > > > ELF interpreter /lib64/ld-linux-x86-64.so.2 not found, error 2 > > > Abort trap > > > > > > The shared object is loaded in memory: > > > $ ldd /opt/brave.com/brave/brave | grep ld- > > > /lib64/ld-linux-x86-64.so.2 (0x0000000001021000) > > > > > > And it exists on the filesystem: > > > $ find /compat/ubuntu/lib**/ -name ld-\* -exec ls -lh '{}' + > > > -rwxr-xr-x 1 root wheel 187K Dec 16 2020 /compat/ubuntu/lib/x86_64-linux-gnu/ld-2.31.so > > > lrwxr-xr-x 1 root wheel 10B Dec 16 2020 /compat/ubuntu/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 -> ld-2.31.so > > > lrwxr-xr-x 1 root root 34B Mar 23 2021 /compat/ubuntu/lib64/ld-linux-x86-64.so.2 -> ../lib/x86_64-linux-gnu/ld-2.31.so > > > > > > This is the update that broke it: > > > $ apt-get install libc6 > > > Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libc6 amd64 2.31-0ubuntu9.9 [2722 kB] > > > > > > > try ktrace it, aka ktrace -di /compat/ubuntu/opt/brave.com/brave/brave > > then kdump -HAR -m 128 > brave.log > > > > > > Thanks, Dmitry. That helped me find the problem. Here's the full log: > > $ cat brave.log > 8184 101222 ktrace 0.000000 RET F64 ktrace 0 > 8184 101222 ktrace 0.000014 CALL F64 execve(0x7fffffffeda3,0x7fffffffeac0,0x7fffffffead0) > 8184 101222 ktrace 0.000003 NAMI F64 "/compat/ubuntu/opt/brave.com/brave/brave" > 8184 101222 ktrace 0.055726 NAMI F64 "/compat/ubuntu/lib64/ld-linux-x86-64.so.2" > 8184 101222 ktrace 0.000032 NAMI F64 "/lib64/ld-linux-x86-64.so.2" > > And here's an updated `ls' printout after upgrading libc6: > $ find /compat/ubuntu/lib**/ -name ld-\* -exec ls -lh '{}' + > -rwxr-xr-x 1 root wheel 187K Apr 6 18:24 /compat/ubuntu/lib/x86_64-linux-gnu/ld-2.31.so > lrwxr-xr-x 1 root wheel 10B Apr 6 18:24 /compat/ubuntu/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 -> ld-2.31.so > lrwxr-xr-x 1 root wheel 32B Apr 6 18:24 /compat/ubuntu/lib64/ld-linux-x86-64.so.2 -> /lib/x86_64-linux-gnu/ld-2.31.so > > The new .so is missing 'previous directory' dots in the symlink path. It looks like the link with the dots was made by hand in 2021, presumably to fix this. > I thought Linux compat was designed to search compat.linux.emul_path > for shared libs first, but apparently it works differently than that. What does linux compat do in general with absolute symlinks? Does it check the target with compat.linux.emul_path prepended? __Martin