Boost C++ Libraries: Ticket #5542: Segmentation fold in boost/thread.hpp Linux -x86_64 https://svn.boost.org/trac10/ticket/5542 <p> Every time I<code>m trying to create new thread, I receve an Segmentation Fold. Even in the simplest examples founded in internet. Debugger in NetBeans has shown me, that this problem happends, while I</code>m trying to do start_thread() - method from thread class included in boost/thread.hpp - file. </p> <p> Computer specification: </p> <ul><li>procesor i7 720QM (I`ve seen some asm code) </li><li>linux mint 10 - Julia </li><li>kernel version 2.6.38.2 </li></ul><p> Compilation command: g++-4.5 -pthread -lboost_thread t1.cpp -o t1 </p> <p> Example code used: </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/thread.hpp&gt; class Worker { public: Worker() { // the thread is not-a-thread until we call start() } void start(int N) { std::cout &lt;&lt; "start\n"; m_Thread = boost::thread(&amp;Worker::processQueue, this, N); std::cout &lt;&lt; "started\n"; } void join() { m_Thread.join(); } void processQueue(unsigned N) { float ms = N * 1e3; boost::posix_time::milliseconds workTime(ms); std::cout &lt;&lt; "Worker: started, will work for " &lt;&lt; ms &lt;&lt; "ms" &lt;&lt; std::endl; // We're busy, honest! boost::this_thread::sleep(workTime); std::cout &lt;&lt; "Worker: completed" &lt;&lt; std::endl; } private: boost::thread m_Thread; }; int main(int argc, char* argv[]) { std::cout &lt;&lt; "main: startup" &lt;&lt; std::endl; Worker worker; std::cout &lt;&lt; "main: create worker" &lt;&lt; std::endl; worker.start(3); std::cout &lt;&lt; "main: waiting for thread" &lt;&lt; std::endl; worker.join(); std::cout &lt;&lt; "main: done" &lt;&lt; std::endl; return 0; } </pre><p> More included as files. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5542 Trac 1.4.3 One People <leonardo777@…> Fri, 13 May 2011 22:29:10 GMT attachment set https://svn.boost.org/trac10/ticket/5542 https://svn.boost.org/trac10/ticket/5542 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">t1.cpp</span> </li> </ul> <p> Another used example code </p> Ticket One People <leonardo777@…> Fri, 13 May 2011 22:29:24 GMT attachment set https://svn.boost.org/trac10/ticket/5542 https://svn.boost.org/trac10/ticket/5542 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">t5.cpp</span> </li> </ul> Ticket leonardo777@… Sat, 14 May 2011 15:47:49 GMT summary changed https://svn.boost.org/trac10/ticket/5542#comment:1 https://svn.boost.org/trac10/ticket/5542#comment:1 <ul> <li><strong>summary</strong> <span class="trac-field-old">Segmentation fold in boost/thread.hpp</span> → <span class="trac-field-new">Segmentation fold in boost/thread.hpp Linux -x86_64</span> </li> </ul> Ticket Branan Purvine-Riley <branan@…> Mon, 06 Jun 2011 20:45:14 GMT <link>https://svn.boost.org/trac10/ticket/5542#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5542#comment:2</guid> <description> <p> I'm having the same issue, and can confirm that this occurs even with the most trivial boost::thread program. </p> <pre class="wiki">#include &lt;boost/thread.hpp&gt; void run_thread() { return; } int main() { boost::thread t(run_thread); return 0; } </pre><p> And the backtrace (built in release mode with debug symbols, so I'm not sure how useful it is): </p> <pre class="wiki">#0 operator= (this=0x7fffffffd670) at ./boost/smart_ptr/shared_ptr.hpp:305 #1 boost::thread::start_thread (this=0x7fffffffd670) at libs/thread/src/pthread/thread.cpp:185 #2 0x00000000004025e2 in boost::thread::thread&lt;void (*)()&gt;(void (*)(), boost::disable_if&lt;boost::is_convertible&lt;void (*&amp;)(), boost::detail::thread_move_t&lt;void (*)()&gt; &gt;, boost::thread::dummy*&gt;::type) () #3 0x000000000040182a in main () </pre><p> Boost version is 1.6.1, built with gcc (Gentoo 4.4.5 p1.2, pie-0.4.5) 4.4.5 </p> </description> <category>Ticket</category> </item> <item> <author>Branan Purvine-Riley <branan@…></author> <pubDate>Mon, 06 Jun 2011 20:45:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5542#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5542#comment:3</guid> <description> <p> Whoops, that should be "Boost version 1.46.1", not 1.6.1 &gt;_&lt; </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 31 Dec 2011 17:45:47 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/5542#comment:4 https://svn.boost.org/trac10/ticket/5542#comment:4 <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> When I compile the attached examples (the 3) with bjam on the trunk everything is OK. Could you tell me if you are able to reproduce using the trunk? </p> Ticket viboes Sun, 12 Aug 2012 20:22:03 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5542#comment:5 https://svn.boost.org/trac10/ticket/5542#comment:5 <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> Closed as no answer. </p> Ticket