-
Notifications
You must be signed in to change notification settings - Fork 94
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
***ERROR*** A stack overflow in task eventTask has been detected. #230
Comments
Hi Alex: searching the code for ubxlib/port/platform/esp-idf/src/u_port_uart.c Lines 514 to 519 in ffa9636
The usual way to check this would be to hack the code above to add a fixed amount, say 2048 bytes, to the stack requested for that task in the function call (i.e. Once you have the problem case, you can decide whether it is something that can be fixed somehow or whether it is just expected operation, in which case the stack size would need to be increased somewhat at the point that the UART event task is created: ubxlib/common/at_client/src/u_at_client.c Lines 2839 to 2843 in ffa9636
This you could do by overriding U_AT_CLIENT_URC_TASK_STACK_SIZE_BYTES at build time. |
uPortUartEventStackMinFree expects a handle. |
Ah, yes, sorry, you can get it with something like the following (this code not compiled by me, just to point you in the right direction):
|
several times at the beginning: and finally several times: |
Getting a bit low but always above 2048, so you haven't reached a stack overflow case yet I think. |
The problem does not always occur. I try to restart the process to possibly catch the overflow. So far I have also seen the following value: How does it even come about that the value is different? |
Timing and different paths through the code will generally cause stack usage to differ between runs. But like I say, I suspect your issue is not so much a grey-scale thing as something that suddenly goes off the rails, a bug of some form. So you've never seen the stack of the UART event queue task go below 2048 bytes minimum free with the 2048 bytes hacked-in? |
One thing you could potentially try is setting CONFIG_COMPILER_STACK_CHECK_MODE to something other than The issue with this is that it will change the run-time behaviour, 'cos of all the checking going on, and that may have other effects, but if you haven't managed to trap the problem yet and you think it should have occurred by now then it may be worth a try. |
Hi @alexmaron81: how did this go in the end? |
Hi Rob, I still couldn't find the error. |
Hi Rob, I get a stack overflow but not always.
What is the best way to proceed?
As a reminder, I use ESP32
The text was updated successfully, but these errors were encountered: