Boost C++ Libraries: Ticket #8508: Created thread segfaults when memory is scarce https://svn.boost.org/trac10/ticket/8508 <p> The following code will segfault in the created thread if memory is scarce: </p> <pre class="wiki">#include &lt;boost/thread/thread.hpp&gt; void thread_main() { } int main(void) { boost::thread t(thread_main); t.join(); } </pre><p> This was run in GDB with ulimit -v 150000 applied beforehand. You'll have to experiment with the exact value. </p> <p> GDB output: </p> <pre class="wiki">[Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". [New Thread 0x7ffff69d5700 (LWP 2913)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff69d5700 (LWP 2913)] 0x00007ffff7bd593e in boost::detail::get_once_per_thread_epoch() () from /usr/lib/libboost_thread.so.1.53.0 </pre><p> Backtrace: </p> <pre class="wiki">#0 0x00007ffff7bd593e in boost::detail::get_once_per_thread_epoch() () from /usr/lib/libboost_thread.so.1.53.0 #1 0x00007ffff7bcf3b2 in ?? () from /usr/lib/libboost_thread.so.1.53.0 #2 0x00007ffff7bcf689 in boost::detail::set_current_thread_data(boost::detail::thread_data_base*) () from /usr/lib/libboost_thread.so.1.53.0 #3 0x00007ffff7bcf9ff in ?? () from /usr/lib/libboost_thread.so.1.53.0 #4 0x00007ffff6be5dd2 in start_thread () from /usr/lib/libpthread.so.0 #5 0x00007ffff6edfced in clone () from /usr/lib/libc.so.6 </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8508 Trac 1.4.3 viboes Sun, 28 Apr 2013 13:33:21 GMT owner, status changed https://svn.boost.org/trac10/ticket/8508#comment:1 https://svn.boost.org/trac10/ticket/8508#comment:1 <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> <p> Please, could you try with trunk? </p> Ticket viboes Sun, 28 Apr 2013 14:20:32 GMT <link>https://svn.boost.org/trac10/ticket/8508#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8508#comment:2</guid> <description> <p> I suspect that I don't set the limit correctly. I have do </p> <pre class="wiki">ulimit -v 200 </pre><p> and no error is signaled on trunk. </p> <p> BTW, what -v do on your system. It set the virtual memory on mine. Could you send me the result of ulimit -a? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 21 May 2013 22:56:19 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8508#comment:3 https://svn.boost.org/trac10/ticket/8508#comment:3 <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">worksforme</span> </li> </ul> <p> If you don't help me I can not help you. </p> Ticket anonymous Mon, 12 Aug 2013 21:11:59 GMT <link>https://svn.boost.org/trac10/ticket/8508#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8508#comment:4</guid> <description> <p> Hello, </p> <p> I have encounter the same problem with: </p> <p> <em>ulimit -Sd 450000 -Sm 450000 -Sv 450000 ; gdb ./bin/a.out</em> </p> <p> Using boost lib 1.53.0 an CXX_FLAGS="-march=corei7 -O2 -pipe" </p> <pre class="wiki">Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff34f4700 (LWP 31454)] 0x00007ffff75363eb in boost::detail::get_once_per_thread_epoch() () from /usr/lib64/libboost_thread.so.1.53.0 (gdb) where #0 0x00007ffff75363eb in boost::detail::get_once_per_thread_epoch() () from /usr/lib64/libboost_thread.so.1.53.0 #1 0x00007ffff7534b48 in void boost::call_once&lt;void (*)()&gt;(boost::once_flag&amp;, void (*)()) () from /usr/lib64/libboost_thread.so.1.53.0 #2 0x00007ffff75310e7 in boost::detail::set_current_thread_data(boost::detail::thread_data_base*) () from /usr/lib64/libboost_thread.so.1.53.0 #3 0x00007ffff7531159 in ?? () from /usr/lib64/libboost_thread.so.1.53.0 #4 0x00007ffff59a2ec6 in start_thread () from /lib64/libpthread.so.0 #5 0x00007ffff5ca2dfd in clone () from /lib64/libc.so.6 </pre><p> Some advice or patch indication would be awesome. </p> <p> Regards, </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 12 Aug 2013 22:05:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8508#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8508#comment:5</guid> <description> <p> FYI not reproducible on this rev, getting well SIGABRT. </p> <p> <em> URL : <a class="ext-link" href="http://svn.boost.org/svn/boost/trunk"><span class="icon">​</span>http://svn.boost.org/svn/boost/trunk</a> Racine du dépôt : <a class="ext-link" href="http://svn.boost.org/svn/boost"><span class="icon">​</span>http://svn.boost.org/svn/boost</a> UUID du dépôt : b8fc166d-592f-0410-95f2-cb63ce0dd405 Révision : 85324</em> </p> </description> <category>Ticket</category> </item> </channel> </rss>