Summary
When vmtest exits non-zero (VM crash, kernel panic, timeout), the ERR trap in
run.sh fires immediately, skipping all post-processing: exitstatus collection,
kernel splat checks, JSON summaries, and the final results table. Developers see
only "Process completed with exit code 2" with zero diagnostic information.
Failure Details
- Test / Component:
ci/run-vmtest/run.sh (CI infrastructure)
- Frequency: Observed in 5+ independent CI runs across multiple unrelated PRs
- Failure mode: VM crash / timeout causing silent exit code 2
- Affected architectures: x86_64, s390x (observed); potentially all
- CI runs observed:
Root Cause Analysis
run.sh line 4 sets trap 'exit 2' ERR, which causes immediate script
termination on any unhandled command failure. At line 115, vmtest is called
without the && true guard that is already used elsewhere in the same file
(line 72 for bpftool checks) and in run-bpf-selftests.sh (line 54 for
individual test execution).
When vmtest returns non-zero (because the VM crashed, the kernel panicked, or
the guest timed out), the ERR trap fires at line 115 and the script exits with
code 2 immediately. Lines 120-166 — which handle kernel splat reporting,
exitstatus file parsing, JSON summary generation, and the human-readable results
table — are never reached.
This means:
- The
exitstatus file is never read, so per-test pass/fail is lost
kernel_splats.log is never checked, so splat annotations are never emitted
test_*.json summaries are never printed to GITHUB_STEP_SUMMARY
- The final "Test Results" table is never printed
- The exit code is always 2 (ERR trap), not the actual test exit status
The && true pattern is the established idiom in this codebase for preventing
the ERR trap from firing while preserving the exit code in $?. The bpftool
check block (lines 68-79) demonstrates the exact same pattern with an
explanatory comment.
Proposed Fix
Add the && true guard to the vmtest invocation and capture its exit code.
If vmtest failed, emit a GitHub Actions warning annotation and write the failure
to the exitstatus file so the existing awk-based status collection correctly
reports the failure.
See: output/0001-ci-run-vmtest-preserve-test-results-on-VM-crash.patch
The fix is 6 lines of added code and follows existing patterns in the file
exactly. No behavioral change occurs when vmtest succeeds (exit code 0).
Impact
Without this fix, any VM crash, kernel panic, or guest timeout produces a
completely opaque "exit code 2" failure. Developers must manually re-run the
job or dig through raw logs to find what happened. With the fix, the existing
post-processing pipeline runs normally: per-test results are reported, kernel
splats are checked, and the JSON summary is written — even when the VM itself
had problems.
References
ci/run-vmtest/run.sh:4 — ERR trap definition
ci/run-vmtest/run.sh:72 — existing && true pattern (bpftool checks)
ci/run-vmtest/run-bpf-selftests.sh:54 — existing && true pattern (test execution)
ci/run-vmtest/run.sh:115 — bare vmtest call (the bug)
Summary
When
vmtestexits non-zero (VM crash, kernel panic, timeout), the ERR trap inrun.shfires immediately, skipping all post-processing: exitstatus collection,kernel splat checks, JSON summaries, and the final results table. Developers see
only "Process completed with exit code 2" with zero diagnostic information.
Failure Details
ci/run-vmtest/run.sh(CI infrastructure)Root Cause Analysis
run.shline 4 setstrap 'exit 2' ERR, which causes immediate scripttermination on any unhandled command failure. At line 115,
vmtestis calledwithout the
&& trueguard that is already used elsewhere in the same file(line 72 for bpftool checks) and in
run-bpf-selftests.sh(line 54 forindividual test execution).
When
vmtestreturns non-zero (because the VM crashed, the kernel panicked, orthe guest timed out), the ERR trap fires at line 115 and the script exits with
code 2 immediately. Lines 120-166 — which handle kernel splat reporting,
exitstatus file parsing, JSON summary generation, and the human-readable results
table — are never reached.
This means:
exitstatusfile is never read, so per-test pass/fail is lostkernel_splats.logis never checked, so splat annotations are never emittedtest_*.jsonsummaries are never printed toGITHUB_STEP_SUMMARYThe
&& truepattern is the established idiom in this codebase for preventingthe ERR trap from firing while preserving the exit code in
$?. The bpftoolcheck block (lines 68-79) demonstrates the exact same pattern with an
explanatory comment.
Proposed Fix
Add the
&& trueguard to thevmtestinvocation and capture its exit code.If vmtest failed, emit a GitHub Actions warning annotation and write the failure
to the
exitstatusfile so the existing awk-based status collection correctlyreports the failure.
See:
output/0001-ci-run-vmtest-preserve-test-results-on-VM-crash.patchThe fix is 6 lines of added code and follows existing patterns in the file
exactly. No behavioral change occurs when vmtest succeeds (exit code 0).
Impact
Without this fix, any VM crash, kernel panic, or guest timeout produces a
completely opaque "exit code 2" failure. Developers must manually re-run the
job or dig through raw logs to find what happened. With the fix, the existing
post-processing pipeline runs normally: per-test results are reported, kernel
splats are checked, and the JSON summary is written — even when the VM itself
had problems.
References
ci/run-vmtest/run.sh:4— ERR trap definitionci/run-vmtest/run.sh:72— existing&& truepattern (bpftool checks)ci/run-vmtest/run-bpf-selftests.sh:54— existing&& truepattern (test execution)ci/run-vmtest/run.sh:115— barevmtestcall (the bug)