Skip to content

Commit

Permalink
Add more kernel panic regexes
Browse files Browse the repository at this point in the history
We don't currently detect recursive panics since they do not get to the
`KDB: enter: panic` message. Add a few more common panic() strings to
catch such cases (currently happening during Morello testsuite runs).
  • Loading branch information
arichardson committed Aug 4, 2023
1 parent 50cb5a8 commit 40cc410
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pycheribuild/boot_cheribsd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
PANIC = "panic: trap"
PANIC_KDB = "KDB: enter: panic"
PANIC_PAGE_FAULT = "panic: Fatal page fault at 0x"
PANIC_MORELLO_CAP_ABORT = "panic: Capability abort from kernel space"
PANIC_IN_BACKTRACE = "panic() at panic+0x"
CHERI_TRAP_MIPS = re.compile(r"USER_CHERI_EXCEPTION: pid \d+ tid \d+ \(.+\)")
CHERI_TRAP_RISCV = re.compile(r"pid \d+ tid \d+ \(.+\), uid \d+: CHERI fault \(type 0x")
# SHELL_LINE_CONTINUATION = "\r\r\n> "
Expand Down Expand Up @@ -255,11 +257,9 @@ def expect_prompt(self, timeout=-1, timeout_msg="timeout waiting for prompt", ig

def _expect_and_handle_panic_impl(self, options: PatternListType, timeout_msg, *, ignore_timeout=True,
expect_fn, timeout, **kwargs):
assert PANIC not in options
assert STOPPED not in options
assert PANIC_KDB not in options
assert PANIC_PAGE_FAULT not in options
panic_regexes = [PANIC, STOPPED, PANIC_KDB, PANIC_PAGE_FAULT]
panic_regexes = [PANIC, STOPPED, PANIC_KDB, PANIC_PAGE_FAULT, PANIC_MORELLO_CAP_ABORT, PANIC_IN_BACKTRACE]
for i in panic_regexes:
assert i not in options
try:
i = expect_fn(options + panic_regexes, timeout=timeout, **kwargs)
if i > len(options):
Expand Down

0 comments on commit 40cc410

Please sign in to comment.