From 9e21009da31eefc8b624d5ee17a988f9babe0be6 Mon Sep 17 00:00:00 2001 From: ASDAlexander77 Date: Thu, 26 Nov 2026 18:26:19 +0000 Subject: [PATCH] tests.sh: a run with no ALL DONE prints its exit code, and a crash is run again under gdb array_class_splice.ts -mm=rc debug/jit ended with no output at all on ubuntu-22.04/24.04 in the release run of 2026-11-26 (twice), and passed on a rerun; ~700 runs of the same package (WSL 26.04, an ubuntu:22.04 container, other CPU targets, 2 CPUs, the full tests.sh sequence) never reproduced it. A crash inside the program prints LLVM's stack dump on stderr, so an empty output is a kill (OOM, SIGKILL) or a crash after the handlers are gone, with stdout's pipe buffer never flushed. The exit code now tells which, and a signal reruns the test once under gdb (when there is one) for every thread's backtrace. The test stays failed either way. Co-Authored-By: Claude Opus 5.5 --- tests.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests.sh b/tests.sh index cefcae8..e51b762 100755 --- a/tests.sh +++ b/tests.sh @@ -104,6 +104,22 @@ function test_script() { if [[ "$run_output" != *"ALL DONE"* ]]; then echo -e "\e[31mRun Error (no 'ALL DONE' marker)\e[0m" echo "Output: $run_output" + # The exit code tells a crash (128 + the signal: 139 a segfault, 134 an abort) from a run that ended on its + # own. A crash as the process exits leaves no output at all: stdout to a pipe is flushed only at exit. + # (array_class_splice.ts -mm=rc debug/jit, release run of 2026-11-26: twice on ubuntu-22.04/24.04, never + # reproduced in ~700 runs of the same package.) Run it once more under gdb for a backtrace; the test + # stays failed either way. + echo "Exit code: $run_code" + if [ $run_code -gt 128 ] && command -v gdb > /dev/null; then + if [ "$mode" == "jit" ]; then + rerun=( "$TOOL_PATH/$TOOL" $DBG $OPTIONS --shared-libs="$RUNTIME" --emit=jit "$SRC/tests/$test.ts" ) + else + rerun=( "$SRC/tests/$test" ) + fi + echo "Again under gdb:" + timeout 300 gdb -q -batch -ex "set pagination off" -ex run -ex "thread apply all bt 30" \ + --args "${rerun[@]}" < "$stdin_file" 2>&1 | tail -n 120 + fi return 1 fi