Skip to content

Commit

Permalink
tests: mem_protect: fix SMP race
Browse files Browse the repository at this point in the history
We try to invoke `ztest_test_pass()` from inside
a fatal exception in a child thread.

On SMP this can result in the next test case starting
on another CPU, re-using the child thread before it
has a chance to exit.

Signed-off-by: Andrew Boie <[email protected]>
  • Loading branch information
Andrew Boie authored and nashif committed Sep 14, 2020
1 parent 2ba861c commit 5397353
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion tests/kernel/mem_protect/mem_protect/src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *pEsf)
if (valid_fault) {
printk("fatal error expected as part of test case\n");
valid_fault = false; /* reset back to normal */
ztest_test_pass();
} else {
printk("fatal error was unexpected, aborting\n");
k_fatal_halt(reason);
Expand Down

0 comments on commit 5397353

Please sign in to comment.