Open wuyuanyi135 opened 1 year ago
I don't have access to the source of stdc++ implmentation. I will post some possible related links here
https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg617635.html
https://gcc.gnu.org/legacy-ml/gcc-help/2017-05/msg00164.html
@wuyuanyi135 Thanks, we will take a look.
BTW., you can find libstdc++ for toolchains dedicated for ESP chips here: https://github.com/espressif/gcc/tree/esp_based_on_11_2_0/libstdc%2B%2B-v3.
@0xjakob Thank you for the information. Let me know if more information is needed.
Answers checklist.
IDF version.
v5.1-dev-3818-g7f60b8ec32
Operating System used.
Windows
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
PowerShell
Development Kit.
ESP32-S3-WROOM-1-N16R2
Power Supply used.
USB
What is the expected behavior?
I have a project that utilizes two streams (inherented from
std::basic_streambuf<uint8_t>
) to save RAM:The first stream was used periodically to write data to SDCard partitions. The second stream was used to dump the written data to a HTTP client. They all work fine when used independently.
What is the actual behavior?
When dumping data, I want to use the event loop to notify all other stream 1 to flush their cached data into SDCard. Therefore, the stream 1 and stream 2 may be constructed concurrently. (The access to SDCard is mutex-protected).
In this case, I got a crash when constructing the streams:
By backtracing the stack I found it was a error thrown when constructing
std::locale
. I found a similar issue https://github.com/espressif/esp-idf/issues/5150 but the code did not reproduce the error.Steps to reproduce.
I could not share the whole project and it may need some work to get the MWE from my current project.
I will share the elf and the coredump here first. Let me know if more information is needed.
Debug Logs.
More Information.
ELF and coredump debug.zip