Boost C++ Libraries: Ticket #7666: Boost Thread SIGSEGV on join() when -D_GLIBCXX_DEBUG is used https://svn.boost.org/trac10/ticket/7666 <p> I'd like to report a SIGSEGV using MinGW GCC 4.7.2 and Boost 1.52.0. Boost 1.51 is working fine. </p> <p> I've compiled Boost libraries using "-std=c++11 -std=gnu++11" flags. </p> <p> If I compile this code: </p> <pre class="wiki">#include &lt;boost/thread/thread.hpp&gt; void myFunc() { boost::this_thread::sleep(boost::posix_time::seconds(5)); } int main(int, char **) { boost::thread p(myFunc); p.join(); return 0; } </pre><p> with the following flags: </p> <pre class="wiki">-DBOOST_ALL_DYN_LINK -DBOOST_ASIO_DISABLE_BUFFER_DEBUGGING -DBOOST_CHRONO_VERSION=2 -DBOOST_FILESYSTEM_NO_DEPRECATED -DBOOST_FILESYSTEM_VERSION=3 -DBOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0 -DBOOST_THREAD_VERSION=3 -DSIMULATOR -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0500 -std=c++11 -std=gnu++11 -mno-ms-bitfields -Wall -Wextra -Wuninitialized -Wold-style-cast -Woverloaded-virtual -Wnoexcept -Wnon-virtual-dtor -Winit-self -Wmissing-include-dirs -Wunused-parameter -pedantic -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -g -O0 -fno-inline -gdwarf-2 -g3 -fstack-protector-all </pre><p> and I link it with the following options: </p> <pre class="wiki">-lssp C:\MinGW\lib\libboost_system-mt-d.dll C:\MinGW\lib\libboost_thread-mt-d.dll C:\MinGW\lib\libboost_chrono-mt-d.dll -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 </pre><p> at run the thread is launched, and after 5 seconds I get a SIGSEGV, with the following GDB backtrace: </p> <pre class="wiki">(gdb) r Starting program: C:\Users\Tony\Documents\sitradesdk\output\atomictest.exe [New Thread 1224.0xcb0] [New Thread 1224.0xf10] Program received signal SIGSEGV, Segmentation fault. 0x70a012cf in boost::detail::thread_data_base::~thread_data_base ( this=0x8750d0, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:43 43 i-&gt;second-&gt;unlock(); (gdb) bt #0 0x70a012cf in boost::detail::thread_data_base::~thread_data_base ( this=0x8750d0, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:43 #1 0x00405d9c in _fu832____stack_chk_guard () at C:/MinGW/include/boost/thread/detail/thread.hpp:52 #2 0x70a0730a in boost::detail::heap_delete&lt;boost::detail::thread_data_base&gt; (data=0x8750d0) at ./boost/thread/win32/thread_heap_alloc.hpp:416 #3 0x70a08069 in boost::detail::intrusive_ptr_release (p=0x8750d0) at ./boost/thread/win32/thread_data.hpp:121 #4 0x70a0422b in boost::intrusive_ptr&lt;boost::detail::thread_data_base&gt;::~intrus ive_ptr (this=0x28fe58, __in_chrg=&lt;optimized out&gt;) at ./boost/smart_ptr/intrusive_ptr.hpp:96 #5 0x70a01cc0 in boost::thread::join (this=0x28fef8) at libs\thread\src\win32\thread.cpp:331 #6 0x004015c1 in _fu12____stack_chk_guard () at C:\Users\Tony\Documents\sitradesdk\test\utils\atomic.cpp:82 </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7666 Trac 1.4.3 anonymous Sat, 10 Nov 2012 10:57:33 GMT <link>https://svn.boost.org/trac10/ticket/7666#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:1</guid> <description> <p> I have tried the test after installing gcc-4.7.2. I don't reach to reproduce adding -fstack-protector-all and -lssp to my command line. </p> <p> Please, could you try to reduce the compiler flags and the libraries you link with so that it is easy I reproduce it? </p> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Sat, 10 Nov 2012 19:57:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:2</guid> <description> <p> Maybe I've found it. </p> <p> You just need to build the test code with _GLIBCXX_DEBUG. </p> <p> This is now my gcc command lines (taken from CMake output): </p> <pre class="wiki">/C/MinGW/bin/g++.exe -std=c++11 -std=gnu++11 -mno-ms-bitfields -Wall -Wextra -Wuninitialized -Wold-style-cast -Woverloaded-virtual -Wnoexcept -Wnon-virtual-dtor -Winit-self -Wmissing-include-dirs -Wunused-parameter -pedantic -D_GLIBCXX_DEBUG -g -O0 -fno-inline -gdwarf-2 -g3 @CMakeFiles/threadtest.dir/includes_CXX.rsp -o CMakeFiles/threadtest.dir/thread.cpp.obj -c /c/Users/Tony/Documents/sitradesdk/test/utils/thread.cpp </pre><pre class="wiki">/C/MinGW/bin/g++.exe -std=c++11 -std=gnu++11 -mno-ms-bitfields -Wall -Wextra -Wuninitialized -Wold-style-cast -Woverloaded-virtual -Wnoexcept -Wnon-virtual-dtor -Winit-self -Wmissing-include-dirs -Wunused-parameter -pedantic -D_GLIBCXX_DEBUG -g -O0 -fno-inline -gdwarf-2 -g3 -Wl,--whole-archive CMakeFiles/threadtest.dir/objects.a -Wl,--no-whole-archive -o threadtest.exe -Wl,--out-implib,libthreadtest.dll.a -Wl,--major-image-version,0,--minor-image-version,0 /C/MinGW/lib/libboost_system-mt-d.dll /C/MinGW/lib/libboost_thread-mt-d.dll /C/MinGW/lib/libboost_chrono-mt-d.dll -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 </pre> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Sat, 10 Nov 2012 20:02:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:3</guid> <description> <p> Moreover, you don't need to link with chrono library when compiling the test code. Just system and thread (mt-d variant). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 11 Nov 2012 00:02:36 GMT</pubDate> <title>summary changed https://svn.boost.org/trac10/ticket/7666#comment:4 https://svn.boost.org/trac10/ticket/7666#comment:4 <ul> <li><strong>summary</strong> <span class="trac-field-old">Boost Thread SIGSEGV</span> → <span class="trac-field-new">Boost Thread SIGSEGV on join() when -fstack-protector-all</span> </li> </ul> <p> I have reached to reproduce the error. I will need sometime to take care of this issue. </p> Ticket anonymous Sun, 11 Nov 2012 06:35:44 GMT <link>https://svn.boost.org/trac10/ticket/7666#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:5</guid> <description> <p> Great. But you don't need to use stack protection feature. I was able to reproduce it just defining _GLIBCXX_DEBUG during compilation. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 09 Jun 2013 17:03:57 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/7666#comment:6 https://svn.boost.org/trac10/ticket/7666#comment:6 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket anonymous Sat, 06 Jul 2013 11:55:48 GMT <link>https://svn.boost.org/trac10/ticket/7666#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:7</guid> <description> <p> Reproducible with _GLIBCXX_DEBUG on GCC 4.8.1; compiling natively on Fedora 19. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 07 Jul 2013 15:58:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:8</guid> <description> <p> See also <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8788" title="#8788: Bugs: SIGSEGV on thread::join (closed: duplicate)">#8788</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 15 Sep 2013 21:58:07 GMT</pubDate> <title>keywords, summary changed https://svn.boost.org/trac10/ticket/7666#comment:9 https://svn.boost.org/trac10/ticket/7666#comment:9 <ul> <li><strong>keywords</strong> -D_GLIBCXX_DEBUG added </li> <li><strong>summary</strong> <span class="trac-field-old">Boost Thread SIGSEGV on join() when -fstack-protector-all</span> → <span class="trac-field-new">Boost Thread SIGSEGV on join() when -D_GLIBCXX_DEBUG is used</span> </li> </ul> Ticket viboes Sun, 15 Sep 2013 22:20:23 GMT <link>https://svn.boost.org/trac10/ticket/7666#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:10</guid> <description> <p> Please, could you try these patches in case it could be related to this issue. </p> <pre class="wiki">svn diff win32/thread_data.hpp Index: win32/thread_data.hpp =================================================================== --- win32/thread_data.hpp (revision 85663) +++ win32/thread_data.hpp (working copy) @@ -148,7 +148,7 @@ virtual void run()=0; - void notify_all_at_thread_exit(condition_variable* cv, mutex* m) + virtual void notify_all_at_thread_exit(condition_variable* cv, mutex* m) { notify.push_back(std::pair&lt;condition_variable*, mutex*&gt;(cv, m)); } </pre><pre class="wiki">svn diff libs/thread/src/win32/thread.cpp Index: libs/thread/src/win32/thread.cpp =================================================================== --- libs/thread/src/win32/thread.cpp (revision 85677) +++ libs/thread/src/win32/thread.cpp (working copy) @@ -279,6 +279,12 @@ interruption_enabled=false; #endif } + ~externally_launched_thread() { + BOOST_ASSERT(notify.empty()); + notify.clear(); + BOOST_ASSERT(async_states_.empty()); + async_states_.clear(); + } </pre><p> </p> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Tue, 17 Sep 2013 19:45:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:11</guid> <description> <p> Unfortunately, the patch doesn't work. Tried with gcc 4.8.1 and boost-1.54.0, got same backtrace: </p> <pre class="wiki">(gdb) r Starting program: C:\Users\Tony\Downloads\boost_1_54_0\test.exe [New Thread 3600.0xe14] warning: SHIMVIEW: ShimInfo(Complete) [New Thread 3600.0xa9c] Program received signal SIGSEGV, Segmentation fault. 0x67e81537 in boost::detail::thread_data_base::~thread_data_base ( this=0x5b23d0, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:45 45 i-&gt;second-&gt;unlock(); (gdb) bt #0 0x67e81537 in boost::detail::thread_data_base::~thread_data_base ( this=0x5b23d0, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:45 #1 0x0040b4e8 in boost::detail::thread_data&lt;void (*)()&gt;::~thread_data ( this=0x5b23d0, __in_chrg=&lt;optimized out&gt;) at C:/x32-481-win32-sjlj-r2/include/boost/thread/detail/thread.hpp:91 #2 0x67e8f542 in boost::detail::heap_delete&lt;boost::detail::thread_data_base&gt; (data=0x5b23d0) at ./boost/thread/win32/thread_heap_alloc.hpp:391 #3 0x67e90971 in boost::detail::intrusive_ptr_release (p=0x5b23d0) at ./boost/thread/win32/thread_data.hpp:137 #4 0x67e8abef in boost::intrusive_ptr&lt;boost::detail::thread_data_base&gt;::~intrus ive_ptr (this=0x28fd5c, __in_chrg=&lt;optimized out&gt;) at ./boost/smart_ptr/intrusive_ptr.hpp:97 #5 0x67e822b5 in boost::thread::join_noexcept (this=0x28fe8c) at libs\thread\src\win32\thread.cpp:354 #6 0x0040c183 in boost::thread::join (this=0x28fe8c) at C:/x32-481-win32-sjlj-r2/include/boost/thread/detail/thread.hpp:756 #7 0x00401734 in main () at test.cpp:12 </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 17 Sep 2013 20:13:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:12</guid> <description> <p> I don't understand how the error is in </p> <pre class="wiki">45 i-&gt;second-&gt;unlock(); </pre><p> after the patch. The patch ensure that there are no elements in notify and so the following code shouldn't crash. </p> <pre class="wiki"> thread_data_base::~thread_data_base() { for (notify_list_t::iterator i = notify.begin(), e = notify.end(); i != e; ++i) { i-&gt;second-&gt;unlock(); i-&gt;first-&gt;notify_all(); } for (async_states_t::iterator i = async_states_.begin(), e = async_states_.end(); i != e; ++i) { (*i)-&gt;make_ready(); } } </pre><p> Please could you comment the code inside this function in src/win32/thread.cpp? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 17 Sep 2013 21:17:50 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/7666#comment:13 https://svn.boost.org/trac10/ticket/7666#comment:13 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.55.0</span> </li> </ul> <p> Committed revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/85734" title="Thread: try to fix SIGSEGV on win32 issue #7666.">[85734]</a>. </p> Ticket viboes Tue, 17 Sep 2013 21:21:54 GMT <link>https://svn.boost.org/trac10/ticket/7666#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:14</guid> <description> <p> See <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8586" title="#8586: Bugs: Boost Thread .join() causes exception. Intel C++ 13.1.1. Windows XP SP3 (closed: duplicate)">#8586</a>, <a class="reopened ticket" href="https://svn.boost.org/trac10/ticket/9118" title="#9118: Bugs: Seg fault on thread join when llvm and libc++ are used (reopened)">#9118</a>. </p> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Tue, 17 Sep 2013 21:53:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:15 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:15</guid> <description> <p> Commented all code inside thread_data_base::~thread_data_base(), test is fine, no SIGSEGV anymore. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 18 Sep 2013 05:20:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:16</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7666#comment:15" title="Comment 15">Antonio Di Monaco &lt;tony@…&gt;</a>: </p> <blockquote class="citation"> <p> Commented all code inside thread_data_base::~thread_data_base(), test is fine, no SIGSEGV anymore. </p> </blockquote> <p> Hrrr, I suspect that the thread data of the main thread is incoherent. Evidently this is not a solution just a patch.. </p> <p> I would need to reproduce the issue, but I don't reach to do it now. </p> <p> If this is deterministic, could you use a debugger and stop at the beginning of ~thread_data_base() and inspect the notify variable? </p> <p> Thanks your help. </p> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Wed, 18 Sep 2013 09:18:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:17 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:17</guid> <description> <p> Maybe there's something here. I applied the patch, I started with a full run, just to be sure that SIGSEGV was still present, and then I printed out notify variable. </p> <pre class="wiki">(gdb) b boost::detail::thread_data_base::~thread_data_base() Breakpoint 1 at 0x40188c (gdb) r Starting program: C:\Documents and Settings\dev\Documenti\Downloads\test.exe [New Thread 2356.0xed0] [New Thread 2356.0xf28] Breakpoint 1, 0x0040188c in boost::detail::thread_data_base::~thread_data_base() () (gdb) c Continuing. Breakpoint 1, boost::detail::thread_data_base::~thread_data_base ( this=0x243330, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:40 40 thread_data_base::~thread_data_base() (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. 0x67e81517 in boost::detail::thread_data_base::~thread_data_base ( this=0x243330, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:45 45 i-&gt;second-&gt;unlock(); (gdb) r The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: C:\Documents and Settings\dev\Documenti\Downloads\test.exe [New Thread 3604.0x834] [New Thread 3604.0x58c] Breakpoint 1, 0x0040188c in boost::detail::thread_data_base::~thread_data_base() () (gdb) s Single stepping until exit from function _ZN5boost6detail16thread_data_baseD2Ev, which has no line number information. boost::detail::thread_data_base::~thread_data_base ( this=0x6ced3354 &lt;libgcc_s_sjlj-1!_Unwind_SjLj_Register+116&gt;, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:40 40 thread_data_base::~thread_data_base() (gdb) s Breakpoint 1, boost::detail::thread_data_base::~thread_data_base ( this=0x243330, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:40 40 thread_data_base::~thread_data_base() (gdb) s 42 for (notify_list_t::iterator i = notify.begin(), e = notify.end( ); (gdb) p notify $1 = std::vector of length 0, capacity 0 = {Cannot access memory at address 0x0 (gdb) p async_states_ $2 = std::vector of length 0, capacity 0 </pre><p> Seems that internal buffer of notify vector has been lost. Move operation somewhere??? (just guessing...) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 18 Sep 2013 11:06:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:18 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:18</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7666#comment:17" title="Comment 17">Antonio Di Monaco &lt;tony@…&gt;</a>: </p> <blockquote class="citation"> <p> Maybe there's something here. I applied the patch, I started with a full run, just to be sure that SIGSEGV was still present, and then I printed out notify variable. </p> </blockquote> <blockquote class="citation"> </blockquote> <pre class="wiki">&gt; Breakpoint 1, boost::detail::thread_data_base::~thread_data_base ( &gt; this=0x243330, __in_chrg=&lt;optimized out&gt;) &gt; at libs\thread\src\win32\thread.cpp:40 &gt; 40 thread_data_base::~thread_data_base() &gt; (gdb) s &gt; 42 for (notify_list_t::iterator i = notify.begin(), e = notify.end( &gt; ); &gt; (gdb) p notify &gt; $1 = std::vector of length 0, capacity 0 = {Cannot access memory at address 0x0 &gt; (gdb) p async_states_ &gt; $2 = std::vector of length 0, capacity 0 &gt; }}} </pre><p> Could you try to see when the access to address 0x0 is done? Could you do a step on notify.begin()? </p> <blockquote class="citation"> <p> Seems that internal buffer of notify vector has been lost. Move operation somewhere??? (just guessing...) </p> </blockquote> <p> I don't think so. This class is not moved. </p> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Wed, 18 Sep 2013 12:21:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:19 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:19</guid> <description> <p> Ok. Seems that the access to 0x0 is just when " i-&gt; " is performed. </p> <pre class="wiki">Breakpoint 1, 0x0040188c in boost::detail::thread_data_base::~thread_data_base() () (gdb) s Single stepping until exit from function _ZN5boost6detail16thread_data_baseD2Ev, which has no line number information. boost::detail::thread_data_base::~thread_data_base ( this=0x6ced3354 &lt;libgcc_s_sjlj-1!_Unwind_SjLj_Register+116&gt;, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:40 40 thread_data_base::~thread_data_base() (gdb) Breakpoint 1, boost::detail::thread_data_base::~thread_data_base ( this=0x243330, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:40 40 thread_data_base::~thread_data_base() (gdb) 42 for (notify_list_t::iterator i = notify.begin(), e = notify.end( ); (gdb) std::vector&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt;, std::allocator &lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt; &gt; &gt;::begin ( this=0x24335c) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/ stl_vector.h:539 539 { return iterator(this-&gt;_M_impl._M_start); } (gdb) p _M_impl $3 = {&lt;std::allocator&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt; &gt;&gt; = {&lt;__gnu_cxx::new_allocator&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt; &gt;&gt; = {&lt;No data fields&gt;}, &lt;No data fields&gt;}, _M_start = 0x0, _M_finish = 0x1, _M_end_of_storage = 0x0} (gdb) s __gnu_cxx::__normal_iterator&lt;std::pair&lt;boost::condition_variable*, boost::mutex* &gt;*, std::vector&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt;, std::alloc ator&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt; &gt; &gt; &gt;::__normal_iterat or (this=0x22fbec, __i=@0x24335c: 0x0) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/ stl_iterator.h:726 726 __normal_iterator(const _Iterator&amp; __i) : _M_current(__i) { } (gdb) std::vector&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt;, std::allocator &lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt; &gt; &gt;::end ( this=0x24335c) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/ stl_vector.h:557 557 { return iterator(this-&gt;_M_impl._M_finish); } (gdb) __gnu_cxx::__normal_iterator&lt;std::pair&lt;boost::condition_variable*, boost::mutex* &gt;*, std::vector&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt;, std::alloc ator&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt; &gt; &gt; &gt;::__normal_iterat or (this=0x22fbec, __i=@0x243360: 0x1) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/ stl_iterator.h:726 726 __normal_iterator(const _Iterator&amp; __i) : _M_current(__i) { } (gdb) __gnu_cxx::operator!=&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt;*, std ::vector&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt;, std::allocator&lt;st d::pair&lt;boost::condition_variable*, boost::mutex*&gt; &gt; &gt; &gt; ( __lhs=&lt;error reading variable: Cannot access memory at address 0x0&gt;, __rhs=&lt;error reading variable: Cannot access memory at address 0x1&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/ stl_iterator.h:825 825 { return __lhs.base() != __rhs.base(); } (gdb) __gnu_cxx::__normal_iterator&lt;std::pair&lt;boost::condition_variable*, boost::mutex* &gt;*, std::vector&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt;, std::alloc ator&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt; &gt; &gt; &gt;::base ( this=0x22fc5c) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/ stl_iterator.h:791 791 { return _M_current; } (gdb) __gnu_cxx::__normal_iterator&lt;std::pair&lt;boost::condition_variable*, boost::mutex* &gt;*, std::vector&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt;, std::alloc ator&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt; &gt; &gt; &gt;::base ( this=0x22fc58) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/ stl_iterator.h:791 791 { return _M_current; } (gdb) boost::detail::thread_data_base::~thread_data_base (this=0x243330, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:45 45 i-&gt;second-&gt;unlock(); (gdb) s __gnu_cxx::__normal_iterator&lt;std::pair&lt;boost::condition_variable*, boost::mutex* &gt;*, std::vector&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt;, std::alloc ator&lt;std::pair&lt;boost::condition_variable*, boost::mutex*&gt; &gt; &gt; &gt;::operator-&gt; (this=0x22fc5c) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/ stl_iterator.h:743 743 { return _M_current; } (gdb) p _M_current $4 = (std::pair&lt;boost::condition_variable*, boost::mutex*&gt; *) 0x0 (gdb) s Program received signal SIGSEGV, Segmentation fault. 0x67e81517 in boost::detail::thread_data_base::~thread_data_base ( this=0x243330, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:45 45 i-&gt;second-&gt;unlock(); </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 19 Sep 2013 18:17:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:20 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:20</guid> <description> <p> How is it thet notify.begin() doesn't return notify.end()? Could you step through it? </p> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Thu, 19 Sep 2013 20:45:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:21 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:21</guid> <description> <p> Well, I tried stepping, but it was not feasible for me. </p> <p> Anyway, I tried to "watch" notify variable, and something weird happens even before the thread is created and launched: </p> <pre class="wiki">Breakpoint 1 at 0x40b6bc: file C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_data.hpp, line 123. Starting program: C:\Users\Tony\Downloads\boost_1_54_0\test.exe [New Thread 3940.0xb20] Breakpoint 1, boost::detail::thread_data_base::thread_data_base ( this=0x7748d8) at C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_data.hpp:123 123 , interruption_enabled(true) $1 = std::vector of length 0, capacity 0 Watchpoint 2: notify $2 = std::vector of length 0, capacity 0 Continuing. Watchpoint 2: notify Old value = std::vector of length 0, capacity 0 New value = Cannot access memory at address 0x0 #0 0x00407e4c in __gnu_debug::_Safe_sequence_base::_Safe_sequence_base ( this=0x774900) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/safe_base.h:192 #1 0x00407db3 in __gnu_debug::_Safe_sequence&lt;std::__debug::map&lt;void const*, boost::detail::tss_data_node, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt; &gt;::_Safe_sequence ( this=0x774900) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/safe_sequence.h:111 #2 0x00410754 in std::__debug::map&lt;void const*, boost::detail::tss_data_node, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::map (this=0x7748e8, __comp=..., __a=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/map.h:77 #3 0x0040b71b in _fu4___ZTVN5boost6detail16thread_data_baseE () at C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_data.hpp:123 #4 0x0040b483 in boost::detail::thread_data&lt;void (*)()&gt;::thread_data(void (*&amp;&amp;)()) (this=0x7748d8, f_=&lt;unknown type in C:\Users\Tony\Downloads\boost_1_54_0\test.exe, CU 0x0, DIE 0x4f591&gt;) at C:/x32-481-win32-sjlj-r2/include/boost/thread/detail/thread.hpp:98 #5 0x0040bc75 in boost::detail::heap_new&lt;boost::detail::thread_data&lt;void (*)()&gt;, void (*)()&gt;(void (*&amp;&amp;)()) ( a1=&lt;unknown type in C:\Users\Tony\Downloads\boost_1_54_0\test.exe, CU 0x0, DIE 0x4f591&gt;) at C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_heap_alloc.hpp:100 #6 0x0040c0b5 in boost::thread::make_thread_info (f=0x401637 &lt;myFunc()&gt;) at C:/x32-481-win32-sjlj-r2/include/boost/thread/detail/thread.hpp:220 #7 0x0040c229 in boost::thread::thread&lt;void (&amp;)()&gt; (this=0x28fe8c, f=@0x401637: {void (void)} 0x401637 &lt;myFunc()&gt;) at C:/x32-481-win32-sjlj-r2/include/boost/thread/detail/thread.hpp:265 #8 0x00401720 in main () at test.cpp:10 Continuing. Watchpoint 2: notify Old value = Cannot access memory at address 0x0 Continuing. Watchpoint 2: notify Old value = Cannot access memory at address 0x0 Continuing. Watchpoint 2 deleted because the program has left the block in which its expression is valid. Watchpoint 2 deleted because the program has left the block in which its expression is valid. Watchpoint 2 deleted because the program has left the block in which its expression is valid. 0x779cdd84 in ?? () Continuing. [New Thread 3940.0x700] Program received signal SIGSEGV, Segmentation fault. 0x67e81537 in boost::detail::thread_data_base::~thread_data_base ( this=0x7748d8, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:45 45 i-&gt;second-&gt;unlock(); Continuing. Program received signal SIGSEGV, Segmentation fault. 0x67e81537 in boost::detail::thread_data_base::~thread_data_base ( this=0x7748d8, __in_chrg=&lt;optimized out&gt;) at libs\thread\src\win32\thread.cpp:45 45 i-&gt;second-&gt;unlock(); A debugging session is active. Inferior 1 [process 3940] will be killed. </pre><p> Constructor thread_data_base::thread_data_base is called for the first time, and notify variable seems in a clean state. Then, it breaks again there, and now seems corrupted or something similar. Only after 3 "continue" the thread is created, sleep, and join, and SIGSEGV triggers. </p> <p> Can you provide some methods where I can set up breakpoints, and print "notify" values each time that they're triggered? </p> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Thu, 19 Sep 2013 21:08:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:22 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:22</guid> <description> <p> I also got stepping from "good" notify value to the first modification. Hope that it's useful. </p> <pre class="wiki">Breakpoint 1 at 0x40b6bc: file C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_data.hpp, line 123. Starting program: C:\Users\Tony\Downloads\boost_1_54_0\test.exe [New Thread 968.0xa20] Breakpoint 1, boost::detail::thread_data_base::thread_data_base ( this=0x7b48d8) at C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_data.hpp:123 123 , interruption_enabled(true) $1 = std::vector of length 0, capacity 0 $2 = (boost::detail::thread_data_base::notify_list_t *) 0x7b4904 Watchpoint 2: notify boost::detail::win32::handle_manager::handle_manager (this=0x7b48e0, handle_to_manage_=0xffffffff) at C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_primitives.hpp:281 281 handle_to_manage(handle_to_manage_) 282 {} std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;::allocator (this=0x28fcdc) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/allocator.h:113 113 allocator() throw() { } __gnu_cxx::new_allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;::new_allocator (this=0x28fcdc) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/ext/new_allocator.h:79 79 new_allocator() _GLIBCXX_USE_NOEXCEPT { } std::__debug::map&lt;void const*, boost::detail::tss_data_node, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::map (this=0x7b48e8, __comp=..., __a=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/map.h:77 77 : _Base(__comp, __a) { } std::__cxx1998::map&lt;void const*, boost::detail::tss_data_node, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::map (this=0x7b48e8, __comp=..., __a=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/stl_map.h:171 171 : _M_t(__comp, _Pair_alloc_type(__a)) { } std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;::allocator (this=0x28fc3f, __a=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/allocator.h:116 116 : __allocator_base&lt;_Tp&gt;(__a) { } __gnu_cxx::new_allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;::new_allocator (this=0x28fc3f) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/ext/new_allocator.h:81 81 new_allocator(const new_allocator&amp;) _GLIBCXX_USE_NOEXCEPT { } std::_Rb_tree&lt;void const*, std::pair&lt;void const* const, boost::detail::tss_data_node&gt;, std::_Select1st&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::_Rb_tree (this=0x7b48e8, __comp=..., __a=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/stl_tree.h:652 652 : _M_impl(__comp, _Node_allocator(__a)) { } std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; (this=0x28fbbf) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/allocator.h:119 119 allocator(const allocator&lt;_Tp1&gt;&amp;) throw() { } __gnu_cxx::new_allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::new_allocator (this=0x28fbbf) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/ext/new_allocator.h:79 79 new_allocator() _GLIBCXX_USE_NOEXCEPT { } std::_Rb_tree&lt;void const*, std::pair&lt;void const* const, boost::detail::tss_data_node&gt;, std::_Select1st&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::_Rb_tree_impl&lt;std::less&lt;void const*&gt;, true&gt;::_Rb_tree_impl(std::less&lt;void const*&gt; const&amp;, std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;&amp;&amp;) ( this=0x7b48e8, __comp=..., __a=&lt;unknown type in C:\Users\Tony\Downloads\boost_1_54_0\test.exe, CU 0x0, DIE 0x53da0&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/stl_tree.h:457 457 : _Node_allocator(std::move(__a)), _M_key_compare(__comp), std::move&lt;std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;&amp;&gt; (__t=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/move.h:102 102 { return static_cast&lt;typename std::remove_reference&lt;_Tp&gt;::type&amp;&amp;&gt;(__t); } std::_Rb_tree&lt;void const*, std::pair&lt;void const* const, boost::detail::tss_data_node&gt;, std::_Select1st&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::_Rb_tree_impl&lt;std::less&lt;void const*&gt;, true&gt;::_Rb_tree_impl(std::less&lt;void const*&gt; const&amp;, std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;&amp;&amp;) ( this=0x7b48e8, __comp=..., __a=&lt;unknown type in C:\Users\Tony\Downloads\boost_1_54_0\test.exe, CU 0x0, DIE 0x53da0&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/stl_tree.h:458 458 _M_header(), _M_node_count(0) std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::allocator (this=0x7b48e8, __a=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/allocator.h:116 116 : __allocator_base&lt;_Tp&gt;(__a) { } __gnu_cxx::new_allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::new_allocator (this=0x7b48e8) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/ext/new_allocator.h:81 81 new_allocator(const new_allocator&amp;) _GLIBCXX_USE_NOEXCEPT { } std::_Rb_tree&lt;void const*, std::pair&lt;void const* const, boost::detail::tss_data_node&gt;, std::_Select1st&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::_Rb_tree_impl&lt;std::less&lt;void const*&gt;, true&gt;::_Rb_tree_impl(std::less&lt;void const*&gt; const&amp;, std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;&amp;&amp;) ( this=0x7b48e8, __comp=..., __a=&lt;unknown type in C:\Users\Tony\Downloads\boost_1_54_0\test.exe, CU 0x0, DIE 0x53da0&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/stl_tree.h:459 459 { _M_initialize(); } std::_Rb_tree&lt;void const*, std::pair&lt;void const* const, boost::detail::tss_data_node&gt;, std::_Select1st&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::_Rb_tree_impl&lt;std::less&lt;void const*&gt;, true&gt;::_M_initialize (this=0x7b48e8) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/stl_tree.h:466 466 this-&gt;_M_header._M_color = _S_red; 467 this-&gt;_M_header._M_parent = 0; 468 this-&gt;_M_header._M_left = &amp;this-&gt;_M_header; 469 this-&gt;_M_header._M_right = &amp;this-&gt;_M_header; 470 } std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::~allocator (this=0x28fbbf, __in_chrg=&lt;optimized out&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/allocator.h:121 121 ~allocator() throw() { } __gnu_cxx::new_allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::~new_allocator (this=0x28fbbf, __in_chrg=&lt;optimized out&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/ext/new_allocator.h:86 86 ~new_allocator() _GLIBCXX_USE_NOEXCEPT { } std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;::~allocator (this=0x28fc3f, __in_chrg=&lt;optimized out&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/allocator.h:121 121 ~allocator() throw() { } __gnu_cxx::new_allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;::~new_allocator (this=0x28fc3f, __in_chrg=&lt;optimized out&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/ext/new_allocator.h:86 86 ~new_allocator() _GLIBCXX_USE_NOEXCEPT { } __gnu_debug::_Safe_sequence&lt;std::__debug::map&lt;void const*, boost::detail::tss_data_node, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt; &gt;::_Safe_sequence (this=0x7b4900) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/safe_sequence.h:111 111 class _Safe_sequence : public _Safe_sequence_base __gnu_debug::_Safe_sequence_base::_Safe_sequence_base (this=0x7b4900) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/safe_base.h:192 192 : _M_iterators(0), _M_const_iterators(0), _M_version(1) Watchpoint 2: notify Old value = std::vector of length 0, capacity 0 New value = Cannot access memory at address 0x0 A debugging session is active. Inferior 1 [process 968] will be killed. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 19 Sep 2013 21:48:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:23 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:23</guid> <description> <p> Could you dump the stack, just before notify is written? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 19 Sep 2013 22:04:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:24 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:24</guid> <description> <p> Please, could you send me the output of the example preprocessed? </p> <p> I wonder if you are not linking and compiling with the same Boost library? </p> <p> Shouldn't you build boost with _GLIBCXX_DEBUG defined? </p> <p> What is the size of boost::detail::thread_data_base on your program? </p> <p> And in a Boost.Thread test? </p> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Thu, 19 Sep 2013 22:17:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:25 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:25</guid> <description> <p> Here is the backtrace just before the "step" that will trigger the watch. But I don't think you'll get more info than the previous one I've already posted. </p> <p> If it's fine, I can setup a VPN for you, and you can connect to my PC and remotely debug the issue. Please contact me to the email address reported in the bug. </p> <pre class="wiki">Breakpoint 1 at 0x40b6bc: file C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_data.hpp, line 123. Starting program: C:\Users\Tony\Downloads\boost_1_54_0\test.exe [New Thread 2620.0x4e0] Breakpoint 1, boost::detail::thread_data_base::thread_data_base ( this=0x5248a0) at C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_data.hpp:123 123 , interruption_enabled(true) $1 = std::vector of length 0, capacity 0 Watchpoint 2: notify boost::detail::win32::handle_manager::handle_manager (this=0x5248a8, handle_to_manage_=0xffffffff) at C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_primitives.hpp:281 281 handle_to_manage(handle_to_manage_) 282 {} std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;::allocator (this=0x28fcdc) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/allocator.h:113 113 allocator() throw() { } __gnu_cxx::new_allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;::new_allocator (this=0x28fcdc) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/ext/new_allocator.h:79 79 new_allocator() _GLIBCXX_USE_NOEXCEPT { } std::__debug::map&lt;void const*, boost::detail::tss_data_node, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::map (this=0x5248b0, __comp=..., __a=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/map.h:77 77 : _Base(__comp, __a) { } std::__cxx1998::map&lt;void const*, boost::detail::tss_data_node, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::map (this=0x5248b0, __comp=..., __a=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/stl_map.h:171 171 : _M_t(__comp, _Pair_alloc_type(__a)) { } std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;::allocator (this=0x28fc3f, __a=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/allocator.h:116 116 : __allocator_base&lt;_Tp&gt;(__a) { } __gnu_cxx::new_allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;::new_allocator (this=0x28fc3f) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/ext/new_allocator.h:81 81 new_allocator(const new_allocator&amp;) _GLIBCXX_USE_NOEXCEPT { } std::_Rb_tree&lt;void const*, std::pair&lt;void const* const, boost::detail::tss_data_node&gt;, std::_Select1st&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::_Rb_tree (this=0x5248b0, __comp=..., __a=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/stl_tree.h:652 652 : _M_impl(__comp, _Node_allocator(__a)) { } std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; (this=0x28fbbf) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/allocator.h:119 119 allocator(const allocator&lt;_Tp1&gt;&amp;) throw() { } __gnu_cxx::new_allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::new_allocator (this=0x28fbbf) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/ext/new_allocator.h:79 79 new_allocator() _GLIBCXX_USE_NOEXCEPT { } std::_Rb_tree&lt;void const*, std::pair&lt;void const* const, boost::detail::tss_data_node&gt;, std::_Select1st&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::_Rb_tree_impl&lt;std::less&lt;void const*&gt;, true&gt;::_Rb_tree_impl(std::less&lt;void const*&gt; const&amp;, std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;&amp;&amp;) ( this=0x5248b0, __comp=..., __a=&lt;unknown type in C:\Users\Tony\Downloads\boost_1_54_0\test.exe, CU 0x0, DIE 0x53da0&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/stl_tree.h:457 457 : _Node_allocator(std::move(__a)), _M_key_compare(__comp), std::move&lt;std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;&amp;&gt; (__t=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/move.h:102 102 { return static_cast&lt;typename std::remove_reference&lt;_Tp&gt;::type&amp;&amp;&gt;(__t); } std::_Rb_tree&lt;void const*, std::pair&lt;void const* const, boost::detail::tss_data_node&gt;, std::_Select1st&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::_Rb_tree_impl&lt;std::less&lt;void const*&gt;, true&gt;::_Rb_tree_impl(std::less&lt;void const*&gt; const&amp;, std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;&amp;&amp;) ( this=0x5248b0, __comp=..., __a=&lt;unknown type in C:\Users\Tony\Downloads\boost_1_54_0\test.exe, CU 0x0, DIE 0x53da0&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/stl_tree.h:458 458 _M_header(), _M_node_count(0) std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::allocator (this=0x5248b0, __a=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/allocator.h:116 116 : __allocator_base&lt;_Tp&gt;(__a) { } __gnu_cxx::new_allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::new_allocator (this=0x5248b0) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/ext/new_allocator.h:81 81 new_allocator(const new_allocator&amp;) _GLIBCXX_USE_NOEXCEPT { } std::_Rb_tree&lt;void const*, std::pair&lt;void const* const, boost::detail::tss_data_node&gt;, std::_Select1st&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::_Rb_tree_impl&lt;std::less&lt;void const*&gt;, true&gt;::_Rb_tree_impl(std::less&lt;void const*&gt; const&amp;, std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;&amp;&amp;) ( this=0x5248b0, __comp=..., __a=&lt;unknown type in C:\Users\Tony\Downloads\boost_1_54_0\test.exe, CU 0x0, DIE 0x53da0&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/stl_tree.h:459 459 { _M_initialize(); } std::_Rb_tree&lt;void const*, std::pair&lt;void const* const, boost::detail::tss_data_node&gt;, std::_Select1st&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::_Rb_tree_impl&lt;std::less&lt;void const*&gt;, true&gt;::_M_initialize (this=0x5248b0) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/stl_tree.h:466 466 this-&gt;_M_header._M_color = _S_red; 467 this-&gt;_M_header._M_parent = 0; 468 this-&gt;_M_header._M_left = &amp;this-&gt;_M_header; 469 this-&gt;_M_header._M_right = &amp;this-&gt;_M_header; 470 } std::allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::~allocator (this=0x28fbbf, __in_chrg=&lt;optimized out&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/allocator.h:121 121 ~allocator() throw() { } __gnu_cxx::new_allocator&lt;std::_Rb_tree_node&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::~new_allocator (this=0x28fbbf, __in_chrg=&lt;optimized out&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/ext/new_allocator.h:86 86 ~new_allocator() _GLIBCXX_USE_NOEXCEPT { } std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;::~allocator (this=0x28fc3f, __in_chrg=&lt;optimized out&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/bits/allocator.h:121 121 ~allocator() throw() { } __gnu_cxx::new_allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt;::~new_allocator (this=0x28fc3f, __in_chrg=&lt;optimized out&gt;) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/ext/new_allocator.h:86 86 ~new_allocator() _GLIBCXX_USE_NOEXCEPT { } __gnu_debug::_Safe_sequence&lt;std::__debug::map&lt;void const*, boost::detail::tss_data_node, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt; &gt;::_Safe_sequence (this=0x5248c8) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/safe_sequence.h:111 111 class _Safe_sequence : public _Safe_sequence_base __gnu_debug::_Safe_sequence_base::_Safe_sequence_base (this=0x5248c8) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/safe_base.h:192 192 : _M_iterators(0), _M_const_iterators(0), _M_version(1) #0 __gnu_debug::_Safe_sequence_base::_Safe_sequence_base (this=0x5248c8) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/safe_base.h:192 #1 0x00407db3 in __gnu_debug::_Safe_sequence&lt;std::__debug::map&lt;void const*, boost::detail::tss_data_node, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt; &gt;::_Safe_sequence ( this=0x5248c8) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/safe_sequence.h:111 #2 0x00410754 in std::__debug::map&lt;void const*, boost::detail::tss_data_node, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::map (this=0x5248b0, __comp=..., __a=...) at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/map.h:77 #3 0x0040b71b in _fu4___ZTVN5boost6detail16thread_data_baseE () at C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_data.hpp:123 #4 0x0040b483 in boost::detail::thread_data&lt;void (*)()&gt;::thread_data(void (*&amp;&amp;)()) (this=0x5248a0, f_=&lt;unknown type in C:\Users\Tony\Downloads\boost_1_54_0\test.exe, CU 0x0, DIE 0x4f591&gt;) at C:/x32-481-win32-sjlj-r2/include/boost/thread/detail/thread.hpp:98 #5 0x0040bc75 in boost::detail::heap_new&lt;boost::detail::thread_data&lt;void (*)()&gt;, void (*)()&gt;(void (*&amp;&amp;)()) ( a1=&lt;unknown type in C:\Users\Tony\Downloads\boost_1_54_0\test.exe, CU 0x0, DIE 0x4f591&gt;) at C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_heap_alloc.hpp:100 #6 0x0040c0b5 in boost::thread::make_thread_info (f=0x401637 &lt;myFunc()&gt;) at C:/x32-481-win32-sjlj-r2/include/boost/thread/detail/thread.hpp:220 #7 0x0040c229 in boost::thread::thread&lt;void (&amp;)()&gt; (this=0x28fe8c, f=@0x401637: {void (void)} 0x401637 &lt;myFunc()&gt;) at C:/x32-481-win32-sjlj-r2/include/boost/thread/detail/thread.hpp:265 #8 0x00401720 in main () at test.cpp:10 /// here I perform the last "step" command Watchpoint 2: notify Old value = std::vector of length 0, capacity 0 New value = Cannot access memory at address 0x0 </pre> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Thu, 19 Sep 2013 22:31:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:26 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:26</guid> <description> <p> Sorry, my email is not visible here. </p> <p> Anyway, I'm not using _GLIBCXX_DEBUG when compiling boost. These are my instructions: </p> <pre class="wiki">bootstrap gcc b2 --prefix=my_mingw_root_dir --layout=tagged --without-python --without-mpi --without-context boost.locale.icu=off boost.locale.iconv=on toolset=gcc variant=release link=shared threading=multi runtime-link=shared cxxflags="-std=c++11 -std=gnu++11" install </pre><p> Of course, now I'm using debug variant, and I don't have any other boost version installed in my PC, so this is the only one that I can link with. </p> <p> I've created a preprocessed output of my test, you can download it here: <a class="ext-link" href="http://www.becrux.com/test.cpp.zip"><span class="icon">​</span>http://www.becrux.com/test.cpp.zip</a> </p> <p> About thread_data_size, I put a breakpoint at constructor, and "p sizeof(*this)" returns 76. </p> <p> What do you mean about "Boost.Thread test"? </p> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Thu, 19 Sep 2013 22:32:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:27 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:27</guid> <description> <p> Moreover, I don't know if I need to use _GLIBCXX_DEBUG even when building Boost. What I can say is that I've never used it with version &lt;= 1.51.0, and it always worked fine. </p> <p> Maybe I've always been lucky :) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 20 Sep 2013 06:25:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:28 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:28</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7666#comment:26" title="Comment 26">Antonio Di Monaco &lt;tony@…&gt;</a>: </p> <blockquote class="citation"> <p> Sorry, my email is not visible here. </p> <p> Anyway, I'm not using _GLIBCXX_DEBUG when compiling boost. These are my instructions: </p> <pre class="wiki">bootstrap gcc b2 --prefix=my_mingw_root_dir --layout=tagged --without-python --without-mpi --without-context boost.locale.icu=off boost.locale.iconv=on toolset=gcc variant=release link=shared threading=multi runtime-link=shared cxxflags="-std=c++11 -std=gnu++11" install </pre><p> Of course, now I'm using debug variant, and I don't have any other boost version installed in my PC, so this is the only one that I can link with. </p> <p> I've created a preprocessed output of my test, you can download it here: <a class="ext-link" href="http://www.becrux.com/test.cpp.zip"><span class="icon">​</span>http://www.becrux.com/test.cpp.zip</a> </p> <p> About thread_data_size, I put a breakpoint at constructor, and "p sizeof(*this)" returns 76. </p> <p> What do you mean about "Boost.Thread test"? </p> </blockquote> <p> I pretended you to go to libs/thread/test and do bjam, but I see that you have access. Anyway, my suspicion is that the size is different. Could you compile your application again without _GLIBCXX_DEBUG and see the sizeof boost::detail::thread_data_base. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 20 Sep 2013 06:33:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:29 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:29</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7666#comment:25" title="Comment 25">Antonio Di Monaco &lt;tony@…&gt;</a>: </p> <blockquote class="citation"> <p> Here is the backtrace just before the "step" that will trigger the watch. But I don't think you'll get more info than the previous one I've already posted. </p> <p> If it's fine, I can setup a VPN for you, and you can connect to my PC and remotely debug the issue. Please contact me to the email address reported in the bug. </p> </blockquote> <pre class="wiki">&gt; #0 __gnu_debug::_Safe_sequence_base::_Safe_sequence_base (this=0x5248c8) &gt; at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/safe_base.h:192 &gt; #1 0x00407db3 in __gnu_debug::_Safe_sequence&lt;std::__debug::map&lt;void const*, boost::detail::tss_data_node, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt; &gt;::_Safe_sequence ( &gt; this=0x5248c8) &gt; at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/safe_sequence.h:111 &gt; #2 0x00410754 in std::__debug::map&lt;void const*, boost::detail::tss_data_node, std::less&lt;void const*&gt;, std::allocator&lt;std::pair&lt;void const* const, boost::detail::tss_data_node&gt; &gt; &gt;::map (this=0x5248b0, __comp=..., __a=...) &gt; at c:/x32-481-win32-sjlj-r2/lib/gcc/i686-w64-mingw32/4.8.1/include/c++/debug/map.h:77 &gt; #3 0x0040b71b in _fu4___ZTVN5boost6detail16thread_data_baseE () &gt; at C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_data.hpp:123 &gt; #4 0x0040b483 in boost::detail::thread_data&lt;void (*)()&gt;::thread_data(void (*&amp;&amp;)()) (this=0x5248a0, &gt; f_=&lt;unknown type in C:\Users\Tony\Downloads\boost_1_54_0\test.exe, CU 0x0, DIE 0x4f591&gt;) &gt; at C:/x32-481-win32-sjlj-r2/include/boost/thread/detail/thread.hpp:98 &gt; #5 0x0040bc75 in boost::detail::heap_new&lt;boost::detail::thread_data&lt;void (*)()&gt;, void (*)()&gt;(void (*&amp;&amp;)()) ( &gt; a1=&lt;unknown type in C:\Users\Tony\Downloads\boost_1_54_0\test.exe, CU 0x0, DIE 0x4f591&gt;) &gt; at C:/x32-481-win32-sjlj-r2/include/boost/thread/win32/thread_heap_alloc.hpp:100 &gt; #6 0x0040c0b5 in boost::thread::make_thread_info (f=0x401637 &lt;myFunc()&gt;) &gt; at C:/x32-481-win32-sjlj-r2/include/boost/thread/detail/thread.hpp:220 &gt; #7 0x0040c229 in boost::thread::thread&lt;void (&amp;)()&gt; (this=0x28fe8c, &gt; f=@0x401637: {void (void)} 0x401637 &lt;myFunc()&gt;) &gt; at C:/x32-481-win32-sjlj-r2/include/boost/thread/detail/thread.hpp:265 &gt; #8 0x00401720 in main () at test.cpp:10 &gt; &gt; /// here I perform the last "step" command &gt; &gt; Watchpoint 2: notify &gt; &gt; Old value = std::vector of length 0, capacity 0 &gt; New value = Cannot access memory at address 0x0 </pre><p> This is confusing. Do you mean that the pb is now at the thread construction? I was expecting the backtrace of the second time notify is written. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 20 Sep 2013 06:34:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:30 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:30</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7666#comment:27" title="Comment 27">Antonio Di Monaco &lt;tony@…&gt;</a>: </p> <blockquote class="citation"> <p> Moreover, I don't know if I need to use _GLIBCXX_DEBUG even when building Boost. What I can say is that I've never used it with version &lt;= 1.51.0, and it always worked fine. </p> <p> Maybe I've always been lucky :) </p> </blockquote> <p> Are you sure you are compiling and linking with the same boost library? Sorry for the question, but I'm trying to cover all the possibilities. Note that I appreciate too much the time you are taking to try to trap this issue. </p> <p> Could you show your commands to build your example (compile and link)? </p> <p> where is the Boost library? </p> <p> where are the includes? </p> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Fri, 20 Sep 2013 07:52:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:31 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:31</guid> <description> <p> I think that it's better to recap all the thing we have until now. </p> <p> I have a clean Windows environment (no other toolchains like MSVC are present). </p> <p> I use <a class="missing wiki">MingwBuilds</a>, gcc 4.8.1, sjli, win32 thread. </p> <p> Everything is in one folder, C:\x32-481-win32-sjlj-<a class="changeset" href="https://svn.boost.org/trac10/changeset/2" title="Add Boost Disclaimer">r2</a>, so boost is in include\boost, and libraries are in C:\x32-481-win32-sjlj-<a class="changeset" href="https://svn.boost.org/trac10/changeset/2" title="Add Boost Disclaimer">r2</a>\lib. </p> <p> Anytime you asked me to apply a patch, I removed the whole dir include\boost and all libboost*.* present in C:\x32-481-win32-sjlj-<a class="changeset" href="https://svn.boost.org/trac10/changeset/2" title="Add Boost Disclaimer">r2</a>\lib, extracted the boost-1.54.0 sources, applied the patch and rebuilt everything with the two command reported above. So I'm sure that I'm compiling and linking only against one version of boost (and I also check for the date of files before building). </p> <p> I compile and link my test with the following command line: </p> <p> c++ -o test.exe -std=c++11 -std=gnu++11 -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -g -O0 -fno-inline -g3 -I"C:\x32-481-win32-sjlj-<a class="changeset" href="https://svn.boost.org/trac10/changeset/2" title="Add Boost Disclaimer">r2</a>\include" test.cpp -L"C:\x32-481-win32-sjlj-<a class="changeset" href="https://svn.boost.org/trac10/changeset/2" title="Add Boost Disclaimer">r2</a>\lib" -lboost_system-mt-d -lboost_thread-mt-d </p> <p> Until here, I don't have any doubt about the test environment I'm using. </p> <p> When test.exe is available, I run it with gdb, disabling hardware watchpoints, setting a breakpoint on boost::detail::thread_data_base::thread_data_base(), and run. </p> <p> When breakpoint triggers, notify variable seems fine, print command does not report any issue about its content. </p> <p> Then I add a watch on notify, and I start stepping. While stepping (it seems that something else is going to be constructed, but I can't understand what), notify watch triggers. </p> <p> Seems like a memory overrun. </p> <p> Anyway, I'll repeat the test again without -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC ASAP. </p> <p> My offer to let you connect to my VPN is still valid, just contact me at tony --@-- becrux -- dot -- com, and I'll try to setup a GCC environment where you can perform your tests. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 21 Sep 2013 20:49:18 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/7666#comment:32 https://svn.boost.org/trac10/ticket/7666#comment:32 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.55.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> Ticket Chris Kogelnik Mon, 23 Sep 2013 22:02:10 GMT <link>https://svn.boost.org/trac10/ticket/7666#comment:33 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:33</guid> <description> <p> I'm also seeing a Seg Fault on OS X 10.8 and boost 1.54 (and earlier) when issuing a thread.join(). A large project was previously working correctly until XCode was upgraded from 4 to 5. Reduced the case and traced it back to a compiler setting: </p> <blockquote> <p> -stdlib=libc++ causes the crash </p> </blockquote> <blockquote> <p> -stdlib=libstdc++ works fine </p> </blockquote> <p> The DEBUG flag had nothing to do with it in this case. </p> <p> Hope this helps your debugging. </p> <p> There is the example, thread.cpp: </p> <pre class="wiki">#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;boost/thread.hpp&gt; #include &lt;time.h&gt; #include &lt;unistd.h&gt; using namespace std; int loop = 1; void t1() { while (loop) { sleep(1); } printf("exiting\n"); fflush(stdout); } int main() { boost::thread t1_thread; t1_thread = boost::thread(t1); loop = 0; t1_thread.join(); } </pre><p> The Makefile: </p> <pre class="wiki">OPT_FAIL = -stdlib=libc++ OPT_PASS = -stdlib=libstdc++ thread: thread.cpp Makefile g++ -o thread thread.cpp -lboost_system -lboost_thread $(OPT_FAIL) </pre><p> And the stack trace: </p> <pre class="wiki">#0 boost::shared_ptr&lt;boost::detail::future_object_base&gt;::operator-&gt; () at /boost_1_54_0/boost/smart_ptr/shared_ptr.hpp:652 #1 0x00000001038788c0 in boost::detail::thread_data_base::~thread_data_base (this=0x7fddbb403aa0) at libs/thread/src/pthread/thread.cpp:47 #2 0x000000010384a235 in boost::detail::thread_data&lt;void (*)()&gt;::~thread_data () #3 0x00000001038493e5 in boost::detail::thread_data&lt;void (*)()&gt;::~thread_data () #4 0x0000000103849408 in boost::detail::thread_data&lt;void (*)()&gt;::~thread_data () #5 0x000000010384b62e in boost::checked_delete&lt;boost::detail::thread_data&lt;void (*)()&gt; &gt; () #6 0x000000010384b749 in boost::detail::sp_counted_impl_p&lt;boost::detail::thread_data&lt;void (*)()&gt; &gt;::dispose () #7 0x000000010387955d in boost::detail::atomic_exchange_and_add () at /boost_1_54_0/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:146 #8 0x000000010387955d in boost::detail::sp_counted_base::weak_release () at /boost_1_54_0/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:158 #9 0x000000010387955d in boost::detail::sp_counted_base::release () at sp_counted_base_gcc_x86.hpp:147 #10 0x000000010387955d in boost::detail::shared_count::~shared_count () at sp_counted_base_gcc_x86.hpp:371 #11 0x000000010387955d in boost::shared_ptr&lt;boost::detail::thread_data_base&gt;::~shared_ptr () at sp_counted_base_gcc_x86.hpp:370 #12 0x000000010387955d in boost::shared_ptr&lt;boost::detail::thread_data_base&gt;::~shared_ptr () at /boost_1_54_0/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:722 #13 0x000000010387955d in boost::thread::join_noexcept (this=&lt;value temporarily unavailable, due to optimizations&gt;) at sp_counted_base_gcc_x86.hpp:338 #14 0x0000000103847344 in boost::thread::join () #15 0x0000000103846688 in main () </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Chris Kogelnik</dc:creator> <pubDate>Mon, 23 Sep 2013 22:07:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:34 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:34</guid> <description> <p> Please note in the example above, 'int loop = 1;' should be a global defined prior to t1(). Editing code in a Wiki is poor form ;-) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 24 Sep 2013 17:25:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:35 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:35</guid> <description> <p> Whith which library was built Boost, -stdlib=libc++ or -stdlib=libstdc++ when the problem appear? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Chris Kogelnik</dc:creator> <pubDate>Tue, 24 Sep 2013 22:18:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:36 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:36</guid> <description> <p> Hi, sorry, this problem was an ABI incompatibility; the properly built library wasn't getting picked up. When both application and boost are compiled with the same stdlib there are no issues. </p> <p> Interestingly, the only problem encountered in the larger case, with the mixed library use, was on thread join (not saying others don't exist). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 26 Sep 2013 17:58:38 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:37 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:37</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7666#comment:36" title="Comment 36">Chris Kogelnik</a>: </p> <blockquote class="citation"> <p> Hi, sorry, this problem was an ABI incompatibility; the properly built library wasn't getting picked up. When both application and boost are compiled with the same stdlib there are no issues. </p> <p> Interestingly, the only problem encountered in the larger case, with the mixed library use, was on thread join (not saying others don't exist). </p> </blockquote> <p> Glad to see that there is no issue on Boost. I suspect that the GLIB issues is also related to an ABI incompatibility. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 26 Sep 2013 18:02:48 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7666#comment:38 https://svn.boost.org/trac10/ticket/7666#comment:38 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> I suspect that this is related to an ABI incompatibility. </p> Ticket Antonio Di Monaco <tony@…> Thu, 26 Sep 2013 21:22:25 GMT <link>https://svn.boost.org/trac10/ticket/7666#comment:39 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:39</guid> <description> <p> So? I didn't mix anything, and I still have the issue. GCC bug or what? </p> <p> On release notes, mingw 4.7.2 / 4.8.0 is reported as "tested", how can I use it with _GLIBCXX_DEBUG??? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 26 Sep 2013 22:10:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:40 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:40</guid> <description> <p> Have you tried to build Boost with _GLIBCXX_DEBUG? </p> </description> <category>Ticket</category> </item> <item> <author>Antonio Di Monaco <tony@…></author> <pubDate>Fri, 27 Sep 2013 22:51:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7666#comment:41 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7666#comment:41</guid> <description> <p> Yeah, confirmed. _GLIBCXX_DEBUG breaks ABI compatibility. </p> <p> Compiling Boost with _GLIBCXX_DEBUG solves the issue. Sorry for the noise. </p> </description> <category>Ticket</category> </item> </channel> </rss>