-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Infinite Loop in MDNSResponder::_parsePacket #2020
Comments
/cc @larsenglund |
Can you enable MDNS_DEBUG_RX and post the serial output here? |
Sorry for the slow response there gents, log output is below (Immediately after this log is the WDT fire and subsequent stack trace):
If it helps, the scenario here is 5 of my devices running, and one of them ran this discovery request to find the others. |
Can you guys test this PR?
|
@liquidfalcon is this issue still valid with latest git? |
The referenced PR was merged. |
I am having frequent restarts when I am using MDNS. Although my code is quiet long, so I am unable to paste entire code (I am using https://github.com/xoseperez/espurna ). But I am sure there is some issue with MDNS in 2.4.2 and also latest git, which is causing frequent WDT Reset. If I turn off mdns, its working fine. This is part of my code -
Its happening for 3-4 times after restarting esp. But after 3-4 times it gets settled. Something is wrong with MDNS I can confirm. Is it not valid to call addService() method before calling .begin() ? Because in my case I am adding Service only once but wifi reconnections are handled in my main loop. So |
yes, the current mdns is broken. A rewrite was done in #5370 and it's integration into our core as an experimental replacement is WIP. |
Ohh... @devyte Really Thank you for confirming. Is there any temporary solution or workaround ? We are sipping our products, and mdns is an essential component ? |
Only to try the new implementation to check if it works for you. The current code is broken in several dimensions simultaneously. |
Basic Infos
Hardware
Hardware: ESP-12E
Core Version: Git
Description
MDNSResponder::_parsePacket hits an infinite loop at the following code:
If I throw a counter in there and log it, it hits ~5500 iterations before the WDT fires. Additionally, putting in a simple if (iterations > 32) break; seems to stave off the crash, but a memory leak occurs each time I use MDNS. This happens the first time and every time I query services using MDNS.
Settings in IDE
Module: ESP-12E - Built with
Core Development Module
and open source LWIPFlash Size: 4M
CPU Frequency: 80MHz
Flash Mode: qio
Flash Frequency: 40Mhz
Upload Using: Serial
Reset Method: N/A
Sketch
Simply calling
MDNS.queryService(F("$MY_SERVICE"), "tcp");
exhibits this behaviour. Additionally, I have approximately 10 other ESP-12 modules and other devices running similar code on this network, all implementing $MY_SERVICE.Debug
Stack trace:
Decoded:
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: