-
Notifications
You must be signed in to change notification settings - Fork 177
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
Stack overflow crashes since update to 0.42 #327
Comments
Ok, I think I found the root cause. Although the error message talks about a stack overflow in the main task, it seems to be a stack overflow in one of the threads. I did now increase the thread stacks with the sdkconfig variable CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT. Now it doesn't crash anymore. The error message talking about the main task made me search in the wrong direction. |
since you are using a lot of threads from your description you should think about defining the stack_size when building your threads. You can use https://doc.rust-lang.org/std/thread/struct.Builder.html#method.stack_size to configure your specific thread_size for any given thread you spawn, that is maybe a better approach as to just use a default stack_usage for every thread you are using. With that said keep #233 in mind while using this |
Hi @Vollbrecht, thanks a lot for the suggestion. However, I will check your solution. It looks cleaner. Thanks for the #233 hint. It would certainly have bitten me. |
Hi,
I have a strange problem with stack corruption since I upgraded from 0.41 to 0.42.
I can pinpoint the behavior it to the update step. Reverting back to 0.41 fixes it.
I upgraded esp-idf-hal from 0.41 to 0.42
and esp-idf-svc from 0.46 to 0.47
esp-idf-sys is 0.33 in both cases.
I get the following crash randomly after a couple of seconds or minutes of runtime of an otherwise correctly working application:
My application is built such as that:
I tried to double the configured stack size from 32k to 64k, which did not help. Therefore, I think it's not a simple too-small stack.
I'm currently unable to really pinpoint the problem to any part of my app. The app runs correctly for some time, until it suddenly crashes with the stack overflow.
Do you have any suggestion as to where to look?
How could upgrading esp-idf-hal and esp-idf-svc trigger such a behavior?
Thanks a lot for your help.
The text was updated successfully, but these errors were encountered: