#1030627 debootstrap: Causes dpkg segfault in "chroot /… dpkg --force-depends --install /var/cache/apt/archives/base-passwd_3.5.26_amd64.deb" when trying to bootstrap Wheezy or earlier

Package:
debootstrap
Source:
debootstrap
Submitter:
Axel Beckert
Date:
2026-01-10 11:15:28 UTC
Severity:
normal
Tags:
#1030627#5
Date:
2023-02-05 21:12:53 UTC
From:
To:
Running "debootstrap --verbose --arch amd64
--keyring=/usr/share/keyrings/debian-archive-removed-keys.gpg wheezy
/tmp/hH11H2NR4o http://archive.debian.org/debian" (or Debian or Ubuntu
releases older than that) on Sid/Bookworm ends up like this:

[…]
I: Extracting tar...
I: Extracting tzdata...
I: Extracting util-linux...
I: Extracting xz-utils...
I: Extracting zlib1g...
I: Installing core packages...
W: Failure trying to run: chroot "/tmp/hH11H2NR4o" dpkg --force-depends --install /var/cache/apt/archives/base-passwd_3.5.26_amd64.deb
W: See /tmp/hH11H2NR4o/debootstrap/debootstrap.log for details

Looking into /tmp/hH11H2NR4o/debootstrap/debootstrap.log I find this
dpkg segfault at the end:

[…]
2023-02-05 21:13:42 (1.72 MB/s) - '/tmp/hH11H2NR4o//var/cache/apt/archives/partial/zlib1g_1%3a1.2.7.dfsg-13_amd64.deb' saved [87392/87392]

dpkg: warning: parsing file '/var/lib/dpkg/status' near line 5 package 'dpkg':
 missing description
dpkg: warning: parsing file '/var/lib/dpkg/status' near line 5 package 'dpkg':
 missing architecture
Segmentation fault (core dumped)

The segfault seems to have beein in the dpkg inside the chroot, not in
debootstrap:

[1395173.551147] dpkg[17643] vsyscall attempted with vsyscall=none ip:ffffffffff600400 cs:33 sp:7ffcc14c1118 ax:ffffffffff600400 si:428720 di:7ffcc14c1130
[1395173.551155] dpkg[17643]: segfault at ffffffffff600400 ip ffffffffff600400 sp 00007ffcc14c1118 error 15 likely on CPU 6 (core 6, socket 0)
[1395173.551160] Code: Unable to access opcode bytes at 0xffffffffff6003d6.

/tmp/hH11H2NR4o/var/lib/dpkg/status looks like this afterwards:

Package: dpkg
Status: install ok installed
Maintainer: unknown
Version: 1.16.18

This file seems to have been generated by scripts/debian-common.

Not sure if something changed in the way debootstrap generates initial
files like this, but to me this seems a regression in deboostrap
compared to Bullseye where this still worked. Could have other reasons,
though, too.

Here's end of an "strace -f" of that chrooted dpkg call:

9440  stat("/sbin/start-stop-daemon", {st_mode=S_IFREG|0755, st_size=28152, ...}) = 0
9440  open("/var/lib/dpkg/info/format", O_RDONLY) = 6
9440  fstat(6, {st_mode=S_IFREG|0644, st_size=2, ...}) = 0
9440  mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbf38160000
9440  read(6, "1\n", 4096)              = 2
9440  close(6)                          = 0
9440  munmap(0x7fbf38160000, 4096)      = 0
9440  stat("/var/lib/dpkg/info/format-new", 0x7ffe47838f90) = -1 ENOENT (No such file or directory)
9440  open("/var/log/dpkg.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 6
9440  fstat(6, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
9440  mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbf38160000
9440  fstat(6, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
9440  lseek(6, 0, SEEK_SET)             = 0
9440  fcntl(6, F_GETFD)                 = 0
9440  fcntl(6, F_SETFD, FD_CLOEXEC)     = 0
9440  --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xffffffffff600400} ---
9440  +++ killed by SIGSEGV (core dumped) +++

I must admit, I currently don't see which system call caused the
segfault. Full strace log attached.

#1030627#12
Date:
2023-02-05 21:56:08 UTC
From:
To:
Hi,

I think, I found the cause:

Axel Beckert wrote:

I currently suspect it's none of them, but I was testing on a new host
which doesn't have the setting vsyscall=emulate mentioned by myself
(and since then have todally forgotton about) in
https://github.com/xen-tools/xen-tools/blob/master/debian/NEWS

Please don't react on this bug report until I've verified if that's
really the cause.

If it's the cause, I will close this bug report and write down the
hint in a more prominent place. If it's not the cause, I'll remove the
"moreinfo" tag.

And sorry for the potential noise.

		Regards, Axel

#1030627#19
Date:
2023-02-05 22:32:32 UTC
From:
To:
Hi,

Axel Beckert wrote:

Yep, that was it. Sorry for the noise.

Well, not closing but reassigning to xen-tools. And wondering where I
should put that information better.

		Regards, Axel

#1030627#32
Date:
2026-01-10 10:08:33 UTC
From:
To:
Es gibt eine Familienspende in Höhe von 1.850.000,00 USD von Cheng Charlie
Saephan. Bitte antworten Sie für weitere Informationen. Denken Sie daran,
Ihrer Familie und den Bedürftigen in Ihrer Umgebung Gutes zu tun.

Dies ist bereits der zweite Versuch, Sie zu erreichen. Bitte antworten Sie
für weitere Details.

#1030627#37
Date:
2026-01-10 10:08:33 UTC
From:
To:
Es gibt eine Familienspende in Höhe von 1.850.000,00 USD von Cheng Charlie
Saephan. Bitte antworten Sie für weitere Informationen. Denken Sie daran,
Ihrer Familie und den Bedürftigen in Ihrer Umgebung Gutes zu tun.

Dies ist bereits der zweite Versuch, Sie zu erreichen. Bitte antworten Sie
für weitere Details.