Skip to content

Commit 288a119

Browse files
committed
ray-haproxy: TEMP capture strace/core backtrace on riscv64 haproxy -v crash
Two inference-only fixes (ldd self-exec skip, vendor our own OpenSSL) have not resolved the segfault at the end of build-haproxy-dist.sh on riscv64. Add a temporary, riscv64-only diagnostic that runs the crashing invocation under strace -f, and attempts a gdb backtrace against any core dump produced, to get a real crash signal from the actual CI runner instead of guessing further. This commit is diagnostic-only and is expected to be superseded by the real fix once the backtrace is in hand.
1 parent 13ec914 commit 288a119

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Ludovic Henry <git@ludovic.dev>
3+
Date: Mon, 28 Sep 2026 00:00:00 +0000
4+
Subject: [PATCH] ci/build: TEMP capture strace/core backtrace on riscv64
5+
haproxy -v crash
6+
7+
Two fixes so far (ldd's self-exec quirk, then vendoring our own OpenSSL
8+
instead of Rocky 10's system one) have not resolved the `haproxy -v`
9+
segfault at the end of the build:
10+
11+
Verifying all deps resolve:
12+
All NEEDED entries are allowlisted or vendored
13+
./ci/build/build-haproxy-dist.sh: line 321: 18518 Segmentation fault LD_LIBRARY_PATH="$STAGE_DIR/lib" "$STAGE_DIR/haproxy" -v
14+
15+
Both fixes were made by inference from log text alone, without access to
16+
riscv64 hardware to actually run the binary and inspect the crash. This
17+
adds a TEMPORARY, riscv64-only diagnostic around that exact invocation:
18+
`ulimit -c unlimited`, run it under `strace -f` (printing the tail of the
19+
trace on failure), and if a core file turns up, run `gdb -batch -ex bt`
20+
(plus registers and the faulting instructions) against it. `gdb`/`strace`
21+
are installed on demand since neither is guaranteed present in
22+
manylinux_2_39_riscv64.
23+
24+
This patch exists to get a real crash signal from an actual CI run on the
25+
riscv64 runner; it is not a fix and is meant to be removed (or replaced by
26+
the real fix) once that signal is in hand.
27+
28+
Upstream-Status: Inappropriate [temporary riscv64 CI diagnostic, not meant to be carried or upstreamed]
29+
30+
Signed-off-by: Ludovic Henry <git@ludovic.dev>
31+
---
32+
diff --git a/ci/build/build-haproxy-dist.sh b/ci/build/build-haproxy-dist.sh
33+
--- a/ci/build/build-haproxy-dist.sh
34+
+++ b/ci/build/build-haproxy-dist.sh
35+
@@ -318,7 +318,43 @@ else
36+
echo " Stack canary: NO — consider -fstack-protector-strong"
37+
fi
38+
39+
-LD_LIBRARY_PATH="$STAGE_DIR/lib" "$STAGE_DIR/haproxy" -v
40+
+if [ "$ARCH_LABEL" = "riscv64" ]; then
41+
+ # TEMPORARY diagnostic (not a real fix): capture a backtrace/strace from
42+
+ # this exact invocation on the real riscv64 runner, since this segfaults
43+
+ # with zero output and no prior local riscv64 hardware access has been
44+
+ # available to reproduce it directly.
45+
+ dnf install -y gdb strace 2>/dev/null || true
46+
+ ulimit -c unlimited
47+
+ echo " core_pattern: $(cat /proc/sys/kernel/core_pattern 2>/dev/null || echo unknown)"
48+
+ set +e
49+
+ strace -f -o /tmp/haproxy-v-strace.log \
50+
+ env LD_LIBRARY_PATH="$STAGE_DIR/lib" "$STAGE_DIR/haproxy" -v
51+
+ STATUS=$?
52+
+ set -e
53+
+ echo " haproxy -v exit status: $STATUS"
54+
+ if [ "$STATUS" -ne 0 ]; then
55+
+ echo "==> DIAGNOSTIC: haproxy -v failed (status $STATUS); last strace lines:"
56+
+ tail -n 80 /tmp/haproxy-v-strace.log 2>/dev/null || echo " (no strace log)"
57+
+ echo "==> DIAGNOSTIC: searching for a core dump"
58+
+ CORE=""
59+
+ for d in . /workspace /tmp "$STAGE_DIR"; do
60+
+ for f in "$d"/core "$d"/core.*; do
61+
+ [ -f "$f" ] && CORE="$f" && break 2
62+
+ done
63+
+ done
64+
+ if [ -n "$CORE" ]; then
65+
+ echo " found core: $CORE"
66+
+ gdb -batch -ex 'set pagination off' -ex bt -ex 'info registers' \
67+
+ -ex 'x/20i $pc-40' -ex 'info sharedlibrary' \
68+
+ "$STAGE_DIR/haproxy" "$CORE" 2>&1
69+
+ else
70+
+ echo " no core dump found"
71+
+ fi
72+
+ exit "$STATUS"
73+
+ fi
74+
+else
75+
+ LD_LIBRARY_PATH="$STAGE_DIR/lib" "$STAGE_DIR/haproxy" -v
76+
+fi
77+
78+
# ---------------------------------------------------------------------------
79+
# 6. Package

0 commit comments

Comments
 (0)