Debootstrapping debian-bullseye arm64 segfaults with qemu >=8.1

Host environment

  • Operating system:

    • Gentoo Linux
    • Debian Trixie
  • OS/kernel version:

    • Linux hp15 6.6.30 #1 SMP PREEMPT_DYNAMIC Thu May 30 19:27:00 +03 2024 x86_64
    • Linux debian 6.7.12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.12-1 (2024-04-24) aarch64 GNU/Linux
  • Architecture: AMD64

  • QEMU flavor: qemu-aarch64

  • QEMU version:

    • 8.1.5, 8.2.3, 9.0.0
    • 8.2.4
  • Command line:

    • sudo debootstrap --arch=arm64 bullseye root11-arm64

I use Gentoo Linux (stable packages) as a host and my work is related to building Debian-based distros for armhf/arm64/riscv64 targets. Starting from qemu 8.1.x (and till 9.0.0) debootstrapping Debian Bullseye fails (for arm64 architecture only)

Steps to reproduce

  1. Use qemu >= 8.1 (version <= 8.0.x work well)
  2. Install debootstrap package
  3. Run sudo debootstrap --arch=arm64 bullseye root11-arm64

This fails to chroot into the system being debootstrapped:

$ sudo debootstrap --arch=arm64 bullseye root11-arm64
...
W: Failure trying to run: chroot "/home/3/root11" /sbin/ldconfig
W: See /home/3/root11/debootstrap/debootstrap.log for details
$ tail -n2 /home/3/root11/debootstrap/debootstrap.log
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
/usr/share/debootstrap/functions: line 1092:  3869 Segmentation fault      chroot "/home/3/root11" "$@"

Additional information

Failure happens only when debootstrapping "bullseye" with "arm64" architecture. Older (e.g. <= "buster") and newer (e.g. > "bookworm") distros are deboostrapped OK. Other (e.g. "armhf" and others) architectures are debootstrapped OK.

Qemu version <8.1 (e.g. 8.0.5 I use in Gentoo or versions in Debian <= bookworm) don't have the bug.

Originally faced the issue with Gentoo host. Recently rechecked with Debian Trixie host.