Bird
0
0

Consider this incorrect implementation for Method 2:

medium📝 Debug Q7 of 15
FreeRTOS - Memory Management
Consider this incorrect implementation for Method 2:
#define configCHECK_FOR_STACK_OVERFLOW 2
void vApplicationStackOverflowHook(TaskHandle_t xTask, char *pcTaskName) {
    // Missing implementation
}

What is the main issue preventing stack overflow detection?
AThe canary pattern is not defined in the stack
BThe hook function is empty and does not handle overflow
CThe hook function parameters are incorrect
DconfigCHECK_FOR_STACK_OVERFLOW should be set to 1 for Method 2
Step-by-Step Solution
Solution:
  1. Step 1: Understand Method 2 requirements

    Method 2 requires the hook function to handle overflow events properly.
  2. Step 2: Identify problem in code

    The hook function is empty, so overflow detection triggers no action.
  3. Final Answer:

    The hook function is empty and does not handle overflow -> Option B
  4. Quick Check:

    Hook must handle overflow for Method 2 detection [OK]
Quick Trick: Implement hook function to handle overflow events [OK]
Common Mistakes:
  • Setting wrong macro value for Method 2
  • Using wrong hook function parameters
  • Forgetting to place canary pattern in stack

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes