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.