Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

rojer
Copy link
Contributor

@rojer rojer commented May 16, 2017

This may be enough to troubleshoot (increase stack size).

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));
Copy link
Member

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)) 

Copy link
Contributor Author

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?

Copy link
Contributor Author

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

Copy link
Member

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.

@projectgus
Copy link
Contributor

Thanks @rojer. I've cherry-picked this into our internal review & merge queue.

@projectgus projectgus added the Status: Pending blocked by some other factor label May 17, 2017
igrr pushed a commit that referenced this pull request May 19, 2017
This may be enough to troubleshoot (increase stack size).

Merges #607
@igrr
Copy link
Member

igrr commented Jun 21, 2017

Cherry-picked as 3ac3a78, thanks for the PR!

@igrr igrr closed this Jun 21, 2017
@igrr igrr removed the Status: Pending blocked by some other factor label Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants