From 1382a10545e6e4581fa93cdf13321ecac56ca348 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Sat, 5 Dec 2026 13:56:47 +1100 Subject: [PATCH] tests/ui-smoke: find the GUI process under qemu-user Some ubuntu-24.04-arm runners cannot run 32-bit ARM, so the armhf job falls back to QEMU. Under qemu-user binfmt a process's argv[0] is the emulator and the interpreter is argv[1]. find_gui_pid only looked at argv[0], never matched the GUI, and the gmoccapy, qtdragon and touchy quit tests failed with "GUI process not found" while the GUI was up. Look at argv[0] and argv[1]. crashdump_report also printed "crash: no readable core dump" on every run, which made the failure read as a crash. Print it only when linuxcnc.err holds a crash marker, the same ones drive.py looks for. Fixes #4962 --- tests/ui-smoke/_lib/crashdump.sh | 5 +++-- tests/ui-smoke/_lib/quit-launch.sh | 13 ++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/ui-smoke/_lib/crashdump.sh b/tests/ui-smoke/_lib/crashdump.sh index d81895bac4e..a6ec22fd020 100644 --- a/tests/ui-smoke/_lib/crashdump.sh +++ b/tests/ui-smoke/_lib/crashdump.sh @@ -73,10 +73,11 @@ crashdump_report() { -ex "echo \n=== all threads ===\n" \ -ex "thread apply all bt" \ "${py:-python3}" "$core" 2>&1 | head -400 - else + elif grep -qE "Fatal Python error|Segmentation fault|Aborted" linuxcnc.err 2>/dev/null; then # No readable core. The Python faulthandler traceback in # linuxcnc.err already names the crash site; the native backtrace - # is only a best-effort extra. + # is only a best-effort extra. Same markers as drive.py; without + # one there was no crash to report. echo "=== crash: no readable core dump; see the Python traceback in linuxcnc.err above ===" fi rm -rf "$CORE_DIR" diff --git a/tests/ui-smoke/_lib/quit-launch.sh b/tests/ui-smoke/_lib/quit-launch.sh index 6e2770bdf80..2e83b547cd8 100755 --- a/tests/ui-smoke/_lib/quit-launch.sh +++ b/tests/ui-smoke/_lib/quit-launch.sh @@ -82,13 +82,16 @@ xvfb-run -a --server-args="-screen 0 $UI_SMOKE_XVFB_SCREEN" \ # path or the embedded script text. Every such wrapper has a # shell or xvfb-run as argv[0]; the real GUI is a python # interpreter. Pick the first match whose argv[0] basename is a - # python binary. + # python binary. Under qemu-user binfmt (armhf CI on a host + # without AArch32) argv[0] is the emulator and the interpreter + # is argv[1], so look at both. find_gui_pid() { for p in $(pgrep -f "$GUI_MATCH"); do - arg0=$(tr "\0" "\n" <"/proc/$p/cmdline" 2>/dev/null | head -1) - case "$(basename "$arg0" 2>/dev/null)" in - python*) echo "$p"; return 0 ;; - esac + for a in $(tr "\0" "\n" <"/proc/$p/cmdline" 2>/dev/null | head -2); do + case "$(basename "$a" 2>/dev/null)" in + python*) echo "$p"; return 0 ;; + esac + done done return 1 }