Open Flole998 opened 3 years ago
@xcguang Any chance to get this fixed? This breaks WPA Enterprise completely in newer SDK Versions. Please have a look at what's going on there and why invalid memory is freed.
I am experiencing the same issue, WPA2 enterprise connections fail most of the time (roughly 1 out of 10 tries succeeds in connecting).
Is this really an SDK issue, or actually a bug in Arduino...
@eriksl The SDK is attempting to call free on an invalid memory address. That is not a bug in Arduino.
@xcguang Could you please have a look at this? This breaks WPA Enterprise completely in recent versions, this should really be addressed and it's probably an easy fix.
@Flole998 how are you sure?
@eriksl Because it's the SDK that's calling free() on an invalid address. See how the stacktrace goes basically only through SDK functions and nothing Arduino related? There's simply an attempt to free invalid memory in wpabuf_free() which someone should finally fix, then everything would be fine (as someone else who had this issue simply removed the abort() when freeing invalid memory, but seriously, is that how a good and clean SDK looks like?).
@ustccw Could you please have a look into this? It's probably a super easy fix for you to figure out why free() is called on an invalid memory address here by the SDK.
@Flole998 that could be plausible. There are more horrible bugs in de SDK code.
Apparently I never hit it because I am not using WPA-Enterprise.
I've found the bug and patched it in the binary in the meantime. There are other bugs aswell in the code that I spotted when reading the assembly (several memory leaks for example), so in general code quality seems pretty low and now I understand why they prefer to keep it closed source aswell.
That is exactly my experience, the quality of the code, both open as closed is not terribly good. I guess the Espressif guys are great at designing hardware, not so good in writing software.
I would really love it if Espressif would take the following actions (and there is no reason why they could not):
Then we could make a community-based SDK where a LOT of bugs could be solved and, I am sure, a lot of code could be improved / made more efficient.
In fact, for my stuff, I don't really need the SDK code. It's just that I don't have the proper information to do all the initialisation in my own code, which I'd prefer. I already have my own lwip-fork.
Speaking about which, I'd be great if Espressif would finally disclose the interface between SDK/hardware and LWIP, so would take a shot at adapting a recent LWIP version. The "current" version is something like eight years old...
For some reason there is a function which attempts to free an invalid range of memory. This leads to the following coredump:
This issue exists since SDK > 2.3.0, so i am stuck on that version for now.
The code being used is based on the Arduino implementation (and this issue is tracked there as https://github.com/esp8266/Arduino/issues/8082)