Created attachment 36184 [details] Crashing program The following code, crashes for some instances of line (as given in the attachment): std::regex lineExp("tpie::update_fractions\\([ ]*\"([^\"]+)\"[ ]*,[ ]*([^, ]+)[ ]*,[ ]*([^\\) ]+)[ ]*\\);.*", std::regex::extended); std::string line = <some_long_string_here> std::smatch matches; std::regex_match(line, matches, lineExp); The crash ocure as we are running out of stack space in some possible infinite recurtion. The context of the code can be seen here https://github.com/thomasmoelhave/tpie/blob/cpp11-cleanup/tpie/fractional_progress.cpp#L64 The issue is triggered by: g++ -std=c++11 test2.cc && ./a.out
Mark as duplicate, since it's as well about stack overflow. *** This bug has been marked as a duplicate of bug 61582 ***
This isn't an "infinite" recursion, but just a deep one. I haven't implement heap allocation and manual recursion yet. In the mean time, you may compile your code with -O2 (tail recursion elimination may help), set a larger stack size, or use -fsplit-stack.