-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Application crashes : CPU halted #109
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
Comments
I can confirm this, I get the following:
I was thinking it could be the alimentation of the esp32, but it happens with the usb and with direct power to the processor. So it must be something else... |
Backtrace should have all the info — you can throw those 0x4xxxxxx addresses info |
I actually left it unanswered to remind me to enable esp32 in the exception decoder plugin :) |
Hi Igrr,
So it seems the exception thrown in FreeRTOS source. Thoma |
list.c panicked because it was given an invalid pointer (see EXCVADDR). It would be useful to go a few stack frames back to see where the call originated from. It's likely an access to a member of an object which has a null pointer (EXCVADDR = 0x00000021). (and we should probably add a tool to the ESP-IDF to parse these backtraces quickly...) |
Not neceserely :) there should be more addresses that could be decoded to give better trace. I hope to upload the plugin later today. |
Igrr, Here is the whole backtrace information :
Thoma |
@Thoma-HauC the trace above is incomplete because it's missing function names. There are two ways to overcome this:
|
Hi Me-no-dev,
returns
Thoma |
it looks like you are trying to read from possibly closed and freed connection. Could we have a look at some part of the code? Does it crash immediately or does it run a few times before crashing? |
Hi, Here is the code : source-code.txt As said initially, it crashes after a randomly time. This time I got also the below exception :
and
returns
But the other exception thrown too:
and in this case
returns
which is similar to the previous backtrace. Thoma |
Got that crash too. Code was working fine before on ESP8266 and ESP32. After resetting the ESP32 the crash no longer occurs.
Stacktrace:
|
This looks and sounds pretty similar to an issue I'm debugging as well, except mine is coming from a UDP server.
My barebone server can fail in 10-20 minutes if I'm really hammering the data, but slower data rates just make it take longer (though not proportionally)
|
I was trying to sync my ESP32 to an NTP server last night and I was experiencing some crashes too. I began and closed the udp connection before and after each sync, and it crashed while trying to begin a connection after the first or second successful sync. After removing the close command and beginning the connection in setup(), it would crash 4 or 5 seconds after the second sync. Also, some of the text I was outputting to serial to debug would be garbled, as if something was messing up memory. I've just started working with the ESP32 a few days ago, so I don't know too much about it but I'd love to help test things where possible. |
I was thinking about me-no-dev's comment : you are trying to read from possibly closed and freed connection Does this mean that between client.available() and client.readStringUntil(), the connection was closed ?
Thoma |
@Thoma-HauC you can read up to available() even after the client has closed the connection (data might still be in the buffer). in your case you might not read all of the data or line.length() will return 0. Looking again at the traces above and having played with udp for some time (work stuff). It seems that the problem comes from the netconn api somewhere, because for work I used the raw api and have been really pushing the limits and have not had a single crash. The netconn/socket API is the way to go though, so it would be awesome if we can pinpoint the problem and fix it in idf. |
I am getting this, too, using the SparkFun ESP32. I took the example code here https://learn.sparkfun.com/tutorials/esp32-thing-hookup-guide#arduino-example-wifi that hits example.com and changed the loop to hit it every second instead of when the button is pressed. It will crash after a minute or so with Error of type LoadProhibited. |
Could someone else who is also seeing crashes try adding this to your code:
It swaps your code to run on Core0 instead of Core1. It seems to clean up the crashes for me, though I still can't figure out why. |
yeah, but that leads to using only one of the cores for everything, which is not what we want. |
I run in the issue as well using a sparkfun ESP32 Thing. After about five minutes of sending packages over UDP (at about 50Hz) the error looks similar:
|
@me-no-dev, sure I'll agree that it's a lousy hack, but it's better than crashing. I'm just wondering if it helps anyone else's crashes. |
I can confirm that the work-around helps. It made my application stable (without any noticeable negative side effects). Thanks for the response |
I also confirm that the problem has not reappeared the last 12 hours with this change. What conclusions can we draw ? |
My program has been running on both cores for 2 hours. I will start a long time test. |
Nope git latest still crashes for me on my stress test. Interestingly EXCVADDR has changed though.
|
You are right, nothing is solved. The test software crashes after 5 hours. Could you provide your stress test? |
Here's my stress test: https://github.com/tcflanag/jubilant-eureka. It causes a halt in <20 minutes. Often as fast as 5. Don't plan on doing much on your wifi network while it's running though. |
FYI, this issue is tracked in ESP-IDF here: espressif/esp-idf#242 |
Hi, I would like to perform instrumentation of the code of 'esp-idf' but how to rebuild it to use it with 'arduino-esp32' ? Thoma |
@Thoma-HauC what do you mean by "rebuild it to use it with 'arduino-esp32'"? How to run arduino-esp32 with IDF is in the README of this project, but I guess you are actually asking something else? |
@me-no-dev I will try to explain with an example. |
@Thoma-HauC there is no point to see it in Arduino IDE :) if you find problem there, it should go to https://github.com/espressif/esp-idf and not here. Also to run your sketch while building all from source, you can follow the instructions to first install esp-idf and then https://github.com/espressif/arduino-esp32#using-as-esp-idf-component |
Hey guys, test now! |
Great work! It's been running about 30 minutes straight, and done over 1700 HTTP GETs without any problems. Thank you so much. Before it wouldn't make 5 minutes. |
Gracias por la ayuda, yo tuve el mismo problema, me arrojaba el error CPU halted, lo que hice fue cambiar la fuente de alimentación por una de mayor corriente y funciono perfectamente. Espero que les funcione. |
Hello me-no-dev, From my point of view the crash does not longer happen. Thoma |
New to Arduino platform here. So after me-no-dev said "hey guys try it now". What does that mean everyone did to try the fix? And how can I see what me-no-dev changed to verify my library files/code match and are up to date? |
Like burjiscooper, I am new to Arduino, getting this same error (pops right away), but I have no idea how to "try it now"! I'd LOVE to! Can you go slow? Thanks in advance for patience - but I don't even know what questions to ask - just anxious to see some of the magic this little ESP32 can do! |
Restore Arduino build timeout to 60 seconds
Hello,
I updated the repository and compiled my pending buggy WiFi project.
This update seems to solve the WiFi issue and the program runs but after a variable delay it crashes with the following output :
Could someone tell me what the origin of this issue could be?
What can I do to help to debug this issue?
If necessary, I can provide the source code of this small test application.
Thanks in advance.
Thoma
The text was updated successfully, but these errors were encountered: