bug with maps/unordered maps (C++)

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

bug with maps/unordered maps (C++)

Postby mzimmers » Wed May 30, 2018 8:16 pm

Hi all -

I've uncovered what looks like a bug in the implementation of maps and unordered maps. To whom would I report this?

Thanks...

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: bug with maps/unordered maps (C++)

Postby kolban » Wed May 30, 2018 11:46 pm

Do you mean the C++ class known as std::map?

What I'd probably suggest you do is create a detailed PDF describing the nature of the problem, steps to recreate, what environment it is occurring within and any other relevant details you think would be useful for a someone to read and understand as much of the puzzle as possible. Post a link to the PDF. That way you should only have to write the text once and if it needs to be shipped around it will already have been written. If there is a puzzle in this area, one might want to try writing a sample that will compile on the ESP32 and also compile on Linux and see if there is a difference in operation.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: bug with maps/unordered maps (C++)

Postby mzimmers » Thu May 31, 2018 3:12 am

Hey Neil - I can try to put something together, but might be tough to create a repeatable example. At this point, I'm mostly interested in what governing body is the custodian of the code. If they have a forum, even a github one, I might be able to locate someone who could act on the incomplete information that I have.

Is Espressif the "owner" of the tool chain?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: bug with maps/unordered maps (C++)

Postby kolban » Thu May 31, 2018 3:50 am

I'm going to guess that the toolchain comes from the "crosstool-NG" project with additions for Xtensa ... see:

https://github.com/espressif/crosstool-NG

and

http://crosstool-ng.github.io/
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

ESP_Sprite
Posts: 9708
Joined: Thu Nov 26, 2015 4:08 am

Re: bug with maps/unordered maps (C++)

Postby ESP_Sprite » Thu May 31, 2018 9:59 am

FWIW, if you can create an example or describe the situation this occurs in, you can file it as an issue in the esp-idf github anyway. If anything, we can decide if this is ESP32-specific or possibly a general libstdc++ error and pass it on upstream.

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: bug with maps/unordered maps (C++)

Postby mzimmers » Fri Jun 01, 2018 2:02 pm

After a lot of trial and error, I no longer believe that this is a bug in the STL. Somehow, my unordered_map was getting corrupted. I traced it to a call to xQueueReceive() that seems to have been overwriting my stack area.

The fix was to dynamically create and destroy instances of the object containing the unordered_map every time I needed one, rather than using an automatic variable. Probably good form anyway, given that the routine was of indefinite duration.

Thanks to those who looked...

Who is online

Users browsing this forum: No registered users and 94 guests