Boost C++ Libraries: Ticket #8788: SIGSEGV on thread::join https://svn.boost.org/trac10/ticket/8788 <p> Fedora 19, x86_64. </p> <p> The following program: </p> <pre class="wiki">#include &lt;boost/thread/thread.hpp&gt; void myFunc() { } int main(int, char **) { boost::thread p(myFunc); p.join(); } </pre><p> When compiled with: <code>g++ -o bthread bthread.cxx -lboost_thread -D_GLIBCXX_DEBUG</code> </p> <p> Results in the following segfault (with -ggdb added): </p> <pre class="wiki">boost::detail::thread_data_base::~thread_data_base (this=0x6100d0, __in_chrg=&lt;optimized out&gt;) at libs/thread/src/pthread/thread.cpp:42 42 i-&gt;second-&gt;unlock(); (gdb) bt full #0 boost::detail::thread_data_base::~thread_data_base (this=0x6100d0, __in_chrg=&lt;optimized out&gt;) at libs/thread/src/pthread/thread.cpp:42 i = &lt;error reading variable i (Cannot access memory at address 0x1)&gt; e = &lt;error reading variable e (Cannot access memory at address 0x0)&gt; #1 0x00000000004095bb in boost::detail::thread_data&lt;void (*)()&gt;::~thread_data (this=0x6100d0, __in_chrg=&lt;optimized out&gt;) at /usr/include/boost/thread/detail/thread.hpp:91 No locals. #2 0x00000000004095ea in boost::detail::thread_data&lt;void (*)()&gt;::~thread_data (this=0x6100d0, __in_chrg=&lt;optimized out&gt;) at /usr/include/boost/thread/detail/thread.hpp:91 No locals. #3 0x0000000000409622 in boost::checked_delete&lt;boost::detail::thread_data&lt;void (*)()&gt; &gt; (x=0x6100d0) at /usr/include/boost/checked_delete.hpp:34 No locals. #4 0x0000000000409912 in boost::detail::sp_counted_impl_p&lt;boost::detail::thread_data&lt;void (*)()&gt; &gt;::dispose (this=0x6102f0) at /usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:78 No locals. #5 0x00000000004052ce in boost::detail::sp_counted_base::release (this=0x6102f0) at /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:146 No locals. #6 0x000000360500c93d in ~shared_count (this=0x7fffffffe0e8, __in_chrg=&lt;optimized out&gt;) at boost/smart_ptr/detail/shared_count.hpp:371 No locals. #7 ~shared_ptr (this=0x7fffffffe0e0, __in_chrg=&lt;optimized out&gt;) at boost/smart_ptr/shared_ptr.hpp:328 No locals. #8 boost::thread::join_noexcept (this=0x7fffffffe1c0) at libs/thread/src/pthread/thread.cpp:340 local_thread_info = {px = 0x6100d0, pn = {pi_ = 0x6102f0}} ---Type &lt;return&gt; to continue, or q &lt;return&gt; to quit--- #9 0x0000000000405bf5 in boost::thread::join (this=0x7fffffffe1c0) at /usr/include/boost/thread/detail/thread.hpp:751 No locals. #10 0x00000000004045eb in main () at bthread.cxx:11 p = {thread_info = {px = 0x0, pn = {pi_ = 0x0}}} </pre><p> See also ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7666" title="#7666: Bugs: Boost Thread SIGSEGV on join() when -D_GLIBCXX_DEBUG is used (closed: invalid)">#7666</a>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8788 Trac 1.4.3 viboes Sun, 07 Jul 2013 16:00:53 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8788#comment:1 https://svn.boost.org/trac10/ticket/8788#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">duplicate</span> </li> </ul> <p> Duplicate of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7666" title="#7666: Bugs: Boost Thread SIGSEGV on join() when -D_GLIBCXX_DEBUG is used (closed: invalid)">#7666</a>. </p> Ticket