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
Potential lwip / networking issue? #2654
Comments
can really nobody reproduce this issue? |
I can confirm this behaviour. FTP works fine with this sample, and fetching |
thank you @mikee47, I was wondering if it was something in my setup. |
Not sure what's going on here... NB. ESP-IDF isn't used for ESP8266, it runs on the NON-OS SDK ( |
@slaff Any thoughts? |
oh, my fault then, I thought of idf due to the build system using it's components |
Have to check if this is reproducible in the Host arch... Will try to allocate some time later this week. |
I would tend to think this happens below sming, given my debug results on the link above. |
so, while trying to add some debug to the actual lwip / espconn portion, I accessed the device yesterday with my tablet, that, I think, has never accessed this content before and - on the first attempt - got it. I was very puzzled, but it clearly did work. |
slowly digging a little deeper (and I think this is something I saw already early on) - the issue is, as assumed, with sending larger amounts of data, requiring tcp segmentation.
so, from what I can see, the last unsent frame is reported to be 2199 bytes long whith the mss being 1240 bytes which leads to an overflow in the available space for the frame. I will have to dig further into why this oversize frame is not broken up, but this seems to be close to the issue. tcp_out.c
|
ok, I think I found the bug:
however, later, there's a condition (space > 0) that does not make sense for a uint, also, in my debugging it clearly shows that it wraps around when the bug hits.
fixes the bug as far as I can see. pull request here: lwip-tcpip/lwip#18 |
Did a manual comparison with more recent v2 lwip, found the offiical fix here lwip-tcpip/lwip@8e8571d. This works for me. |
esp-open-lwip is pretty old so there may be other bugs lurking... |
Explanation here https://savannah.nongnu.org/bugs/?func=detailitem&item_id=46384 |
@pljakobs Good find! |
whoa, this has been around since 2016? |
Original fix is here: lwip-tcpip/lwip@8e8571d Issue spotted and documented here: SmingHub/Sming#2654
Original fix is here: lwip-tcpip/lwip@8e8571d Issue spotted and documented here: SmingHub#2654 PR submitted to upstream: pfalcon/esp-open-lwip#10
looking at this fix, it seems that "space" is still declared as unsigned, and while this
makes sure that it is not decremented to <0, in line 488, there's still a comparison if space is greater than zero. I have not fully looked at this, but there still seems to be an edge case issue if space should ever wrap around, although I think it's all guarded by ASSERTS. at least, it would be much better readable (and potentially safe) to explicitly test space for 0 here:
as in
the same is probably true for last_unsent, but that might be a stylistic choice. |
You can use lwip version 2 |
Original fix is here: lwip-tcpip/lwip@8e8571d Issue spotted and documented here: #2654 PR submitted to upstream: pfalcon/esp-open-lwip#10
Original fix is here: lwip-tcpip/lwip@8e8571d Issue spotted and documented here: SmingHub#2654 PR submitted to upstream: pfalcon/esp-open-lwip#10
while trying to port my project to Sming5, I ran into a problem:
when building for the esp8266, accessing the config page on the SoftAP does not work.
How to reproduce:
To verify:
change the code so it immediately connects to your local wlan and access the ip it gets there. watch the correct page load.
What I know so far:
The text was updated successfully, but these errors were encountered: