Boost C++ Libraries: Ticket #12222: Segmentation fault in boost::make_u32regex when trying to construct invalid regular expression https://svn.boost.org/trac10/ticket/12222 <p> The following code produces segmentation fault with boost 1.61.0, icu 57.1: </p> <pre class="wiki">#include &lt;boost/regex/icu.hpp&gt; #include &lt;iostream&gt; int main() { auto rx = boost::make_u32regex("\\", boost::regex::basic); std::cout &lt;&lt; boost::u32regex_search("qwerty", rx) &lt;&lt; std::endl; } </pre><p> Backtrace: </p> <pre class="wiki">Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7b54b7b in boost::re_detail_106100::basic_regex_parser&lt;int, boost::icu_regex_traits&gt;::parse_basic() () from /usr/lib64/libboost_regex.so.1.61.0 (gdb) bt #0 0x00007ffff7b54b7b in boost::re_detail_106100::basic_regex_parser&lt;int, boost::icu_regex_traits&gt;::parse_bas ic() () from /usr/lib64/libboost_regex.so.1.61.0 #1 0x00007ffff7b565a6 in boost::re_detail_106100::basic_regex_parser&lt;int, boost::icu_regex_traits&gt;::parse(int const*, int const*, unsigned int) () from /usr/lib64/libboost_regex.so.1.61.0 #2 0x00007ffff7b56a1d in boost::basic_regex&lt;int, boost::icu_regex_traits&gt;::do_assign(int const*, int const*, unsigned int) () from /usr/lib64/libboost_regex.so.1.61.0 #3 0x0000000000406fa4 in boost::basic_regex&lt;int, boost::icu_regex_traits&gt;::assign(int const*, int const*, uns igned int) () #4 0x000000000040631d in boost::basic_regex&lt;int, boost::icu_regex_traits&gt;::basic_regex&lt;boost::u8_to_u32_itera tor&lt;char const*, int&gt; &gt;(boost::u8_to_u32_iterator&lt;char const*, int&gt;, boost::u8_to_u32_iterator&lt;char const*, in t&gt;, unsigned int) () #5 0x00000000004057ba in boost::basic_regex&lt;int, boost::icu_regex_traits&gt; boost::re_detail_106100::do_make_u3 2regex&lt;char const*&gt;(char const*, char const*, unsigned int, mpl_::int_&lt;1&gt; const*) () #6 0x00000000004050d5 in boost::make_u32regex(char const*, unsigned int) () #7 0x0000000000404604 in main () </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12222 Trac 1.4.3 John Maddock Thu, 09 Jun 2016 18:01:11 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/12222#comment:1 https://svn.boost.org/trac10/ticket/12222#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.62.0</span> </li> </ul> <p> Fixed in <a class="ext-link" href="https://github.com/boostorg/regex/commit/7719dedbafa0ffdd3bd7d6d6c87881dd6fcde9e5"><span class="icon">​</span>https://github.com/boostorg/regex/commit/7719dedbafa0ffdd3bd7d6d6c87881dd6fcde9e5</a> </p> <p> Thanks! </p> Ticket