Skip to content

qemu: restart the guest if its kernel panics during boot - #150

Merged
castler merged 3 commits into
eclipse-score:mainfrom
castler:qemu-guest-panic-retry
Nov 2, 2026
Merged

castler merged 3 commits into
eclipse-score:mainfrom
castler:qemu-guest-panic-retry

Conversation

@castler

@castler castler commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

The QNX 8 guest kernel intermittently panics during SMP bring-up (about 1 in 2000-4500 boots on nested-virtualization CI runners): the serial console prints Shutdown[1] S/C/F=5/4/3 ... muon and the guest halts. Details: eclipse-score/communication#1513.

Today the pre-test checks then hang on an SSH banner that never arrives (banner_timeout=200), and the ping check passes regardless because it pings host loopback. The result is a flaky test failure.

This PR:

  • lets Console/PipeConsole take expression callbacks before the reader thread starts (no missed lines),
  • detects the panic marker (Shutdown[) on the QEMU console and terminates QEMU, so pending SSH connections fail immediately,
  • reboots the guest up to --qemu-boot-attempts times (default 3) if the pre-test checks fail after a panic. Other failures are not retried.

Tests: new unit tests (test_qemu_boot_retry). Also verified against a real QNX guest by temporarily using a marker that every boot prints: detect, terminate, restart x3, raise; and a normal QNX integration test in communication passes with this change.

The kernel bug itself is not fixed here; this only makes the test infrastructure recover from it.

@castler

castler commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Measured on GitHub-hosted runners (Azure, KVM nested), through the real ITF code (QemuProcess, QemuTarget, pre-test checks, this retry), unmodified QNX IFS, 4 parallel guests: 24,000 boots, 11 guest kernel panics (about 1 in 2,200), all 11 recovered by one restart, 0 failed boots. Without the retry, each of those 11 would have been a failed test. Run: https://github.com/castler/communication/actions/runs/41080480815

LittleHuba
LittleHuba previously approved these changes Oct 30, 2026
@castler
castler added this pull request to the merge queue Oct 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 30, 2026
@castler
castler added this pull request to the merge queue Oct 31, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 31, 2026
@castler
castler added this pull request to the merge queue Oct 31, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 31, 2026
@castler
castler enabled auto-merge October 31, 2026 20:12
@castler
castler force-pushed the qemu-guest-panic-retry branch from 0cf282d to adfbc31 Compare November 2, 2026 08:43
castler and others added 3 commits November 2, 2026 10:42
The QNX kernel can panic during SMP bring-up (Shutdown[...] on the serial
console) and never recovers. The pre-test checks then hang on an SSH banner
that never arrives, and the ping check passes regardless.

Detect the panic marker on the QEMU console, terminate QEMU so pending SSH
connections fail fast, and boot again up to --qemu-boot-attempts (default 3)
times. Other failures are not retried.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…hing the module

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@castler
castler added this pull request to the merge queue Nov 2, 2026
Merged via the queue into eclipse-score:main with commit 3e99bed Nov 2, 2026
10 checks passed
@castler
castler deleted the qemu-guest-panic-retry branch November 2, 2026 12:10
@github-project-automation github-project-automation Bot moved this from Backlog to Done in TST - Testing Community Nov 2, 2026
etas-contrib-automation Bot pushed a commit to etas-contrib/score_communication that referenced this pull request Nov 3, 2026
Bumps `score_itf` 0.6.0 -> 0.7.0.

- eclipse-score/itf#150: restart the QNX guest when its kernel panics
during boot (eclipse-score#1513, eclipse-score/qnx_sdp#9)
- eclipse-score/itf#151: do not lose early docker exec output
- eclipse-score/itf#144: SSH auth support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants