-
Notifications
You must be signed in to change notification settings - Fork 3
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
Including a Regular Expression, makes the program crash without even starting #11
Comments
A detail that may help (thanks to antangelo for pointing to it): the program crashes when that regex declaration is executed. In my example, as the declaration was global, it is run at the begining of the program, so it crashes even before the main function is run. That is why the program crashes without even begining. On the other hand, if the declaration is local in a function, the program crashes when that function is called (not at the begining of the execution). |
It appears the version of libc++ we use has an issue with escaping (#3 may be related). The following is a minimal sample that highlights the issue: std::regex("\\\\"); libc++'s regex implementation errors while parsing this, calling GDB log:
|
It seems that using functionalities of the <regex> header, makes the program crash without even starting to run.
I have created a minimal program to reproduce this issue:
https://gist.github.com/hcfcoder/9d3eb3212ce39bccd5dac95edf097d5a
Basically, adding these 2 codelines makes the program not able to start:
#include <regex>
static std::regex includeRegex = std::regex("\s*#include\s+([\\/A-Za-z0-9\-\.]+)");
I hope this helps.
The text was updated successfully, but these errors were encountered: