Skip to content
Commit 35f9a5d7 authored by Jimmy Brisson's avatar Jimmy Brisson Committed by Maureen Helm
Browse files

cortex-m: Abort pending SVC when a thread is killed



If an SVC was pending during the stack overflow, it will run
after the return of the memory manage fault. To the SVC's misfortune of
the SVC handler, the it's invariant, that PSP point to the
hardware-stacked context is no longer valid. When the user has a
k_sys_fatal_error_handler that tries to kill the thread that caused a
stack overflow, this manifests as the svc reading the memory of whatever
is on the stack after being adjusted by the mem manage fault handler, and
that leads to unending, spurious hard faults, locking up the system.

This patch prevents that.

Signed-off-by: default avatarJimmy Brisson <jimmy.brisson@linaro.org>
parent 4bb30395
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment