Concept Flow - Stack overflow detection (method 1 and 2)
Task starts
Stack allocated
Method 1: Check guard value
Is guard value intact?
No→Stack overflow detected
Method 2: Check stack pointer limits
Is stack pointer within limits?
No→Stack overflow detected
Task runs safely
Repeat checks periodically
The system uses two methods to detect stack overflow: checking a guard value and verifying the stack pointer stays within limits. If either fails, overflow is detected.