-
Notifications
You must be signed in to change notification settings - Fork 543
[N8266-18] espconn_gethostbyname returns ERR_MEM although there is more than enough free memory #198
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
The bug is here: lseqi must not be initialized with 0, but with DNS_TABLE_SIZE. Compare the original code from the newest lwIP: The problem seems to be gone, but I need to monitor this for a few more days. |
Works. |
@kriegste - shouldn't you leave this open until it makes it into the SDK? |
No problem. Don't let me stop you (or Espressif). Looking at the new lwIP there are more bugs that need to be fixed. |
It appears the SDK is compiled with DNS_TABLE_SIZE 0, which makes the issue moot. I base this on the latest SDK liblwip.a not containing a dns_table at all. It'd be nice if the lwipopt.h actually reflected what options the SDK is using. |
The problem did not reoccur. All fine after the fix. DNS_TABLE_SIZE is mentioned only a few times, but it is defined as 4 in the source. |
Is this issue solved? Could we close this issue now? |
No, your code still has the bug. |
- Sync bug fix of dns_enqueue from RTOS SDK - #198 - N8266-18
Thanks. |
- Sync bug fix of dns_enqueue from RTOS SDK - espressif#198 - N8266-18
- Sync bug fix of dns_enqueue from RTOS SDK - espressif#198 - N8266-18
- Sync bug fix of dns_enqueue from RTOS SDK - espressif#198 - N8266-18
How do I debug espconn_gethostbyname? I call it to retrieve the IP of "api.openweathermap.org". Sometimes (for a few hours in a row) it returns ERR_MEM although there should be more than enough memory available. I print the amount of free heap in the log and it is always around 49264 bytes more or less.
Has anyone experienced a similar behavior?
I suspect there is a fixed buffer inside the espconn_gethostbyname function which is too small for some requests. Maybe Espressif can enlighten us.
Edit:
dns is part of lwip, so I enabled debugging there and will report back new findings.
The text was updated successfully, but these errors were encountered: