Why might Method 2 stack overflow detection fail to detect an overflow in some cases?
hard📝 Conceptual Q10 of 15
FreeRTOS - Memory Management
Why might Method 2 stack overflow detection fail to detect an overflow in some cases?
ABecause Method 2 disables the stack pointer check
BBecause Method 2 only works on single-core processors
CBecause the hook function is called before overflow occurs
DBecause the canary pattern can be overwritten without corrupting the stack pointer
Step-by-Step Solution
Solution:
Step 1: Understand limitations of Method 2
Method 2 relies on a canary pattern at stack end; if overflow overwrites stack but not canary, overflow may go undetected.
Step 2: Analyze options
Because the canary pattern can be overwritten without corrupting the stack pointer correctly states this limitation; others are incorrect or irrelevant.
Final Answer:
Because the canary pattern can be overwritten without corrupting the stack pointer -> Option D
Quick Check:
Method 2 can miss overflow if canary not corrupted [OK]
Quick Trick:Canary may not detect all overflows if not corrupted [OK]
Common Mistakes:
Assuming Method 2 disables pointer checks
Thinking hook is called prematurely
Believing Method 2 is limited to single-core
Master "Memory Management" in FreeRTOS
9 interactive learning modes - each teaches the same concept differently