bash crashes in qemu-user environments (bionic)

Bug #1751011 reported by Peter Ogden on 2018-02-22
40
This bug affects 7 people
Affects Status Importance Assigned to Milestone
bash (Debian)
Fix Released
Unknown
bash (Ubuntu)
High
Matthias Klose
Bionic
High
Matthias Klose
qemu (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
Unassigned

Bug Description

Attempts to launch bash in an arm64 qemu-user environment in bionic results in the following error message:

bash: xmalloc: .././shell.c:1709: cannot allocate 10 bytes (0 bytes allocated)

This causes any qemu/chroot based bootstrapping to fail as many packages invoke bash during postinst.

Version: bash_4.4.18-1ubuntu1_arm64
Release: 18.04 pre-release

QEMU: 2.8.0

This appears to have been reported and fixed in the corresponding Debian package (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=889869)

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bash (Ubuntu):
status: New → Confirmed
Dominique Belhachemi (domibel) wrote :

This has been fixed in Debian's bash (4.4.18-1.1)

Changed in bash (Debian):
status: Unknown → Fix Released
tags: added: arm64 bionic
tags: added: rls-bb-incoming
Changed in bash (Ubuntu):
status: Confirmed → Fix Committed
Brian Murray (brian-murray) wrote :

Upstream's fix is not something we are keen to change.

 bash (4.4.18-1.1) unstable; urgency=high
 .
   * Non-maintainer upload.
   * Build again with -no-pie as dropping it broke bash when run under
     qemu-user (with the same symptoms as #842037). Closes: #889869

Changed in bash (Ubuntu):
status: Fix Committed → Triaged

The ROS (http://www.ros.org/) team uses qemu and docker to build native arm packages on our buildfarm. So this is a pretty significant roadblock for us as we prepare our next release based on bionic.

Many of our build processes rely on bash scripts, but even if we were to port all of those away from bash, it's an essential package and building an image without it is not really tenable. I have packaged bash with the -no-pie flag restored and that's working for us at the moment, but even incorporating that into our image baking process is not very clean (https://github.com/osrf/multiarch-docker-image-generation/pull/21).

If upstream's solution is not preferred. Is there another way to get bash working under qemu within the release window?

Chanho Park (chanho61.park) wrote :

I'd like to know any progress from the qemu community. I feel like it would be long journey to address this problem.

Steve Langasek (vorlon) on 2018-03-15
tags: added: rls-bb-notfixing
removed: rls-bb-incoming
Matthias Klose (doko) wrote :

This is upstream LP: #1749393

Jeremy Bicha (jbicha) on 2018-03-22
Changed in bash (Ubuntu):
importance: Undecided → High
Steve Langasek (vorlon) wrote :

<jbicha> slangasek: can you explain the bash 4.4.18-1.1ubuntu1 removal?
<jbicha> because I used sbuild-launchpad-chroot to create an armhf chroot but it is stuck trying to update bash with an error that looks like Debian bug 889869
<slangasek> jbicha: PIE is a security feature, and shouldn't be disabled to work around a bug in qemu-user-static

Jeremy Bicha (jbicha) wrote :

Matthias, please investigate compiling bash using --without-bash-malloc (and then re-enabling PIE in Debian).

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=865599#15

Changed in bash (Ubuntu):
assignee: nobody → Matthias Klose (doko)
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qemu (Ubuntu):
status: New → Confirmed
Jeremy Bicha (jbicha) wrote :

I'm readding the rls-bb-incoming tag. Hope y'all don't mind. I just think this needs to be fixed for the 18.04 LTS release. It doesn't matter to me whether it's fixed/worked around in bash or in qemu as long as it works. :)

tags: added: rls-bb-incoming
removed: rls-bb-notfixing
Alkis Georgopoulos (alkisg) wrote :

Another use case is in LTSP, where we debootstrap an armhf chroot to netboot raspberrypi clients.
This currently fails in 18.04.

Steve Langasek (vorlon) on 2018-04-04
Changed in bash (Ubuntu):
status: Triaged → Fix Committed
tags: removed: rls-bb-incoming
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bash - 4.4.18-2ubuntu1

---------------
bash (4.4.18-2ubuntu1) bionic; urgency=medium

  * Merge with Debian; remaining changes:
    - skel.bashrc:
      - Run lesspipe.
      - Enable ls aliases.
      - Set options in ll alias to -alF.
      - Define an alert alias.
      - Enabled colored grep aliases.
    - etc.bash.bashrc:
      - Add sudo hint.

bash (4.4.18-2) unstable; urgency=medium

  * Revert the changes from the last upload.
  * Configure the normal build --without-bash-malloc as well.
    See http://lists.nongnu.org/archive/html/qemu-devel/2018-03/msg04700.html
    for the qemu fix. Closes: #865599. LP: #1751011.
  * Apply upstream patch 019.

bash (4.4.18-1.1) unstable; urgency=high

  * Non-maintainer upload.
  * Build again with -no-pie as dropping it broke bash when run under
    qemu-user (with the same symptoms as #842037). Closes: #889869
    Re-opens: #865599

 -- Matthias Klose <email address hidden> Wed, 04 Apr 2018 20:30:26 +0200

Changed in bash (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.