-
Notifications
You must be signed in to change notification settings - Fork 1k
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
*** PANIC *** sys_timeout: timeout != NULL, pool MEMP_SYS_TIMEOUT is empty #1281
Comments
Found #1106 and based on that increased MEMP_NUM_SYS_TIMEOUT and that seems to have helped with the panics (at least not seeing immediate crashing anymore):
Did LwIP perhaps get updated in 1.5.0 release? However, still seeing steady stream of these got unexpected packet -9 errors:
Looks like why I didn't see above errors on 1.4.0 is because of this change: georgerobotics/cyw43-driver#33 (comment) I noticed this change #1039 , are these warnings from CYW43 driver now "safe" on 1.5.0 and no risk these causing deadlock anymore? |
I too get the PANIC on version 1.5.0 - I did not on on 1.4.0
Next,
At this point, err == ERR_OK, so all good.
|
That's the hope. The "got unexpected packet" warnings should be harmless and can be ignored. The issue has been raised with Infineon. |
@manofmanyhats What value of MEMP_NUM_SYS_TIMEOUT are you using? Have you tried increasing it? This sounds like an issue in your code. |
For MEMP_NUM_SYS_TIMEOUT I was using the default (from LwIP), as "lwipopts.h" from pico-examples (that I was using as starting point) didn't change it from default... LwIP default seems to be these:
(https://www.nongnu.org/lwip/2_1_x/group__lwip__opts__memp.html) Seems like something must have changed since there was no need to change these on 1.4.0, but with 1.5.0 seems like it is needed... |
So, Side note in case it helps anyone else; When I first got my mqtt code working with 1.4.0, there was an issue with mqtt keep alive what was affecting me. As a work around for this, I set |
Does anyone have an example that works in pico-sdk 1.4.0 and not 1.5.0? A lot has changed, but not lwip. It's possible timeout behaviour has been changed indirectly with the async changes we've made. Apart from that, there's MDNS support, which requires an extra timeout, but you need to enable that feature.
I would expect you to have your own lwipopts.h file and add it to that? |
OK, so my code was working with 1.4.0. For me, that is the only change that is required. |
I can confirm the same issue w/LWIP timers for the arduino-pico WiFi stack. As I did not wish to edit the Pico-SDK code directly, I've settled on making one of the components of
That said, because I was moving from my own custom CYW43 Ethernet packet<->LWIP hook I assumed I was doing something wrong on my end and worked around it vs. deep debugging. I think if we can get a trace of the timer allocation call stacks (i.e. a gdb in 1.4 vs. 1.5 it would be instructive, something like:
That would show where the extra call to allocate a timer is coming from. Unfortunately, again, my own code path changed a lot so I can't really compare apples to apples only changing the SDK. If you have a simpler app that just swaps the SDK version, then it may be much simpler to see where the difference comes from. |
I enabled following (in "lwipopts.h") to log 'timers' activity:
When comparing differences in debug output between 1.4.0 and 1.5.0 , somewhat surprisingly I didn't see any additional timers being used. I saw following (7) timers being used:
While the default "formula" for LWIP_NUM_SYS_TIMEOUT_INTERNAL seemed to return 6 (in my use case) both on 1.4.0 and 1.5.0, so it seems I've always been running with one too few slots for timers... Callin stats_display() (from LwIP) on 1.4.0 shows this about timers:
So, I suspect for some reason on 1.4.0 running out of timer 'slots' doesn't always trigger a panic, while on 1.5.0 it seems to be causing it always... (on 1.5.0 I don't get far enough to run stats_display()). If I increment the MEMP_NUM_SYS_TIMEOUT (or LWIP_NUM_SYS_TIMEOUT_INTERNAL) by 1 so that things are 'stable' on 1.5.0, I get this:
|
Great - thanks for investigating further. So I guess this was caused by us changing LWIP_PLATFORM_ASSERT from the clearly wrong... #define LWIP_PLATFORM_ASSERT(x) do { if(!(x)) while(1); } while(0) To the correct implementation... #define LWIP_PLATFORM_ASSERT(x) panic(x) I guess we should have emphasised this a bit more...
|
I guess this can be closed. However, maybe https://github.com/raspberrypi/pico-examples/blob/master/pico_w/wifi/lwipopts_examples_common.h |
Why does the default formula not account for MDNS being enabled? |
FWIW, I get the panic when using MDNS unless I add three additional timers to my lwipopts.h #define MEMP_NUM_SYS_TIMEOUT (LWIP_NUM_SYS_TIMEOUT_INTERNAL+3) |
Yes, I see the same. The only MDNS example I have is unfortunately not pushed yet for various reasons https://github.com/peterharperuk/pico-examples/tree/add_httpd |
I may go ahead and PR an MDNS example since I have it working |
For whoever gets here: I got this error because I forgot to |
After upgrading to SDK 1.5.0, I noticed significant regression with the WiFi stack.
Trying to access simple (LwIP) web server causes pretty much immediate panic/crash:
Is this perhaps known issue? This does not happen on SDK 1.4.0...
The text was updated successfully, but these errors were encountered: