https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83754
Bug ID: 83754 Summary: Segmentation fault in regex_search Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- The following code #include <regex> #include <string> int main() { std::regex pattern("\\w+\\."); std::string s(1000000, 'a'); return std::regex_search(s, pattern); } leads to segmentation fault. Backtrace reports the following: #1 0x00000000004174a2 in std::_Function_handler<bool (char), std::__detail::_BracketMatcher<std::regex_traits<char>, false, false> >::_M_invoke(std::_Any_data const&, char&&) () #2 0x0000000000415544 in std::function<bool (char)>::operator()(char) const () #3 0x0000000000411222 in std::__detail::_State<char>::_M_matches(char) const () #4 0x000000000040cde3 in std::__detail::_Executor<skip>::_M_handle_match <Following block is repeated thousands of times:> #5 0x0000000000409cb0 in std::__detail::_Executor<skip>::_M_dfs #6 0x0000000000411656 in std::__detail::_Executor<skip>::_M_rep_once_more #7 0x000000000040ca05 in std::__detail::_Executor<skip>::_M_handle_repeat <...> #11350 0x0000000000409cb0 in std::__detail::_Executor<skip>::_M_dfs #11351 0x0000000000411656 in std::__detail::_Executor<skip>::_M_rep_once_more #11352 0x000000000040ca05 in std::__detail::_Executor<skip>::_M_handle_repeat <...> This issue could be related to the bug 79539