Boost C++ Libraries: Ticket #3104: Preprocessing with Boost::wave crashes when calling from multiple threads https://svn.boost.org/trac10/ticket/3104 <p> 1) While using boost::wave from within multiple threads - it crashes. </p> <p> 2) When using from one thread only - everything is OK. </p> <p> 3) I have defined: </p> <p> #define BOOST_WAVE_SUPPORT_THREADING 1 #define BOOST_SUPPORT_THREADS in my stdafx.h file </p> <p> I am using MSVS 2008 (<a class="missing wiki">CreateThread</a> in a for loop) and MSVS 2010 (ppl test using parallel_for loop) </p> <p> Please see my attached sample file. write included sample1.h - sample4.h files to c:\test\samples directory (or change path in code). </p> <p> Thank you. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3104 Trac 1.4.3 www.brutaltruth.ru Thu, 28 May 2009 09:10:30 GMT attachment set https://svn.boost.org/trac10/ticket/3104 https://svn.boost.org/trac10/ticket/3104 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">wave_bug_MT.zip</span> </li> </ul> <p> MSVS2008 project </p> Ticket Hartmut Kaiser Thu, 28 May 2009 15:03:23 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3104#comment:1 https://svn.boost.org/trac10/ticket/3104#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> Thanks for this report. It has been fixed recently and the patch will be part of Boost V1.40.0. </p> <p> Regards Hartmut </p> Ticket anonymous Fri, 29 May 2009 10:13:21 GMT <link>https://svn.boost.org/trac10/ticket/3104#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3104#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3104#comment:1" title="Comment 1">hkaiser</a>: </p> <blockquote class="citation"> <p> Thanks for this report. It has been fixed recently and the patch will be part of Boost V1.40.0. </p> <p> Regards Hartmut </p> </blockquote> <p> I have tested again with boost trunk and the problem is still there. Wave changelog lists 2 "race conditions" fixed. Is it related to this bug or the changes are not in the trunk yet? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 30 May 2009 15:35:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3104#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3104#comment:3</guid> <description> <p> The problem with your code is that you are including the Spirit headers files independently and before including Wave. Wave enables Spirit thread safety whenever it is compiled in multi-threaded mode. But if you include Spirit before Wave you need to switch Spirit (and probably Phoenix) into multi-threaded mode yourself. I was able to run your example successfully by adding: </p> <pre class="wiki">#define BOOST_SPIRIT_THREADSAFE 1 #define PHOENIX_THREADSAFE 1 // needed only if you use Phoenix </pre><p> to your stdafx.h before including Spirit. </p> <p> HTH Regards Hartmut </p> </description> <category>Ticket</category> </item> <item> <dc:creator>www.brutaltruth.ru</dc:creator> <pubDate>Mon, 01 Jun 2009 07:22:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3104#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3104#comment:4</guid> <description> <p> Thank you, Hartmut! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>www.brutaltruth.ru</dc:creator> <pubDate>Mon, 01 Jun 2009 08:45:27 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3104#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3104#comment:5</guid> <description> <p> Hartmut, i have tested my sample with defines that you suggested - it still causes Heap corruption problems (but no problems with asserts as sometimes before). Actually sample i attached for you is OK - there are only couple of little files used to be precompiled. As i add more files to precompile - heap corruption dialog pops back again. I am sorry for annoying you, just want Wave to be ok in next boost release. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Hartmut Kaiser</dc:creator> <pubDate>Mon, 01 Jun 2009 13:04:26 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3104#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3104#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3104#comment:5" title="Comment 5">www.brutaltruth.ru</a>: </p> <blockquote class="citation"> <p> Hartmut, i have tested my sample with defines that you suggested - it still causes Heap corruption problems (but no problems with asserts as sometimes before). Actually sample i attached for you is OK - there are only couple of little files used to be precompiled. As i add more files to precompile - heap corruption dialog pops back again. </p> </blockquote> <p> Could you provide a minimal example I could use to reproduce your problem? </p> <blockquote class="citation"> <p> I am sorry for annoying you, just want Wave to be ok in next boost release. </p> </blockquote> <p> No annoyance at all. I appreciate you patience. </p> <p> Regards Hartmut </p> </description> <category>Ticket</category> </item> <item> <dc:creator>tony </dc:creator> <pubDate>Tue, 02 Jun 2009 14:52:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3104#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3104#comment:7</guid> <description> <p> Thank you, Hartmut. Just compile the sample i sent you in Release settings and run it several times (3 or 4 and Heap corruption pops). Good bye. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Hartmut Kaiser</dc:creator> <pubDate>Thu, 04 Jun 2009 14:34:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3104#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3104#comment:8</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3104#comment:7" title="Comment 7">tony </a>: </p> <blockquote class="citation"> <p> Just compile the sample i sent you in Release settings and run it several times (3 or 4 and Heap corruption pops). </p> </blockquote> <p> I'm sorry, but I'm not able to reproduce your problems even when running in release mode a couple of times (I set up an endless loop executing your example and it ran for over an hour just fine). Any other idea how I could reproduce this effect? </p> <p> Regards Hartmut </p> </description> <category>Ticket</category> </item> </channel> </rss>