-
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
ESP shuts down when instantiating std::regex object #6198
Comments
The entire std C++ isn't supported/tested. In this case I'd say the issue is likely either stack size or free heap, but it could be some dependency as well, such as RTTI which we don't have. |
Well ok I rewrote the code to not use regexes, but it's not ideal. Is there a way to get closer the the particular problem in this case? |
I'm for getting as close to standard as possible, so if you could pursue this it would be great. |
It was done before I came onboard, but IIRC the RTTI is disabled in the toolchain because it inflates the code size and adds bytes to every C++ object. Theoretically, it's just a switch that needs to be enabled on the g++ toolchain (not just the IDE platform.txt, but the libstdc++ compilation in the esp-quick-toolchain). |
I haven't looked into it further, but I don't think that RTTI is the problem. Can't imagine why compiling a regex object would have anything to do with RTTI. |
Yes, it doesn't look like a RTTI issue on second glance a little later. What it does look like is a memory error generating the regex parse tree. Your attached crash dump is with exceptions enabled. Without exceptions enabled, I get abort() called from
And on further investigation, GCC 4.8 does not support regex properly : https://stackoverflow.com/questions/12530406/is-gcc-4-8-or-earlier-buggy-about-regular-expressions If you're adventurous, check out my GCC 7.2 PR #6267 . It might get your regex running. Closing as this is a known issue in gcc 4.8... |
After much hacking, You can give your app a try with PR #6294 if you want to do further experiments. |
Wow, amazing. I'll give it a try on the weekend. |
Basic Infos
Platform
Settings in IDE
Problem Description
When instantiating a
std::regex
object, the D1 mini shuts down.It only works for very simple regexes, such as /a/, but not for (a little) more complicated ones.
I also tried enabling C++ exceptions and catching something, but nothing is caught.
MCVE Sketch
Debug Messages
Decoded stack trace:
The text was updated successfully, but these errors were encountered: