-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
CONT stack overflow postmortem #9083
Conversation
- check in cont_run() and cont_suspend() whether a1 is out of bounds - in case a1 is broken, postmortem will still report proper context in proper stack boundaries additionally - as suggested in esp8266#9069, change stack smashing to a single line that does not mention any Exceptions - reduce overall stack dump length when there are know garbage values i.e. cont stackguard - decoder.py addr search regexp would no longer skip stack lines with '<' - fix decoder.py parsing so it notices both stack smashing and alloc errors
ets_printf_P(PSTR("\nctx: cont\n")); | ||
stack_end = cont_stack_end; |
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.
two conditions for the same code, is it intended ?
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.
It is not, leftover from old impl... Changed to 'cond1 || cond2'
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.
Looks good to me, can save hours of debugging
- check in cont_run() and cont_suspend() whether a1 is out of bounds - in case a1 is broken, postmortem will still report proper context in proper stack boundaries additionally - as suggested in esp8266#9069, change stack smashing to a single line that does not mention any Exceptions - reduce overall stack dump length when there are know garbage values i.e. cont stackguard - decoder.py addr search regexp would no longer skip stack lines with '<' - fix decoder.py parsing so it notices both stack smashing and alloc errors
proper stack boundaries. previously it used sys ctx values
additionally
does not mention any Exceptions
Noticed in esp-idf cfg as
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL=y
, where Freertos it is a so called 'Method 1' of overflow checking happening right before ctx switchhttps://www.freertos.org/Stacks-and-stack-overflow-checking.html
(also ref. #8666)
simple example like this one usually already offsets a1 when yield() happens, so the newly added check would cause a reset
and it should generate more useful info as the result