Boost C++ Libraries: Ticket #4736: MinGW: tss crashes (SIGSEGV) in ~thread_specific_ptr https://svn.boost.org/trac10/ticket/4736 <p> tss crashes with a SIGSEGV in the destructor of thread_specific_ptr under mingw, inside boost::detail::set_tss_data(). </p> <p> After main() exits, apparently cleanup_tls_key() gets called some time prior to the thread_specific_ptr clean-up. </p> <p> Then inside set_tss_data(), get_or_make_current_thread_data() returns 0, and dereferencing it (current_thread_data-&gt;tss_data, line 589) causes the crash. </p> <p> get_or_make_... actually makes one, but get_current_thread_data() won't return it because current_thread_tls_key is reset. So there's a little resource leak here, too. Though I don't think that's important this late in the program's termination sequence, you could check current_thread_tls_key explicitly in get_or_make_... and avoid it. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4736 Trac 1.4.3 Jim Bell <jim@…> Thu, 14 Oct 2010 14:46:40 GMT attachment set https://svn.boost.org/trac10/ticket/4736 https://svn.boost.org/trac10/ticket/4736 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">tss-mingw-2010-10-14.patch</span> </li> </ul> Ticket Jim Bell <jim@…> Fri, 15 Oct 2010 19:49:33 GMT <link>https://svn.boost.org/trac10/ticket/4736#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4736#comment:1</guid> <description> <p> There seems to be a race condition involved, as I'm now able to pass the test_tss_lib test on my machine (un-patched) that reliably failed it earlier in the week. As you can see, though, the trunk test for gcc-mingw-4.3.3 also failed this same test and with the same symptoms. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Wed, 20 Oct 2010 06:10:34 GMT</pubDate> <title>severity, milestone changed https://svn.boost.org/trac10/ticket/4736#comment:2 https://svn.boost.org/trac10/ticket/4736#comment:2 <ul> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Showstopper</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost-1.45.0</span> </li> </ul> Ticket anonymous Thu, 21 Oct 2010 18:47:39 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4736#comment:3 https://svn.boost.org/trac10/ticket/4736#comment:3 <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">worksforme</span> </li> </ul> <p> Jim, I'm having trouble reproducing this, and I can't find any references to this in the build bot logs. Can you provide self-contained code that produces this error for you? (understandably if there is a race condition, this could be hard to reproduce, but if you provide me with a test case that should reproduce this, I'll run it on my Windows machine and add it to the test matrix). </p> Ticket Bryce Adelstein Lelbach Thu, 21 Oct 2010 19:08:58 GMT cc changed https://svn.boost.org/trac10/ticket/4736#comment:4 https://svn.boost.org/trac10/ticket/4736#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">Bryce Adelstein Lelbach</span> added </li> </ul> Ticket Jim Bell <jim@…> Thu, 21 Oct 2010 20:02:01 GMT <link>https://svn.boost.org/trac10/ticket/4736#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4736#comment:5</guid> <description> <p> RE: worksforme </p> <p> Note <a href="http://www.boost.org/development/tests/trunk/developer/output/MinGW-32%20jc-bell-com-boost-bin-v2-libs-thread-test-test_tss_lib-test-gcc-mingw-4-4-0-debug-threading-multi.html">this log</a> (live as of 2010/10/21 3PM CST): </p> <pre class="wiki">Run [2010-10-21 16:24:48 UTC]: fail Running 6 test cases... tss_instances = 0; tss_total = 5 tss_instances = 0; tss_total = 5 *** No errors detected </pre><p> Notice both "No errors detected" and "<strong><em>Run [...]: fail</em></strong>" above it. It exited main() just fine, then crashed. </p> </description> <category>Ticket</category> </item> <item> <author>Jim Bell <jim@…></author> <pubDate>Mon, 08 Nov 2010 15:56:55 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/4736#comment:6 https://svn.boost.org/trac10/ticket/4736#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">worksforme</span> </li> </ul> Ticket Jim Bell <jim@…> Wed, 10 Nov 2010 00:10:23 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4736#comment:7 https://svn.boost.org/trac10/ticket/4736#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Even though MinGW-32 still fails the test_tss_lib test, it's now for a different reason, the program terminates cleanly. Fixed. </p> Ticket Katie Chan Thu, 11 Nov 2010 04:08:04 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/4736#comment:8 https://svn.boost.org/trac10/ticket/4736#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/66482" title="Merged fix for issue #4736 from trunk">r66482</a> broke the regex_regress_threaded <a href="http://www.boost.org/development/tests/release/developer/regex.html">test case</a> in Regex across the board with MSVC that was previously passing. </p> Ticket Richard Webb <richard.webb@…> Thu, 11 Nov 2010 10:05:21 GMT <link>https://svn.boost.org/trac10/ticket/4736#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4736#comment:9</guid> <description> <p> f.y.i, Several of the Wave regression tests are failing on the release branch with a similar looking error. </p> </description> <category>Ticket</category> </item> <item> <author>Jim Bell <jim@…></author> <pubDate>Thu, 11 Nov 2010 13:07:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4736#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4736#comment:10</guid> <description> <p> If this_thread::get_id() gets called before a boost::thread is created, no call to set_current_thread_data() would have been made, and you'd see this symptom. </p> <p> FWIW, also noticed that the "throw thread_resource_error()" in get_or_make_current_thread_data() is inconsistent with other uses: "boost::throw_exception(thread_resource_error());" </p> </description> <category>Ticket</category> </item> <item> <author>Jim Bell <jim@…></author> <pubDate>Sat, 13 Nov 2010 02:33:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4736#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4736#comment:11</guid> <description> <p> <a class="ext-link" href="https://svn.boost.org/trac/boost/changeset/66518"><span class="icon">​</span>r66518</a> fixes this ticket as originally reported. Please reopen if other libraries are still failing. </p> </description> <category>Ticket</category> </item> <item> <author>Jim Bell <jim@…></author> <pubDate>Sat, 13 Nov 2010 02:34:12 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4736#comment:12 https://svn.boost.org/trac10/ticket/4736#comment:12 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket