Skip to content

Maybe an Important Bug found in WifiClient #2087

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

Closed
lzw7603 opened this issue Nov 20, 2018 · 3 comments
Closed

Maybe an Important Bug found in WifiClient #2087

lzw7603 opened this issue Nov 20, 2018 · 3 comments
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@lzw7603
Copy link

lzw7603 commented Nov 20, 2018

Hardware:

Board: ESP32 Dev Module
Core Installation/update date: 11/NOV/2018
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 921600
Computer OS: Windows 10

Description:

the code in /libraries/WiFi/src/WiFiClient.cpp line 74
"_fill += res;" run after that the value "_fill" will be -1 sometime.
because the code in /libraries/WiFi/src/WiFiClient.cpp line 70
"if(res < 0 && errno != EWOULDBLOCK) {" the res will be -1 sometime

and it will make the code in /libraries/WiFi/src/WiFiClient.cpp line 106
"*dst = _buffer[_pos];" the value "_pos" will larger than "_size" (default 1436) where is the size of the _buffer.
and then the code will go crash and output an info like "Guru Meditation Error: Core 1 panic'ed (LoadStoreError)...."

now, i fix it by adding some code like
"if(res < 0) return res;"
before
"_fill += res;" in /libraries/WiFi/src/WiFiClient.cpp line 74
an it running stable for a long time.

this happen frequently in downloading a large file(more then 1M) with http get.
my situation is :
HTTPClient http;
http.begin(“http://192.168.1.100:49315/xxx.bin”);
int code = http.GET();
WiFiClient *tcp = http.getStreamPtr();
while(remaining())
{
tcp->readBytes
}

so, is it a right fix?
what is the meaning of the "if(res < 0 && errno != EWOULDBLOCK) {" in /libraries/WiFi/src/WiFiClient.cpp line 70 ?

@Jeroen88
Copy link
Contributor

Jeroen88 commented Jan 2, 2019

@lzw7603 you are right, I found the same problem and created PR #2259 to solve it

@stale
Copy link

stale bot commented Aug 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Aug 1, 2019
@stale
Copy link

stale bot commented Aug 15, 2019

This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

2 participants