-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault on riscv64
#203
Comments
Options:
|
Good news! It segfaults in system emulation too!! |
Hmm, |
This seems like a more likely candidate: (buildroot/buildroot@5d9c54d) diff --git a/package/gcc/gcc.hash b/package/gcc/gcc.hash
index 5061a603bc..964fbc97df 100644
--- a/package/gcc/gcc.hash
+++ b/package/gcc/gcc.hash
@@ -6,8 +6,8 @@ sha512 440c08ca746da450d9a1b35e8fd2305cb27e7e6987cd9d0f7d375f3b1fc9e4b0bd7acb3c
sha512 a5018bf1f1fa25ddf33f46e720675d261987763db48e7a5fdf4c26d3150a8abcb82fdc413402df1c32f2e6b057d9bae6bdfa026defc4030e10144a8532e60f14 gcc-11.4.0.tar.xz
# From https://gcc.gnu.org/pub/gcc/releases/gcc-12.3.0/sha512.sum
sha512 8fb799dfa2e5de5284edf8f821e3d40c2781e4c570f5adfdb1ca0671fcae3fb7f794ea783e80f01ec7bfbf912ca508e478bd749b2755c2c14e4055648146c204 gcc-12.3.0.tar.xz
-# From https://gcc.gnu.org/pub/gcc/releases/gcc-13.2.0/sha512.sum
-sha512 d99e4826a70db04504467e349e9fbaedaa5870766cda7c5cab50cdebedc4be755ebca5b789e1232a34a20be1a0b60097de9280efe47bdb71c73251e30b0862a2 gcc-13.2.0.tar.xz
+# From https://gcc.gnu.org/pub/gcc/releases/gcc-13.3.0/sha512.sum
+sha512 ed5f2f4c6ed2c796fcf2c93707159e9dbd3ddb1ba063d549804dd68cdabbb6d550985ae1c8465ae9a336cfe29274a6eb0f42e21924360574ebd8e5d5c7c9a801 gcc-13.3.0.tar.xz
# Locally calculated (fetched from Github)
sha512 4dca20f517a42bb027fec605965b09fb917a535eebf3fe3e811d93476b02b1962df5ad4665f117bd44c2ec8e8015d51a44c00591761fe5f259c201ac5c7d920f gcc-arc-2023.09-release.tar.gz |
Oh, that was a dead end -- the default is gcc-12, not gcc-13, so we get 12.3.0 with or without that patch. 🤦 |
In the pursuit of further narrowing things down, the upgrade from kernel headers 6.6.22 to 6.6.32 is also not the culprit. |
buildroot/buildroot@a270097 is another dead-end (it was a long shot, but I'm running out of promising things in |
Well, the reason I felt like buildroot was gaslighting me was because I was gaslighting myself. I can reproduce the segfault on 2024.02.2 as well. 😭 |
Confirmed, the current published Edit: * on native riscv64 hardware |
Also segfaulting (thanks to
|
In better news, |
I should also clarify that this isn't just |
I finally got edit: just so I have it recorded somewhere, https://buildroot.uclibc.narkive.com/7mJA2hV6/target-full-gdb-fails-to-build-statically was really relevant to my getting Extra Interesting Tidbits:diff --git a/latest/uclibc/Dockerfile.builder b/latest/uclibc/Dockerfile.builder
index 067e156..679ac6a 100644
--- a/latest/uclibc/Dockerfile.builder
+++ b/latest/uclibc/Dockerfile.builder
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM debian:bookworm-slim
+FROM debian:unstable-slim
RUN set -eux; \
apt-get update; \
@@ -63,14 +60,28 @@ RUN set -eux; \
cd /usr/src/buildroot; \
\
setConfs=' \
- BR2_STATIC_LIBS=y \
+ BR2_PACKAGE_HOST_ENVIRONMENT_SETUP=y \
+# BR2_STATIC_LIBS=y \
BR2_TOOLCHAIN_BUILDROOT_UCLIBC=y \
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y \
+ \
+# this is necessary for "gdb" (https://buildroot.uclibc.narkive.com/7mJA2hV6/target-full-gdb-fails-to-build-statically), but makes "getconf" dynamic and there is no configuration option that makes it static again (that behavior is hard-coded in the uclibc makefiles)
+ BR2_SHARED_STATIC_LIBS=y \
+ BR2_ENABLE_DEBUG=y \
+ BR2_PTHREAD_DEBUG=y \
+# BR2_GCC_VERSION_14_X=y \
+ BR2_TOOLCHAIN_BUILDROOT_CXX=y \
+ BR2_PACKAGE_GDB=y \
+ BR2_PACKAGE_GDB_DEBUGGER=y \
+ BR2_PACKAGE_GDB_SERVER=y \
+ BR2_PACKAGE_HOST_GDB=y \
'; \
\
unsetConfs=' \
BR2_SHARED_LIBS \
BR2_TOOLCHAIN_BUILDROOT_GLIBC \
+ \
+ BR2_STRIP_strip \
'; \
\
# buildroot arches: https://git.busybox.net/buildroot/tree/arch
@@ -189,19 +200,27 @@ RUN set -eux; \
done; \
for confV in $setConfs; do \
grep -q "^$confV\$" .config; \
- done;
+ done
+
+COPY uclibc-static-utils.patch /usr/src/buildroot/package/uclibc/9999-doi-static-utils.patch
+
+RUN set -eux; \
+# this pre-downloads everything necessary for compilation
+ make -C /usr/src/buildroot source
# https://www.finnie.org/2014/02/13/compiling-busybox-with-uclibc/
RUN set -eux; \
# force a particular GNU arch for "host-gmp" (otherwise it fails on some arches)
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
make -C /usr/src/buildroot \
- HOST_GMP_CONF_OPTS="--build='"$gnuArch"'" \
+ HOST_GMP_CONF_OPTS="--build='$gnuArch'" \
# building host-tar:
# configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
FORCE_UNSAFE_CONFIGURE=1 \
-j "$(nproc)" \
toolchain
+RUN make -C /usr/src/buildroot -j "$(nproc)" host-gdb
+RUN make -C /usr/src/buildroot -j "$(nproc)" gdb
ENV PATH /usr/src/buildroot/output/host/usr/bin:$PATH
# pub 1024D/ACC9965B 2006-12-12
@@ -235,6 +254,15 @@ RUN set -eux; \
WORKDIR /usr/src/busybox
+# https://github.com/docker-library/busybox/issues/198
+# https://bugs.busybox.net/show_bug.cgi?id=15931
+# https://bugs.debian.org/1071648
+RUN set -eux; \
+ curl -fL -o busybox-no-cbq.patch 'https://bugs.busybox.net/attachment.cgi?id=9751'; \
+ echo '6671a12c48dbcefb653fc8403d1f103a1e2eba4a49b1ee9a9c27da8aa2db80d4 *busybox-no-cbq.patch' | sha256sum -c -; \
+ patch -p1 --input=busybox-no-cbq.patch; \
+ rm busybox-no-cbq.patch
+
RUN set -eux; \
\
# build date/time gets embedded in the BusyBox binary -- SOURCE_DATE_EPOCH should override that
@@ -288,10 +316,10 @@ RUN set -eux; \
nproc="$(nproc)"; \
CROSS_COMPILE="$(basename /usr/src/buildroot/output/host/usr/*-buildroot-linux-uclibc*)"; \
export CROSS_COMPILE="$CROSS_COMPILE-"; \
- make -j "$nproc" busybox; \
- ./busybox --help; \
+ make -j "$nproc" busybox_unstripped; \
+ ./busybox_unstripped --help; \
mkdir -p rootfs/bin; \
- ln -vL busybox rootfs/bin/; \
+ ln -vLT busybox_unstripped rootfs/bin/busybox; \
\
# copy "getconf" from buildroot
ln -vL ../buildroot/output/target/usr/bin/getconf rootfs/bin/; \ $ cat latest/uclibc/uclibc-static-utils.patch
Description: make uclibc utils (esp. "getconf") static no matter how we compile
diff --git a/utils/Makefile.in b/utils/Makefile.in
index 1544c8fcc..104eba2db 100644
--- a/utils/Makefile.in
+++ b/utils/Makefile.in
@@ -25,9 +25,7 @@ else
CFLAGS-utils-shared :=
endif
-ifneq ($(HAVE_SHARED),y)
CFLAGS-utils += -static
-endif
CFLAGS-ldconfig := -DBUILDING_LINKAGE
ifeq ($(UCLIBC_STATIC_LDCONFIG),y) |
This is the one, for now. |
As discovered in #202,
busybox
segfaults when running on realriscv64
hardware but works fine on QEMU 😭. Just opening this as a tracking issue.Originally posted by @tianon in #202 (comment)
The text was updated successfully, but these errors were encountered: