[Boost-bugs] [Boost C++ Libraries] #4736: MinGW: tss crashes (SIGSEGV) in ~thread_specific_ptr

Subject: [Boost-bugs] [Boost C++ Libraries] #4736: MinGW: tss crashes (SIGSEGV) in ~thread_specific_ptr
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-10-14 14:46:02


#4736: MinGW: tss crashes (SIGSEGV) in ~thread_specific_ptr
---------------------------------------------------------------------------+
 Reporter: Jim Bell <jim@…> | Owner: anthonyw
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: mingw tss SIGSEGV thread_specific_ptr destructor set_tss_data |
---------------------------------------------------------------------------+
 tss crashes with a SIGSEGV in the destructor of thread_specific_ptr under
 mingw, inside boost::detail::set_tss_data().

 After main() exits, apparently cleanup_tls_key() gets called some time
 prior to the thread_specific_ptr clean-up.

 Then inside set_tss_data(), get_or_make_current_thread_data() returns 0,
 and dereferencing it (current_thread_data->tss_data, line 589) causes the
 crash.

 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.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4736>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC