-
Notifications
You must be signed in to change notification settings - Fork 13.3k
git: Webserver leaks on LmacRxBlk and crashes (exception 9 & 24) #1458
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
you never read the data coming from server. latest git has this: and may more imported rc1 runs on SDK 1.5.0 which is very buggy. |
I'm already on latest git, including fb55e91. I can furthermore confirm crashes even without |
I've done some further testing. Crashes are happening once there is some load on the system. Test scenario: 2 sequences calling the json api in parallel, heap is being monitored to serial. This is running fine for ages. Then: use browser (Windows = delayed ACK) to load index.html. Log starts to see
|
The problem apparently is with
Once To put load on the system use this html file. in my case running on Windows PC- might be related to the delayed ACK issue?
Update I've tried reproducing the memory leak on 2.0.0 stable and wasn't able to do so. It seems that something in current git since 2.0 might be causing the crash behavior. |
This is the shortest log I could find to repro the crash with the sketch/ calling code above:
|
And here is a log of core+wifi up to the exception: http://pastebin.com/rRBzsRJr |
LmacRxBlk is a overflow of the input buffer, you can test the Async webserver: |
Thanks @Links2004 I'll check the async server. However- even if the input buffer overflows- should the WS handle this gracefully? The mem leak/ corruption shouldn't be happening in any case? |
The overflow happens at MAC level, so this is even below the TCP/IP stack. On Mon, Jan 18, 2016, 21:17 andig [email protected] wrote:
|
Pheew- thats bad news indeed. |
I have some troubles converting my handlers to the async server (sorry- C is not my primary language). The handlers have the signature of
yet
gives compile error:
As workaround I'm simply wrapping it, but would like to know if I can do without the wrapper:
Sorry if this is more a C than an ESP question ;) |
Do you have another function in the sketch with the same name? Compiler thinks that this is an overloaded function. |
I think I had a similar problem, so I used
|
No- it's the only Async server is reproducible panicing for me as soon as I start using SPIFFS when reading a (larger) file though:
This is the code:
|
Could you please move further AsyncWebServer discussion to https://github.com/me-no-dev/ESPAsyncWebServer/issues? The reason it is panicking is that it calls File system APIs which expect to be used on the main thread. |
and you can request->send("/index.html"); and let the server deal with the file and all. |
@igrr doesn't that __yield panic mean that something using yield was called from non-switching context? |
Yes, every flash operation within SPIFFS HAL calls Edit: try removing this line: |
The example I provided uses SPIFFS and is a copy of the FSBrowser example we have for the regular WebServer. So I'm am positive that SPIFFS used as intended is working great (I have tested with files up to 2MB upload/download). There is also the static handler thing that I have ported over. Maybe since I do async reads of small portions, they do not trigger the optimistic_yield(), thus I have never seen that error before |
@me-no-dev sending file via SPIFFS handler is wfm. I need to use I'll move to @igrr as the root cause was crashes/leaks from MAC layer on overload- should this issue be closed? |
Not really, i hope that one day we will find a solution or at least a workaround for these issues. |
@igrr how do you feel about replacing yield here and there with optimisic_yield or better have yield be optimistic. |
tl:dr I've migrated to the async webserver. After fixing some issues with code using |
@andig maybe close this now :) |
After adding
HTTPClient
to my sketch I've started to see various restarts.Update not related to
HTTPClient
. Also getting those crashes with webserver.Crash logs:
http://pastebin.com/31v49QZC
http://pastebin.com/PnjZaGzC
http://pastebin.com/QwhjzZPL
http://pastebin.com/vdZBxTGs
The first might be most interesting as it shows something else, too. Free heap before adding httpclient was 31k, after adding it went down to 25k.
All new variables are local to a single function (except for global httpclient). This is the (new) code that causes the problem:
The text was updated successfully, but these errors were encountered: