Open aep opened 4 years ago
Hi @aep, do you see this behavior on every crash, or only when the stack overflow is detected? I made a trivial test application which overflows the stack, but couldn't get the same behavior. Do you think you could trim your app down to something that reproduces the issue?
i'm having difficulties reproducing this as well. the root cause was a function with very large stack values calling itself.
this code wont even trigger stack smashing protection, it just resets due to watchdog
void large_stack()
{
char something[10000];
memset(something, 0xff, 10000);
large_stack();
}
void app_main(void)
{
large_stack();
}
Could you try adding CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y
to your sdkconfig?
I think this issue can not be detected with stack smashing protection, because from the C compiler perspective stack smashing is not happening — the memset stays within the boundaries of the function's stack frame. The issue is that the stack frame overflows the space available on the stack. The above mentioned option is not a guaranteed way to catch such stack overflow (it won't help if you memset only the last 1k of the array), but it still increases the chances of detecting this early.
yeah this is with
any idea how i could intentionally trigger a context switch? the problematic app had 10 tasks, so maybe its not reproducible because its just 1 task
Problem Description
idf.py monitor with gdb stubs doesnt work
//Detailed problem description goes here.