Boost C++ Libraries: Ticket #6440: Regex crash in object_cache in many-locale mulithreaded scenarios https://svn.boost.org/trac10/ticket/6440 <p> An intermittent crash occurs in object_cache when using regex in apps with many locales in multithreaded apps. The crash occurs due to pos not being decrementable in object_cache.hpp line 154 in boost 1.48.0. </p> <p> Stack: </p> <pre class="wiki">msvcr90!_invalid_parameter_noinfo+0xc myapp!boost::object_cache&lt;unsigned long,boost::re_detail::w32_regex_traits_implementation&lt;wchar_t&gt; &gt;::do_get+0x533 myapp!boost::object_cache&lt;unsigned long,boost::re_detail::w32_regex_traits_implementation&lt;wchar_t&gt; &gt;::get+0x69 myapp!boost::re_detail::create_w32_regex_traits&lt;wchar_t&gt;+0x1b myapp!boost::re_detail::regex_data&lt;wchar_t,boost::regex_traits&lt;wchar_t,boost::w32_regex_traits&lt;wchar_t&gt; &gt; &gt;::regex_data&lt;wchar_t,boost::regex_traits&lt;wchar_t,boost::w32_regex_traits&lt;wchar_t&gt; &gt; &gt;+0x6c myapp!boost::basic_regex&lt;wchar_t,boost::regex_traits&lt;wchar_t,boost::w32_regex_traits&lt;wchar_t&gt; &gt; &gt;::do_assign+0x5f myapp!boost::basic_regex&lt;wchar_t,boost::regex_traits&lt;wchar_t,boost::w32_regex_traits&lt;wchar_t&gt; &gt; &gt;::assign+0x23 myapp!match+0x131 </pre><p> The attached program reproes this consistently in anywhere from 1 min to 10 min on my Xeon workstation running Win7 x64 and using msvc version 16.00.40219.01. I have not tried any other compilers yet. </p> <p> The attached code also does not call regex directly but rather it manipulates object_cache directly in the same way that w32_regex_traits does in order to get an easier repro. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6440 Trac 1.4.3 Hamid Palo <hamid.palo@…> Mon, 23 Jan 2012 21:17:44 GMT attachment set https://svn.boost.org/trac10/ticket/6440 https://svn.boost.org/trac10/ticket/6440 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boostcrash.cpp</span> </li> </ul> <p> Reproduction program. </p> Ticket John Maddock Sun, 29 Jan 2012 13:33:05 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6440#comment:1 https://svn.boost.org/trac10/ticket/6440#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> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/76775" title="Fix bug in object_cache.hpp Fixes #6440.">[76775]</a>) Fix bug in object_cache.hpp Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6440" title="#6440: Bugs: Regex crash in object_cache in many-locale mulithreaded scenarios (closed: fixed)">#6440</a>. </p> Ticket