-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ping too frequently results in Safe Mode #5980
Comments
A debug trace from the IDF would be super helpful. That should show how we get into safe mode. |
The faster rate of pings will cause the remote side to not respond due to ICMP rate-limiting. This will cause a ping timeout, |
Just as a side note to #5745, I ran the pings with 10-minute delays and the boards I've tested would still crash after about 30 pings. As if the pings were eating memory somewhere. |
|
@anecdata Please use https://github.com/adafruit/circuitpython/blob/main/ports/espressif/tools/decode_backtrace.py to decode the backtrace. Run it with the board name |
That's a cool tool. Seems to be a problem with an error return from the lwip component's
|
Is this an opt build? The compiler could have brought the underlying call in common-hal directly into the shared bindings bit. The LoadProhibited error is usually due to an invalid memory address being passed. |
I don't know what an |
|
Ran into this issue recently and saw it on both 7.3.3 and 8.0.0.beta0 on both ESP32-S2 and ESP32-S3. Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Adafruit QT Py ESP32-S3 no psram with ESP32S3 See #6955 for more details (it's a dupe before I knew of this issue) |
esp_ping_new_session can fail, particularly if ping is called quickly many times in succession. This is because `esp_ping_new_session` has to do a bunch of stuff including creating a task and a socket. Calling `esp_ping_delete_session` doesn't clean up these resources immediately. Instead, it signals the task to clean up resources and exit 'soon', but 'soon' is defined as 1 second. When the calls are frequent, the in-use sockets and tasks fill up available slots—I didn't actually check which resource gets used up first. With this change, the ping call will raise an exception instead of continuing with a call to esp_ping_start that crashes. Closes adafruit#5980 based on my testing on an ESP32S3-N8R2.
esp_ping_new_session can fail, particularly if ping is called quickly many times in succession. This is because `esp_ping_new_session` has to do a bunch of stuff including creating a task and a socket. Calling `esp_ping_delete_session` doesn't clean up these resources immediately. Instead, it signals the task to clean up resources and exit 'soon', but 'soon' is defined as 1 second. When the calls are frequent, the in-use sockets and tasks fill up available slots—I didn't actually check which resource gets used up first. With this change, the ping call will raise an exception instead of continuing with a call to esp_ping_start that crashes. Closes adafruit#5980 based on my testing on an ESP32S3-N8R2.
CircuitPython version
Code/REPL
Behavior
code.py output:
LAN ping: 0.009s
LAN ping: 0.237s
LAN ping: 0.004s
LAN ping: 0.002s
[tio 10:38:58] Disconnected
[tio 10:39:00] Connected
Running in safe mode! Not running saved code.
You are in safe mode because:
CircuitPython core code crashed hard. Whoops!
Crash into the HardFault_Handler.
Please file an issue with the contents of your CIRCUITPY drive at
https://github.com/adafruit/circuitpython/issues
Press any key to enter the REPL. Use CTRL-D to reload.
Description
It's a little more resilient if the same IP address isn't
ping
ed repeatedly:Additional information
I think this has been an issue since the beginning of
wifi
iirc. Not a showstopper, just don'tping
too fast.The text was updated successfully, but these errors were encountered: