all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludovic.courtes@inria.fr>
Cc: 54557@debbugs.gnu.org,
	Philippe Swartvagher <philippe.swartvagher@inria.fr>
Subject: bug#54557: “fakechroot” execution engine doesn’t work for Bash
Date: Fri, 25 Mar 2022 23:03:13 -0400	[thread overview]
Message-ID: <878rsxxvny.fsf@gmail.com> (raw)
In-Reply-To: <87sfr79i9j.fsf@inria.fr> ("Ludovic Courtès"'s message of "Thu, 24 Mar 2022 22:02:00 +0100")

Hi Ludovic,

Ludovic Courtès <ludovic.courtes@inria.fr> writes:

[...]

> The message comes from ld.so.  My guess is that the problem comes from
> Bash’s terrible ‘malloc’ replacement:
>

[...]

> [Time passes…]  I confirmed this hypothesis by running:
>
>   guix pack -RR -S /bin=bin -m manifest.scm
>
> on this manifest:
>
> (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))
>
>
> Works just fine:
>
> $ unshare -mrf sh -c 'mount -t tmpfs -o ro none /gnu/store; GUIX_EXECUTION_ENGINE=fakechroot /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 <http://gnu.org/licenses/gpl.html>

[...]

> Perhaps we should build Bash ‘--without-bash-malloc’ unconditionally in
> ‘core-updates’?  The ‘INSTALL’ file reads:
>
> '--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.
>
> 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’s worth the effort.
>
> Thoughts?

I'd be OK with --without-bash-malloc; it seems we'll pay a bit in terms
of Bash performance in exchange for better memory usage.  It also brings
benefits such as solving this issue and may benefit from
advances/bugfixes to glibc's malloc in the future, if there are any.

Well done investigating!

Maxim




  parent reply	other threads:[~2022-03-26  3:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 21:02 bug#54557: “fakechroot” execution engine doesn’t work for Bash Ludovic Courtès
2022-03-25 10:16 ` Philippe SWARTVAGHER
2022-03-28  6:59   ` Ludovic Courtès
2022-03-26  3:03 ` Maxim Cournoyer [this message]
2022-03-28 10:06   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878rsxxvny.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=54557@debbugs.gnu.org \
    --cc=ludovic.courtes@inria.fr \
    --cc=philippe.swartvagher@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.