-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
None
-
No
-
None
-
rhel-pt-cpp-libs
-
None
-
False
-
False
-
-
None
-
None
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
None
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86164
std::regex crashes when matching long lines.
Here is an example:
#include <regex> #include <iostream> int main() { std::string s (100'000, '*'); std::smatch m; std::regex r ("^(.*?)$"); std::regex_search (s, m, r); std::cout << s.substr (0, 10) << std::endl; std::cout << m .str (1) .substr (0, 10) << std::endl; }
It turns out that std::regex_search operator .* is implemented recursively which result in this example in a stack overflow.
Goal
- Investigate how much benefit we can get from small changes that just reduce stack layout.
- Investigate replacing recursion with iteration
- Investigate transforming NFA to DFA (probably not possible without ABI change)