Boost C++ Libraries: Ticket #692: cpp_regex_traits<charT>::toi() method fails in the MT case https://svn.boost.org/trac10/ticket/692 <pre class="wiki">cpp_regex_traits&lt;charT&gt;::toi() method fails to parse the string correctly when it is used in multi-threaded environment. Originally, I run into this problem in regex parser code and traced it down to cpp_regex_traits&lt;charT&gt;::toi() method (btw, this happens on Linux only, Windows code goes thru a different code path). I believe that the problem is caused by the fact that *buffered* m_pimpl-&gt;m_sbuf and m_pimpl-&gt;m_is are used inside cpp_regex_traits&lt;charT&gt;::toi() method without locking. Thus, if two threads are trying to use it in the same time, it fails. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/692 Trac 1.4.3 lsh123 Sat, 29 Jul 2006 04:25:59 GMT <link>https://svn.boost.org/trac10/ticket/692#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/692#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=851494 The attached patch replace cpp_regex_traits&lt;charT&gt;::toi() implementation with w32_regex_traits&lt;charT&gt;::toi() code. This completely solves the multithreading problem. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sat, 29 Jul 2006 12:35:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/692#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/692#comment:2</guid> <description> <pre class="wiki">Logged In: YES user_id=14804 Confirmed, I'm working on a fix, and updated test cases. You can also fix this by defining BOOST_REGEX_USE_C_LOCALE in boost/regex/user.hpp and rebuilding everything. John. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sat, 29 Jul 2006 15:56:58 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/692#comment:3 https://svn.boost.org/trac10/ticket/692#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=14804 OK, I've been able to update the regression test suite so it reproduces the problem, and added the patch attached as a fix for this, and to generally tighten up const-correctness. Thanks for the report, John. </pre> Ticket lsh123 Sat, 29 Jul 2006 18:27:09 GMT <link>https://svn.boost.org/trac10/ticket/692#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/692#comment:4</guid> <description> <pre class="wiki">Logged In: YES user_id=851494 Thanks!!! </pre> </description> <category>Ticket</category> </item> </channel> </rss>