-
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
SSDP crash after receiving IGMP message from Access Point #1826
Comments
That's super weird, because |
Well it's one of those el cheapo Wifi repeaters sold under many brandnames. Just a reference: I've done a Wireshark scan on IGMP traffic and it seems that this device is the only one sending periodic IGMP V2 Membership Queries. |
umodsi, couldn't that be because of a division by 0 ? |
It is absolutely a division by zero, the actual line it blows up on is a deliberate ill instruction if umodsi is called with zero. @mangelajo. This issue has been around for a while, and is the same as #1505, #1050, and #1262. I don't believe it's down to any particular router, as I've always been able to reproduce it on multiple ones, given the same traffic as above. It seems to happen with just enabling the mDNS library, keeping SSDP / DNS-SD off doesn't affect it. |
Latest git version has a new entry in boards menu: "Core development module", which allows one to use lwIP built from source with debugging symbols enables. Perhaps you could try that one to get a better stack trace and narrow down the issue? |
So, after building the lwIP version from source, the errors have changed quite a bit - It's dying on pbuf_free now, which is curious. Relatively the same time-to-die, between 30 seconds and a minute after enabling mDNS. Not entirely sure why it changed.
|
What does the exception line look like now? |
Ah, that'd probably be helpful, whoops. Exception (28): ctx: sys |
That likely indicates heap corruption (use after free, or double free). Maybe the workaround for tcp_abort I made for xcc-built LWIP breaks something when using gcc-built one. |
@liquidfalcon do you have any TCP connections happening in your sketch, or just mDNS? |
I do, yeah - Every second I attempt to send a couple K's of data over SSL, with mDNS running in the background, and DNS-SD requests every 60 seconds. Disabling the SSL routines makes it run for a longer period of time, but, this time when it crashes, it looks like it gives us the real error message from before:
Now, this would suggest that something is calling igmp_start_timer with a max_time of 0 or 1, which would explain the crash with modulus, as this line is the last call in that function:
Would it be worth adding a simple conditional to that statement to not subtract one if it's equal to one? Or check if max_time is actually valid, first? EDIT: Yes, I think that would work. Adding that makes it keep working well past where it used to crash, when max_time is set to 1. |
Aha, someone beat us to it. Cheers @igrr. Also, would you happen to have the commit hash you mentioned earlier for tcp_abort? If I can figure out the other crash, I'd be a happy camper with working mDNS again. |
Should be fixed in git version now. |
No Connection with Repeater. |
Not sure if this is still an issue. I created an Ethernet frame that reproduces the issues. You can try to send this frame using http://ostinato.org. One frame is enough for a crash. No need to update any MAC/IP of the frame. 0000 01 00 5e 00 00 01 4c 8b 30 c4 b6 18 08 00 45 00 |
@bsz0206 does the crash happen with latest git and lwip2? |
Sorry, I don't have a free ESP8266 to play and test. |
@bsz0206 ok, I'll rephrase the question: your app that crashes with that ethernet frame, which core version was it built with? |
Just recompiled using: - Arduino 1.6.13 - esp8266-2.3.0.zip - Blynk-0.5.0 No source changes other than version increase to 1.0.7 at defines.h The issue is described at esp8266/Arduino#1826
@devyte Sorry for the delay answering. We had to wait for a rebuild and the original developers answered. The buggy firmware was based on 2.2 core. They rebuild using 2.3 and now everything looks good. Thanks. |
Basic Infos
Hardware
Hardware: ESP-12E
Core Version: 2.1.0
Description
Recently added a new access point and now SSDP enabled ESP units started to crash.
Also using the sample SSDP sketch crashed at the same event, receiving a IGMP membership query from this new access point.
Settings in IDE
Module: NodeMCU 1.0
Flash Size: 4MB
CPU Frequency: 80Mhz
Flash Mode: dio
Flash Frequency: 40Mhz
Upload Using: OTA
Reset Method: nodemcu
Sketch
Provided SSDP sample sketch
Debug Messages
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: