From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 08 12:52:43 2015 Received: (at submit) by debbugs.gnu.org; 8 Mar 2015 16:52:43 +0000 Received: from localhost ([127.0.0.1]:39579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YUeRW-0006Xy-OX for submit@debbugs.gnu.org; Sun, 08 Mar 2015 12:52:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57538) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YUeRT-0006Xk-Mj for submit@debbugs.gnu.org; Sun, 08 Mar 2015 12:52:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUeRN-0007XP-39 for submit@debbugs.gnu.org; Sun, 08 Mar 2015 12:52:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUeRN-0007XL-0E for submit@debbugs.gnu.org; Sun, 08 Mar 2015 12:52:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUeRL-0006LT-J5 for bug-guix@gnu.org; Sun, 08 Mar 2015 12:52:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUeRK-0007Ww-5x for bug-guix@gnu.org; Sun, 08 Mar 2015 12:52:31 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:33276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUeRJ-0007Wf-Ro for bug-guix@gnu.org; Sun, 08 Mar 2015 12:52:30 -0400 Received: by widfb4 with SMTP id fb4so3998834wid.0 for ; Sun, 08 Mar 2015 09:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; bh=rZHA+9Z5s6OxJlOs8Y10PxuE6OpXfeFDcfhLLOtgaq0=; b=IhauvStywRogLkRljDEFwLCpWL9X/M75BYjocQgIRvLuI5VSlh9XuUstnOIq4JNuSF Ew/jQvx+AT+Z56tv1Ttu6bz/XFt8HT7ZqaBEEuxXlD0tDWue9RikTRSrr7RCbRWdVYkz L1sr/xrXf1GWMfp38xaV+Gw+wvrX0LMgn+DX8hlWBhAzzUWXDNhAaBHaq0aJPGCpkDad 5oDisrOkkVpNMmCwvwSZlb2GkBbhMsqMQaaQ3eUoi6gBa56ydmUHuOVj0cUn2X0QYifo P3zSo8JbihRjGjWykXd7C651E+OQf+k2li/CPBsFO2+Exo5jaN3OteLKzY3upqOe/qss BrgA== X-Received: by 10.194.61.100 with SMTP id o4mr50357610wjr.28.1425833548149; Sun, 08 Mar 2015 09:52:28 -0700 (PDT) Received: from taylan.uni.cx (p200300514A4A40800213E8FFFEED36FB.dip0.t-ipconnect.de. [2003:51:4a4a:4080:213:e8ff:feed:36fb]) by mx.google.com with ESMTPSA id a13sm24452598wjx.30.2015.03.08.09.52.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Mar 2015 09:52:27 -0700 (PDT) From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) To: bug-guix@gnu.org Subject: jack2: Dangling .so references Date: Sun, 08 Mar 2015 17:52:25 +0100 Message-ID: <874mpvctyu.fsf@taylan.uni.cx> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-=-= Content-Type: text/plain While looking into another issue, I happened to notice dangling .so references in some executables in Guix packages. This is the first in a series of bug reports for each such package. Some might be false positives; Mark suggested I report them all so we have a list to go through. It's also not comprehensive because of course I don't have every Guix package installed; the script to go through one's /gnu/store to get output such as the following for each package is attached at the bottom of this mail. /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/ /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_midiseq libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_samplerate libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_showtime libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_wait libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_lsp libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_unload libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_test libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/alsa_out libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_metro libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jackdbus libjackserver.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_evmon libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_net_slave libjacknet.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_multiple_metro libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_latent_client libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_iodelay libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_zombie libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_freewheel libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_midisine libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_cpu libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_midi_dump libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_server_control libjackserver.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_transport libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_net_master libjacknet.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/alsa_in libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_simple_session_client libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_thru libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_cpu_load libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_alias libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_netsource libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_connect libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_load libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_session_notify libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_monitor_client libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_rec libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_midi_latency_test libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_simple_client libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/bin/jack_bufsize libjack.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/lib/jack/netadapter.so libjackserver.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/lib/jack/profiler.so libjackserver.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/lib/jack/inprocess.so libjackserver.so.0 => not found /gnu/store/0d8w37ddadcfnpw5rlhsfgvrha5f3x1f-jack2-1.9.10/lib/jack/netmanager.so libjackserver.so.0 => not found That would be references to libjack, libjacknet, and libjackserver. The script: --=-=-= Content-Type: text/x-sh Content-Disposition: inline; filename=guix-find-so.sh Content-Description: script # make sure to use a guix-installed ldd if not running this script on GuixSD for p in /gnu/store/*/; do matches=no if [ "$(find "$p" -type f -exec \ sh -c 'for f; do ldd "$f" 2>/dev/null \ | grep -Evq "/gnu/store/|linux-vdso\.so|not a dynamic exec|statically linked" && exit; done; exit 1' \ -- {} \; -print -quit)" \ != "" ]; then matches=yes fi if [ $matches = yes ]; then echo "$p"; echo; find "$p" -type f -exec \ sh -c 'for f; do if ldd "$f" 2>/dev/null \ | grep -Evq "/gnu/store/|linux-vdso\.so|not a dynamic exec|statically linked"; then printf " %s\n" "$f" ldd "$f" 2>/dev/null \ | grep -Ev "/gnu/store/|linux-vdso\.so|not a dynamic exec|statically linked" fi done' \ -- {} + echo; echo; fi done --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 09 18:27:30 2015 Received: (at 20039) by debbugs.gnu.org; 9 Mar 2015 22:27:30 +0000 Received: from localhost ([127.0.0.1]:40984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YV693-00009G-CC for submit@debbugs.gnu.org; Mon, 09 Mar 2015 18:27:29 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:47831 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YV691-000099-KJ for 20039@debbugs.gnu.org; Mon, 09 Mar 2015 18:27:28 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:60580 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YV690-0004df-Oh; Mon, 09 Mar 2015 18:27:27 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?=22Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer=22?=) Subject: Re: bug#20039: jack2: Dangling .so references References: <874mpvctyu.fsf@taylan.uni.cx> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 19 =?utf-8?Q?Vent=C3=B4se?= an 223 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Mon, 09 Mar 2015 23:27:20 +0100 In-Reply-To: <874mpvctyu.fsf@taylan.uni.cx> ("Taylan Ulrich \=\?utf-8\?Q\?\=5C\=22Bay\=C4\=B1rl\=C4\=B1\=2FKammer\=5C\=22\=22's\?\= message of "Sun, 08 Mar 2015 17:52:25 +0100") Message-ID: <87siddolh3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 20039 Cc: 20039@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) taylanbayirli@gmail.com (Taylan Ulrich "Bay=C4=B1rl=C4=B1/Kammer") skribis: > While looking into another issue, I happened to notice dangling .so > references in some executables in Guix packages. This is the first in a > series of bug reports for each such package. Some might be false > positives; Mark suggested I report them all so we have a list to go > through. It's also not comprehensive because of course I don't have > every Guix package installed; the script to go through one's /gnu/store > to get output such as the following for each package is attached at the > bottom of this mail. Nice, thanks the reports (although it=E2=80=99s a bit daunting ;-)). I think there are two things to do: 1. Identify the reasons why these things aren=E2=80=99t in the RUNPATH: missing -L? ld-wrapper bug (introduced in last =E2=80=98core-updates= =E2=80=99?)? 2. Add a standard phase in gnu-build-system.scm, based on (guix elf), that checks whether things in DT_NEEDED can actually be found among the directories in DT_RUNPATH, and errors out if not. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 30 12:06:27 2015 Received: (at 20039) by debbugs.gnu.org; 30 Mar 2015 16:06:28 +0000 Received: from localhost ([127.0.0.1]:40628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YccCo-0003x3-Eb for submit@debbugs.gnu.org; Mon, 30 Mar 2015 12:06:27 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:59328 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YccCl-0003wr-2T for 20039@debbugs.gnu.org; Mon, 30 Mar 2015 12:06:24 -0400 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:51188 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YccCk-0002RV-EO; Mon, 30 Mar 2015 12:06:22 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?=22Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer=22?=) Subject: Generic RUNPATH sanity checking References: <874mpvctyu.fsf@taylan.uni.cx> <87siddolh3.fsf@gnu.org> Date: Mon, 30 Mar 2015 18:06:20 +0200 In-Reply-To: <87siddolh3.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 09 Mar 2015 23:27:20 +0100") Message-ID: <87y4meeagz.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 20039 Cc: 20039@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > taylanbayirli@gmail.com (Taylan Ulrich "Bay=C4=B1rl=C4=B1/Kammer") skribi= s: > >> While looking into another issue, I happened to notice dangling .so >> references in some executables in Guix packages. This is the first in a >> series of bug reports for each such package. Some might be false >> positives; Mark suggested I report them all so we have a list to go >> through. It's also not comprehensive because of course I don't have >> every Guix package installed; the script to go through one's /gnu/store >> to get output such as the following for each package is attached at the >> bottom of this mail. > > Nice, thanks the reports (although it=E2=80=99s a bit daunting ;-)). > > I think there are two things to do: > > 1. Identify the reasons why these things aren=E2=80=99t in the RUNPATH: > missing -L? ld-wrapper bug (introduced in last =E2=80=98core-update= s=E2=80=99?)? > > 2. Add a standard phase in gnu-build-system.scm, based on (guix elf), > that checks whether things in DT_NEEDED can actually be found among > the directories in DT_RUNPATH, and errors out if not. I made some progress on #2. The attached module exports =E2=80=98validate-needed-in-runpath=E2=80=99, which does exactly what I wro= te above. I=E2=80=99ve tested it on the library and executables in my profile. It fi= nds real issues (libssl, libpython3, gsc and gsx from Ghostscript): --8<---------------cut here---------------start------------->8--- scheme@(guix build gremlin)> (define libs (find-files "/home/ludo/.guix-pro= file/lib" "\\.so$")) scheme@(guix build gremlin)> (define execs (find-files "/home/ludo/.guix-pr= ofile/bin" "")) scheme@(guix build gremlin)> (for-each validate-needed-in-runpath (filter e= lf-file? execs)) error: '/home/ludo/.guix-profile/bin/gsc' depends on 'libgs.so.9', which ca= nnot be found in RUNPATH ("/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glib= c-2.21/lib" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib6= 4" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib" "./sobin= " "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64= -unknown-linux-gnu/4.8.4/../../..") error: '/home/ludo/.guix-profile/bin/gsx' depends on 'libgs.so.9', which ca= nnot be found in RUNPATH ("/gnu/store/wiqbxcvzj3r35hd55yxzz919b1dv1hnv-glib= c-2.21/lib" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib6= 4" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib" "./sobin= " "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gcc/x86_64= -unknown-linux-gnu/4.8.4/../../..") scheme@(guix build gremlin)> (for-each validate-needed-in-runpath (filter e= lf-file? libs)) error: '/home/ludo/.guix-profile/lib/libc-2.21.so' depends on 'ld-linux-x86= -64.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libdl-2.21.so' depends on 'ld-linux-x8= 6-64.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libdl.so' depends on 'ld-linux-x86-64.= so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libmemusage.so' depends on 'ld-linux-x= 86-64.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_compat-2.21.so' depends on 'lib= nsl.so.1', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_compat.so' depends on 'libnsl.s= o.1', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_db-2.21.so' depends on 'libnss_= files.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_db.so' depends on 'libnss_files= .so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_hesiod-2.21.so' depends on 'lib= nss_files.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_hesiod.so' depends on 'libnss_f= iles.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_nis-2.21.so' depends on 'libnsl= .so.1', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_nis-2.21.so' depends on 'libnss= _files.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_nis.so' depends on 'libnsl.so.1= ', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_nis.so' depends on 'libnss_file= s.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_nisplus-2.21.so' depends on 'li= bnsl.so.1', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libnss_nisplus.so' depends on 'libnsl.= so.1', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libpthread-2.21.so' depends on 'ld-lin= ux-x86-64.so.2', which cannot be found in RUNPATH () error: '/home/ludo/.guix-profile/lib/libpython3.so' depends on 'libpython3.= 3m.so.1.0', which cannot be found in RUNPATH ("/gnu/store/wiqbxcvzj3r35hd55= yxzz919b1dv1hnv-glibc-2.21/lib" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1= l-gcc-4.8.4-lib/lib64" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8= .4-lib/lib" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/= gcc/x86_64-unknown-linux-gnu/4.8.4/../../..") error: '/home/ludo/.guix-profile/lib/libssl.so' depends on 'libcrypto.so.1.= 0.0', which cannot be found in RUNPATH ("/gnu/store/wiqbxcvzj3r35hd55yxzz91= 9b1dv1hnv-glibc-2.21/lib" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-= 4.8.4-lib/lib64" "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib= /lib" "." "/gnu/store/h132igxl2lkj3sbfcbknn2rd493j7d1l-gcc-4.8.4-lib/lib/gc= c/x86_64-unknown-linux-gnu/4.8.4/../../..") scheme@(guix build gremlin)> (length (filter elf-file? libs)) $51 =3D 305 scheme@(guix build gremlin)> (length (filter elf-file? execs)) $52 =3D 818 --8<---------------cut here---------------end--------------->8--- Note that by default libc=E2=80=99s own libraries (libdl, librt, libm, etc.= ) are always considered found. This is to avoid false positives, notably found in libc itself and also in Binutils programs (ar, ranlib, etc.) I also tried it on i686 binaries as well as cross-compiled MIPS binaries. The latter case revealed what appears to be a genuine packaging bug: --8<---------------cut here---------------start------------->8--- scheme@(guix build gremlin)> (validate-needed-in-runpath "/gnu/store/lblx8n= xh43zkp9k2n6b9q0j6ml96n64h-libunistring-0.9.5/lib/libunistring.so.2") error: '/gnu/store/lblx8nxh43zkp9k2n6b9q0j6ml96n64h-libunistring-0.9.5/lib/= libunistring.so.2' depends on 'libgcc_s.so.1', which cannot be found in RUN= PATH ("/gnu/store/3g4h2dk1b3v1z96yb1q4c838c52adg0y-glibc-cross-mips64el-lin= ux-gnu-2.21/lib" "/gnu/store/fl6mhhlwam8iyrxkngawrblrv1xbsmns-gcc-cross-mip= s64el-linux-gnu-4.8.4/lib64" "/gnu/store/fl6mhhlwam8iyrxkngawrblrv1xbsmns-g= cc-cross-mips64el-linux-gnu-4.8.4/lib") $57 =3D #f --8<---------------cut here---------------end--------------->8--- I=E2=80=99d like to give it a try in =E2=80=98core-updates=E2=80=99. Comments? Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-scheme; charset=utf-8 Content-Disposition: inline; filename=gremlin.scm Content-Transfer-Encoding: quoted-printable Content-Description: the code ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2015 Ludovic Court=C3=A8s ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (guix build gremlin) #:use-module (guix elf) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) #:use-module (srfi srfi-26) #:use-module (system foreign) #:use-module (rnrs bytevectors) #:use-module (rnrs io ports) #:export (elf-dynamic-info elf-dynamic-info? elf-dynamic-info-sopath elf-dynamic-info-needed elf-dynamic-info-rpath elf-dynamic-info-runpath validate-needed-in-runpath)) ;;; Commentary: ;;; ;;; A gremlin is sort-of like an elf, you know, and this module provides to= ols ;;; to deal with dynamic-link information from ELF files. ;;; ;;; Code: (define (dynamic-link-segment elf) "Return the 'PT_DYNAMIC' segment of ELF--i.e., the segment that contains dynamic linking information." (find (lambda (segment) (=3D (elf-segment-type segment) PT_DYNAMIC)) (elf-segments elf))) (define (word-reader size byte-order) "Return a procedure to read a word of SIZE bytes according to BYTE-ORDER." (case size ((8) (lambda (bv index) (bytevector-u64-ref bv index byte-order))) ((4) (lambda (bv index) (bytevector-u32-ref bv index byte-order))))) ;; Dynamic entry: ;; ;; typedef struct ;; { ;; Elf64_Sxword d_tag; /* Dynamic entry type */ ;; union ;; { ;; Elf64_Xword d_val; /* Integer value */ ;; Elf64_Addr d_ptr; /* Address value */ ;; } d_un; ;; } Elf64_Dyn; (define (raw-dynamic-entries elf segment) "Return as a list of type/value pairs all the dynamic entries found in SEGMENT, the 'PT_DYNAMIC' segment of ELF. In the result, each car is a DT_ value, and the interpretation of the cdr depends on the type." (define start (elf-segment-offset segment)) (define bytes (elf-bytes elf)) (define word-size (elf-word-size elf)) (define byte-order (elf-byte-order elf)) (define read-word (word-reader word-size byte-order)) (let loop ((offset 0) (result '())) (if (>=3D offset (elf-segment-memsz segment)) (reverse result) (let ((type (read-word bytes (+ start offset))) (value (read-word bytes (+ start offset word-size)))) (if (=3D type DT_NULL) ;finished? (reverse result) (loop (+ offset (* 2 word-size)) (alist-cons type value result))))))) (define (vma->offset elf vma) "Convert VMA, a virtual memory address, to an offset within ELF. Do that by looking at the loadable program segment (PT_LOAD) of ELF that contains VMA and by taking into account that segment's virtual address and offset." ;; See 'offset_from_vma' in Binutils. (define loads (filter (lambda (segment) (=3D (elf-segment-type segment) PT_LOAD)) (elf-segments elf))) (let ((load (find (lambda (segment) (let ((vaddr (elf-segment-vaddr segment))) (and (>=3D vma vaddr) (< vma (+ (elf-segment-memsz segment) vaddr))))) loads))) (+ (- vma (elf-segment-vaddr load)) (elf-segment-offset load)))) (define (dynamic-entries elf segment) "Return all the dynamic entries found in SEGMENT, the 'PT_DYNAMIC' segment of ELF, as a list of type/value pairs. The type is a DT_ value, and the va= lue may be a string or an integer depending on the entry type (for instance, the value of DT_NEEDED entries is a string.)" (define entries (raw-dynamic-entries elf segment)) (define string-table-offset (any (match-lambda ((type . value) (and (=3D type DT_STRTAB) value)) (_ #f)) entries)) (define (interpret-dynamic-entry type value) (cond ((memv type (list DT_NEEDED DT_SONAME DT_RPATH DT_RUNPATH)) (if string-table-offset (pointer->string (bytevector->pointer (elf-bytes elf) (vma->offset elf (+ string-table-offset value)))) value)) (else value))) (map (match-lambda ((type . value) (cons type (interpret-dynamic-entry type value)))) entries)) ;;; ;;; High-level interface. ;;; (define-record-type (%elf-dynamic-info soname needed rpath runpath) elf-dynamic-info? (soname elf-dynamic-info-soname) (needed elf-dynamic-info-needed) (rpath elf-dynamic-info-rpath) (runpath elf-dynamic-info-runpath)) (define search-path->list (let ((not-colon (char-set-complement (char-set #\:)))) (lambda (str) "Split STR on ':' characters." (string-tokenize str not-colon)))) (define (elf-dynamic-info elf) "Return dynamic-link information for ELF as an object,= or #f if ELF lacks dynamic-link information." (match (dynamic-link-segment elf) (#f #f) ((? elf-segment? dynamic) (let ((entries (dynamic-entries elf dynamic))) (%elf-dynamic-info (assv-ref entries DT_SONAME) (filter-map (match-lambda ((type . value) (and (=3D type DT_NEEDED) value)) (_ #f)) entries) (or (and=3D> (assv-ref entries DT_RPATH) search-path->list) '()) (or (and=3D> (assv-ref entries DT_RUNPATH) search-path->list) '())))))) (define %libc-libraries '("libc.so" "libpthread.so" "libdl.so" "libresolv.so" "librt.so" "libm.so")) (define (libc-library? lib) "Return #t if LIB is one of the libraries shipped with the GNU C Library." (find (lambda (libc-lib) (string-prefix? libc-lib lib)) %libc-libraries)) (define* (validate-needed-in-runpath file #:key (always-found? libc-library?)) "Return #t if all the libraries listed as FILE's 'DT_NEEDED' entries are present in its RUNPATH, or if FILE lacks dynamic-link information. Return = #f otherwise. Libraries whose name matches ALWAYS-FOUND? are considered to be always available." (let* ((elf (call-with-input-file file (compose parse-elf get-bytevector-all))) (dyninfo (elf-dynamic-info elf))) (when dyninfo (let* ((runpath (elf-dynamic-info-runpath dyninfo)) (needed (remove always-found? (elf-dynamic-info-needed dyninfo))) (not-found (remove (cut search-path runpath <>) needed))) (for-each (lambda (lib) (format (current-error-port) "error: '~a' depends on '~a', which cannot \ be found in RUNPATH ~s~%" file lib runpath)) not-found) ;; (when (null? not-found) ;; (format (current-error-port) "~a is OK~%" file)) (null? not-found))))) ;;; gremlin.scm ends here --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu May 07 16:18:25 2015 Received: (at 20039-done) by debbugs.gnu.org; 7 May 2015 20:18:26 +0000 Received: from localhost ([127.0.0.1]:38124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YqSFV-0007uh-MQ for submit@debbugs.gnu.org; Thu, 07 May 2015 16:18:25 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:58961 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YqSFS-0007uW-Mf for 20039-done@debbugs.gnu.org; Thu, 07 May 2015 16:18:23 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:43114 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YqSFS-0004pv-0V; Thu, 07 May 2015 16:18:22 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?=22Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer=22?=) Subject: Re: bug#20039: jack2: Dangling .so references References: <874mpvctyu.fsf@taylan.uni.cx> Date: Thu, 07 May 2015 22:18:19 +0200 In-Reply-To: <874mpvctyu.fsf@taylan.uni.cx> ("Taylan Ulrich \=\?utf-8\?Q\?\=5C\=22Bay\=C4\=B1rl\=C4\=B1\=2FKammer\=5C\=22\=22's\?\= message of "Sun, 08 Mar 2015 17:52:25 +0100") Message-ID: <87sib8m99w.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 20039-done Cc: 20039-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Fixed in b416c64. Ludo'. From unknown Tue Jun 24 05:08:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 05 Jun 2015 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator