Skip to content

Commit 169cf98

Browse files
garth-wellsclaude
andcommitted
Spack CI: name the caller of the null jump with valgrind
The faulting frame jumps to address zero, which leaves no return address behind: 'bt' shows two '?? ()' frames and 'x/512a $sp' comes back all zeros, so nothing in the process can say who called it. Valgrind tracks the call chain independently of the stack, and reports a jump to an invalid address along with the frames that reached it, which is the one question the earlier diagnostics could not answer. Also run 'ldd -r' against libbasix itself, not only the nanobind extension. libbasix is what declares and calls dgemm_/dgesv_/dgetrf_, so it is the library whose BLAS linkage and symbol resolution matter; the extension only wraps it, and its earlier clean output said nothing about the BLAS. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 64c688d commit 169cf98

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ jobs:
243243
continue-on-error: true
244244
shell: spack-bash {0}
245245
run: |
246-
apt-get install -y gdb libblas3 liblapack3
246+
apt-get install -y gdb valgrind libblas3 liblapack3
247247
spack env activate ci
248248
spack load gcc
249249
echo "== CPU =="
@@ -258,6 +258,11 @@ jobs:
258258
echo "== unresolved symbols in the basix extension =="
259259
ldd -r $(python -c "import basix._basixcpp as m; print(m.__file__)") 2>&1 \
260260
| grep -iE "undefined|not found" | head -20 || echo "none"
261+
# libbasix is what calls the BLAS; the extension above only wraps it.
262+
echo "== libbasix: BLAS linkage and unresolved symbols =="
263+
LIBBASIX=$(spack location -i fenics-basix)/lib/libbasix.so
264+
ldd "$LIBBASIX" | grep -iE "blas|lapack" || echo "no BLAS in DT_NEEDED"
265+
ldd -r "$LIBBASIX" 2>&1 | grep -iE "undefined|not found" | head -20 || echo "none"
261266
cat > /tmp/repro.py <<'EOF'
262267
import basix.ufl
263268
basix.ufl.element("Nedelec 1st kind H(curl)", "hexahedron", 4)
@@ -295,6 +300,14 @@ jobs:
295300
EOF
296301
echo "== repro under gdb, tracing BLAS call sites =="
297302
gdb -q -batch -x /tmp/gdb.cmds --args python /tmp/repro.py 2>&1 | tail -120 || true
303+
# A jump to address zero leaves no return address on the stack, so
304+
# no unwinder can name the caller -- 'x/512a $sp' came back all
305+
# zeros. Valgrind tracks the call chain itself, so it reports the
306+
# jump ('Jump to the invalid address ... at 0x0: ??? by 0x...')
307+
# together with the frames that led there.
308+
echo "== repro under valgrind =="
309+
valgrind --error-limit=no --num-callers=30 --trace-children=yes \
310+
python /tmp/repro.py 2>&1 | tail -60 || true
298311
# Fallback, in case the one-liner above does not reproduce.
299312
echo "== affected tests serially under gdb =="
300313
gdb -q -batch -ex "set auto-load safe-path /" -ex "set disable-randomization off" \

0 commit comments

Comments
 (0)