Re: Bug#1081799: architecture-properties: foreign-cross-exe-wrapper autopkgtest still failing on i386, ppc64el, s390x
Control: tags -1 + patch
The attached patches address this. Also available as a MR at
https://salsa.debian.org/debian/architecture-properties/-/merge_requests/5
It is not clear to me whether these failing tests are going to block
migration: https://release.debian.org/testing/rc_policy.txt says that
only regressions are RC (except on amd64 and arm64 where any failing test
is RC), and these are not regressions, but architecture-properties lists
them as though they might be migration blockers.
On Sun, 15 Sep 2024 at 00:38:26 +0100, Simon McVittie wrote:
> On i386, if the testbed happens to be running an
> amd64-capable kernel, the foreign-cross-exe-wrapper test fails:
>
> > 89s /tmp/autopkgtest-lxc.7txv9lyb/downtmp/build.IPq/src/debian/tests/foreign-cross-exe-wrapper: 37: rc: parameter not set
Fixed in attached patch 0001.
> Meanwhile on ppc64el and s390x, qemu-user fails to run busybox, which is
> certainly a bug but isn't an *architecture-properties* bug:
>
> [on ppc64el]
> > 136s Setting up cross-exe-wrapper:i386 (0.2.1) ...
> ...
> > 137s qemu: uncaught target signal 11 (Segmentation fault) - core dumped
>
> [on s390x]
> > 74s qemu-arm64: /usr/bin/busybox: Invalid note in PT_GNU_PROPERTY
Attached patch 0002 works around this by skipping tests where
qemu-user appears to be non-functional. To test the functionality of
the cross-exe-wrapper script, we only really need one architecture where
it all works.
Attached patch 0003 is not really directly related, just something I
noticed while testing this: if we install Recommends, then we'll get
qemu-user-binfmt, which means we would be able to run foreign executables
even if we didn't intentionally wrap them with qemu.
smcv
>From 6dccca47f946f5b0f64ee86d6f1e94fb3e8e9939 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Sun, 15 Sep 2024 00:10:23 +0100
Subject: [PATCH 1/3] d/tests/foreign-cross-exe-wrapper: Make sure rc is
initialized
If the first test happens to be successful (for example running an
amd64 binary in an i386 environment that happens to be running on an
amd64-capable kernel) then rc will be uninitialized, causing the script
to fail due to the use of `set -u`.
Helps: #1081799
Signed-off-by: Simon McVittie <smcv@debian.org>
---
debian/tests/foreign-cross-exe-wrapper | 1 +
1 file changed, 1 insertion(+)
diff --git a/debian/tests/foreign-cross-exe-wrapper b/debian/tests/foreign-cross-exe-wrapper
index 304e19a..3016867 100755
--- a/debian/tests/foreign-cross-exe-wrapper
+++ b/debian/tests/foreign-cross-exe-wrapper
@@ -33,6 +33,7 @@ for arch in $ARCHITECTURES; do
gnutype=$(dpkg-architecture "-a$arch" -qDEB_HOST_GNU_TYPE 2>/dev/null)
# We expect no output and an exit code of 0 or 1
+ rc=0
output=$("/usr/lib/$multiarch/cross-exe-wrapper/cross-exe-test" 2>&1) || rc=$?
test "$rc" = 2 && die "cross-exe-test exited $rc for $arch with output $output"
--
2.45.2
>From 2a0bff7c415e49f933c8f8dee5be282fae451a4c Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Sun, 15 Sep 2024 00:16:23 +0100
Subject: [PATCH 2/3] d/tests/control: Skip testing foreign-cross-exe-wrapper
if qemu fails
On ppc64el, qemu-i386 currently crashes with a segfault, and on s390x,
qemu-arm64 (and possibly others) fails with:
qemu-arm64: /usr/bin/busybox: Invalid note in PT_GNU_PROPERTY
Neither of these is actually a cross-exe-wrapper bug.
Closes: #1081799 (when combined with previous commit)
Signed-off-by: Simon McVittie <smcv@debian.org>
---
debian/tests/foreign-cross-exe-wrapper | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/debian/tests/foreign-cross-exe-wrapper b/debian/tests/foreign-cross-exe-wrapper
index 3016867..2cc2d00 100755
--- a/debian/tests/foreign-cross-exe-wrapper
+++ b/debian/tests/foreign-cross-exe-wrapper
@@ -37,6 +37,11 @@ for arch in $ARCHITECTURES; do
output=$("/usr/lib/$multiarch/cross-exe-wrapper/cross-exe-test" 2>&1) || rc=$?
test "$rc" = 2 && die "cross-exe-test exited $rc for $arch with output $output"
+ if ! "qemu-$arch" /bin/busybox true; then
+ echo "Skipping foreign test for $arch because qemu-$arch didn't work"
+ continue
+ fi
+
# Expect successful exit
"$gnutype-cross-exe-wrapper" /bin/busybox true
--
2.45.2
>From 4aad108a9a9ffc604a3b29bee9da57df401fea46 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Sun, 15 Sep 2024 00:54:42 +0100
Subject: [PATCH 3/3] d/tests: Install additional packages with
--no-install-recommends
Otherwise we end up installing qemu-user-binfmt, which could make the
tests pass for the wrong reasons.
Signed-off-by: Simon McVittie <smcv@debian.org>
---
debian/tests/foreign-cross-exe-wrapper | 2 +-
debian/tests/sibling-cross-exe-wrapper | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/debian/tests/foreign-cross-exe-wrapper b/debian/tests/foreign-cross-exe-wrapper
index 2cc2d00..6efec53 100755
--- a/debian/tests/foreign-cross-exe-wrapper
+++ b/debian/tests/foreign-cross-exe-wrapper
@@ -24,7 +24,7 @@ for arch in $ARCHITECTURES; do
test "$arch" = "$DEB_HOST_ARCH" && continue
test "$DEB_HOST_ARCH" = amd64 -a "$arch" = i386 && continue
- if ! apt-get -y install cross-exe-wrapper "cross-exe-wrapper:$arch" "busybox:$arch" 2>&1; then
+ if ! apt-get -y install --no-install-recommends cross-exe-wrapper "cross-exe-wrapper:$arch" "busybox:$arch" 2>&1; then
echo "Skipping foreign test for $arch due to an installation problem"
continue
fi
diff --git a/debian/tests/sibling-cross-exe-wrapper b/debian/tests/sibling-cross-exe-wrapper
index ea2888e..307bdf8 100755
--- a/debian/tests/sibling-cross-exe-wrapper
+++ b/debian/tests/sibling-cross-exe-wrapper
@@ -16,7 +16,7 @@ apt-get update
# Avoid emitting to stderr as that fails the test and we do not want to
# paper over it with allow-stderr
-if ! apt-get install -y cross-exe-wrapper cross-exe-wrapper:i386 busybox:i386 2>&1; then
+if ! apt-get install --no-install-recommends -y cross-exe-wrapper cross-exe-wrapper:i386 busybox:i386 2>&1; then
# Skip test if packages are unavailable.
exit 77
fi
--
2.45.2
Reply to: