Skip to content
Browse files

sanitycheck: when present, point at handler.log instead of run.log

When Zephyr crashes immediately QEMU reports an error immediately. This
is immediately reported by "make run". Then sanitycheck points the user
at the output of "make run". However the error message(s) are in QEMU's
output which is in a different .log file.

To address this situation point the error message at handler.log
instead of run.log if and only if handler.log is not empty.

To reproduce here's an artificial but very simple crash:

  sanitycheck --extra-args=CONFIG_TEST_USERSPACE=n \
    -p qemu_x86 -T tests/kernel/mem_protect/stackprot/

Signed-off-by: Marc Herbert <>
  • Loading branch information...
marc-hb authored and nashif committed May 13, 2019
1 parent c0204b9 commit 75276a7d97988c8fcdd45e8ba83d3168b2bd61a7
Showing with 7 additions and 2 deletions.
  1. +7 −2 scripts/sanitycheck
@@ -1064,8 +1064,13 @@ class MakeGoal:
# Failure when calling the sub-make to build the code
return self.build_log
elif self.make_state == "running":
# Failure in sub-make for "make run", qemu probably failed to start
return self.run_log
# Failure in sub-make for "make run", qemu probably failed.
# Return qemu's output if there is one, otherwise make's.
h = Path(self.handler_log)
if h.exists() and h.stat().st_size > 0:
return self.handler_log
return self.run_log
elif self.make_state == "finished":
# Execution handler finished, but timed out or otherwise wasn't successful
return self.handler_log

0 comments on commit 75276a7

Please sign in to comment.
You can’t perform that action at this time.