-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print the name of the task that hit the stack watchpoint #607
Conversation
This may be enough to troubleshoot (increase stack size).
@@ -212,7 +212,10 @@ void panicHandler(XtExcFrame *frame) | |||
//debugcause if the cause is watchdog 1 and clearing it if it's watchdog 0. | |||
if (debugRsn&(1<<8)) { | |||
#if CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK | |||
panicPutStr("Stack canary watchpoint triggered "); | |||
const char *name = pcTaskGetTaskName(xTaskGetCurrentTaskHandleForCPU(core_id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pointer will likely be in cached region of memory. Would it make sense to sanity-check it before trying to print it? I.e. something like
if (spi_flash_cache_enabled() || !((uint32_t) name >= SOC_DROM_LOW && (uint32_t) name < SOC_DROM_HIGH))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but task name is a member of the current TCB, so, is it actually possible for it to be not in RAM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
task name provided by the user is copied into this field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, yes, you're right.
Thanks @rojer. I've cherry-picked this into our internal review & merge queue. |
This may be enough to troubleshoot (increase stack size). Merges #607
Cherry-picked as 3ac3a78, thanks for the PR! |
This may be enough to troubleshoot (increase stack size).