From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +JDQGa7cPGLWXgEAgWs5BA (envelope-from ) for ; Thu, 24 Mar 2022 22:03:42 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aHlwEq7cPGJCawEAG6o9tA (envelope-from ) for ; Thu, 24 Mar 2022 22:03:42 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DB77A22556 for ; Thu, 24 Mar 2022 22:03:41 +0100 (CET) Received: from localhost ([::1]:52760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXUcO-00007T-EH for larch@yhetil.org; Thu, 24 Mar 2022 17:03:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXUbm-00005K-KD for bug-guix@gnu.org; Thu, 24 Mar 2022 17:03:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXUbm-0001Sd-BM for bug-guix@gnu.org; Thu, 24 Mar 2022 17:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nXUbl-0007bh-Mm; Thu, 24 Mar 2022 17:03:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#54557: =?UTF-8?Q?=E2=80=9Cfakechroot=E2=80=9D?= execution engine =?UTF-8?Q?doesn=E2=80=99t?= work for Bash Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: philippe.swartvagher@inria.fr, bug-guix@gnu.org Resent-Date: Thu, 24 Mar 2022 21:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54557 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 54557@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org X-Debbugs-Original-Xcc: Philippe Swartvagher Received: via spool by submit@debbugs.gnu.org id=B.164815572929176 (code B ref -1); Thu, 24 Mar 2022 21:03:01 +0000 Received: (at submit) by debbugs.gnu.org; 24 Mar 2022 21:02:09 +0000 Received: from localhost ([127.0.0.1]:49550 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXUav-0007aV-8H for submit@debbugs.gnu.org; Thu, 24 Mar 2022 17:02:09 -0400 Received: from lists.gnu.org ([209.51.188.17]:48928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXUat-0007aO-Cx for submit@debbugs.gnu.org; Thu, 24 Mar 2022 17:02:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXUat-0007O8-5e for bug-guix@gnu.org; Thu, 24 Mar 2022 17:02:07 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:27990) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXUaq-0001Mg-KX for bug-guix@gnu.org; Thu, 24 Mar 2022 17:02:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=QURPnURnUZfKNUn6iQDasqCxGv+g3KffKDgDe2vWZ0E=; b=f6EmkPveJ21NwI4BfA5J7YtU3d5LWxFiL2C89TU4aG35JCHUOstMA+jf 2wUZeZ4CNHEdZN7XWdtGkIu97QAs42VdUtU3A+Vsl4p0gjHjjJvbc7xk/ RNwrifRV8ml64S7SC2FosjcD6kBPs7UIah3v7QJuofm7lrCbhavZIacl0 4=; X-IronPort-AV: E=Sophos;i="5.90,208,1643670000"; d="scan'208";a="28011246" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2022 22:02:01 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 Germinal an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 24 Mar 2022 22:02:00 +0100 Message-ID: <87sfr79i9j.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=192.134.164.83; envelope-from=ludovic.courtes@inria.fr; helo=mail2-relais-roc.national.inria.fr X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Philippe Swartvagher Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648155822; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=QURPnURnUZfKNUn6iQDasqCxGv+g3KffKDgDe2vWZ0E=; b=s6KL44XUNldeULC1X5k04a7v3Nh6oqUx0P0YUM1qOjOs30m1aTBwpw1cxeyTxorcMKcLbI TvWvE2aEN4lqjYG/4FvfHIEMHWYaK5Jvc9s7Dy0HXd8ZLeL+2d3CZ1t8UVpAfXMhRyw3t8 KN3ZGhNrwIGv4UI7LQwBoF5TQlu0ePFt3DWHMZtmTaNdjho+V4Qz1TxRkqQcBSIzkMbOGR OzbmQiqx2BkrLI3U2x+SqvCiQm81xBi45otV2xJ/8qarAR9EL44LOTk3qg3JS9x6TkfGWO karjFyYXPhDev5l2okJNvJeGkz3c5Bha0lrFuRL3J+Rb7Mg3JTY1p/L00e5ZcA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648155822; a=rsa-sha256; cv=none; b=RR9W5WsquXjH5KGnEk2Emyx9p86P+/ZZM+9JfxLTcnaHmDf5gxBW7AvfQ/5IeHtE0GAjLX /oqemdP/rs48HcdbgU1qUDSiflvetxbjbSpO1Mvun693zA/+dVUNDQAJQp4r6fEyMi6ziT zzXkRHIG2064oCE2DsUqz5H+YDS838MRj4vHBchVkVL7pHR8sEhIpO6BK/3A6RcTIic2J5 DYIwetKTmROgaBp2joBf7yGTcKQV2LUlVShpgGnHLBYQsvVurpv47bNR+am1An45uBUyKj PtwSu1QmakVoPMZGe2VzmtN3ij6onEGwtLwln2qdE9/SHBn0fXTNXtrLXjuj6g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=inria.fr header.s=dc header.b=f6EmkPve; dmarc=fail reason="SPF not aligned (relaxed)" header.from=inria.fr (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.21 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=inria.fr header.s=dc header.b=f6EmkPve; dmarc=fail reason="SPF not aligned (relaxed)" header.from=inria.fr (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: DB77A22556 X-Spam-Score: 5.21 X-Migadu-Scanner: scn0.migadu.com X-TUID: G9vi/gE0S6cE Hello! The =E2=80=9Cfakechroot=E2=80=9D engine fails when applied to =E2=80=98bash= =E2=80=99: --8<---------------cut here---------------start------------->8--- $ guix pack -RR bash -S /bin=3Dbin=20 /gnu/store/mnbmklbvd1pk7yby0k8h26msk6z11m1m-bash-tarball-pack.tar.gz $ (cd /tmp/pack; tar xf /gnu/store/mnbmklbvd1pk7yby0k8h26msk6z11m1m-bash-ta= rball-pack.tar.gz) $ unshare -mrf sh -c 'mount -t tmpfs -o ro none /gnu/store; GUIX_EXECUTION_= ENGINE=3Dfakechroot /tmp/pack/bin/bash --version' /tmp/pack/gnu/store/d99ykvj3axzzidygsmdmzxah4lvxd6hw-bash-5.1.8/bin//bash: = out of memory to store relocation results for /tmp/pack/bin/bash --8<---------------cut here---------------end--------------->8--- The message comes from ld.so. My guess is that the problem comes from Bash=E2=80=99s terrible =E2=80=98malloc=E2=80=99 replacement: --8<---------------cut here---------------start------------->8--- $ objdump -T /gnu/store/d99ykvj3axzzidygsmdmzxah4lvxd6hw-bash-5.1.8/bin/bas= h | grep malloc 00000000004ae6f0 g DF .text 000000000000003b Base malloc_usable_= size 00000000004ae850 g DF .text 0000000000000009 Base malloc 0000000000484e70 g DF .text 000000000000005b Base xmalloc 00000000004ee020 g DO .bss 0000000000000004 Base malloc_trace_at= _exit 00000000004e8c24 g DO .data 0000000000000004 Base malloc_mmap_th= reshold 0000000000484f70 g DF .text 00000000000000dd Base sh_xmalloc 00000000004f7a04 g DO .bss 0000000000000004 Base malloc_trace 00000000004f7a08 g DO .bss 0000000000000004 Base malloc_flags 00000000004ae730 g DF .text 0000000000000005 Base sh_malloc 00000000004f7a00 g DO .bss 0000000000000004 Base malloc_register 00000000004ae660 g DF .text 000000000000000c Base _malloc_unbloc= k_signals 00000000004ae630 g DF .text 000000000000002e Base _malloc_block_= signals --8<---------------cut here---------------end--------------->8--- [Time passes=E2=80=A6] I confirmed this hypothesis by running: guix pack -RR -S /bin=3Dbin -m manifest.scm on this manifest: --8<---------------cut here---------------start------------->8--- (use-modules (guix) (guix utils) (guix profiles) (gnu packages bash)) (define bash-sans-malloc (package/inherit bash (name "bash-sans-malloc") (arguments (substitute-keyword-arguments (package-arguments bash) ((#:configure-flags flags ''()) `(cons "--without-bash-malloc" ,flags)))))) (packages->manifest (list bash-sans-malloc)) --8<---------------cut here---------------end--------------->8--- Works just fine: --8<---------------cut here---------------start------------->8--- $ unshare -mrf sh -c 'mount -t tmpfs -o ro none /gnu/store; GUIX_EXECUTION_= ENGINE=3Dfakechroot /tmp/pack/bin/bash --version' GNU bash, version 5.1.8(1)-release (x86_64-unknown-linux-gnu) Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. --8<---------------cut here---------------end--------------->8--- So in the end, it=E2=80=99s a bug report that=E2=80=99s kinda closed alread= y. Perhaps we should build Bash =E2=80=98--without-bash-malloc=E2=80=99 uncond= itionally in =E2=80=98core-updates=E2=80=99? The =E2=80=98INSTALL=E2=80=99 file reads: --8<---------------cut here---------------start------------->8--- '--with-bash-malloc' Use the Bash version of 'malloc' in the directory 'lib/malloc'. This is not the same 'malloc' that appears in GNU libc, but an older version originally derived from the 4.2 BSD 'malloc'. This 'malloc' is very fast, but wastes some space on each allocation. This option is enabled by default. The 'NOTES' file contains a list of systems for which this should be turned off, and 'configure' disables this option automatically for a number of systems. --8<---------------cut here---------------end--------------->8--- There might be other options if we want to keep it, such as changing the ELF visibility of those symbols, but I wonder if it=E2=80=99s worth the eff= ort. Thoughts? Ludo=E2=80=99.