Boost C++ Libraries: Ticket #3036: Segmentation fault at boost::asio https://svn.boost.org/trac10/ticket/3036 <p> We use the boost 1.33.1 version and we are upgrading the boost to 1.39.0. </p> <p> We use the boost to handle the network connection in our software. Sometimes the program crashes, but we dont know exactly in what cases these are. When the program crashes, the result of the core analyses always the same: </p> <p> Program terminated with signal 11, Segmentation fault. </p> <p> <a class="missing ticket">#0</a> 0x081c19c5 in dispatch&lt;boost::asio::detail::binder2&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf6&lt;void, Ccdt_TcpHandler, INT16U, INT32U, INT32U, INT32U, Ccdt_TcpMessageWrite*, const boost::asio::error&amp;&gt;, boost::_bi::list7&lt;boost::_bi::value&lt;Ccdt_TcpHandler*&gt;, boost::_bi::value&lt;short unsigned int&gt;, boost::_bi::value&lt;long unsigned int&gt;, boost::_bi::value&lt;long unsigned int&gt;, boost::_bi::value&lt;long unsigned int&gt;, boost::_bi::value&lt;Ccdt_TcpMessageWrite*&gt;, boost::arg&lt;1&gt; &gt; &gt;, boost::asio::error, unsigned int&gt; &gt; ( </p> <blockquote> <p> this=0x1d, handler= </p> <blockquote> <p> {handler_ = {f_ = {f_ = 0x81a8f66 &lt;Ccdt_TcpHandler::handleWrite(unsigned short, unsigned long, unsigned long, unsigned long, Ccdt_TcpMessageWrite*, boost::asio::error const&amp;)&gt;}, l_ = {a1_ = {t_ = 0xb212dbb8}, a2_ = {t_ = 10024}, a3_ = {t_ = 78164}, a4_ = {t_ = 4}, a5_ = {t_ = 0}, a6_ = {t_ = 0xb1f15210}, a7_ = {&lt;No data fields&gt;}}}, arg1_ = {&lt;&gt; = {&lt;No data fields&gt;}, code_ = 125, what_ = {ptr = 0x0}}, arg2_ = 0}) at /usr/trading/Libs/Boost/Version1_33_1/include/boost/asio/impl/write.ipp:124 </p> </blockquote> </blockquote> <p> 124 /usr/trading/Libs/Boost/Version1_33_1/include/boost/asio/impl/write.ipp: No such file or directory. </p> <blockquote> <p> in /usr/trading/Libs/Boost/Version1_33_1/include/boost/asio/impl/write.ipp </p> </blockquote> <p> We dont know if we use the boost badly or it is a boost bug. We use the 1.33.1 version and we are upgrading the boost to 1.39.0. This problem is urgent for us and at least it would be good if we knew if the problem is in boost or in our program. Thank you for any information! </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3036 Trac 1.4.3 elod.biro@… Fri, 15 May 2009 10:04:06 GMT attachment set https://svn.boost.org/trac10/ticket/3036 https://svn.boost.org/trac10/ticket/3036 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">core.txt</span> </li> </ul> <p> crash core stack </p> Ticket Steven Watanabe Sun, 17 May 2009 14:35:38 GMT <link>https://svn.boost.org/trac10/ticket/3036#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3036#comment:1</guid> <description> <p> A few questions: </p> <ul><li>Is this after trying to upgrade to 1.39 or is the program that crashes strictly using 1.33.1? </li><li>What version of Asio are you using with 1.33.1? </li><li>What happened to boost/asio/impl/write.ipp? </li></ul> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 18 May 2009 09:09:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3036#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3036#comment:2</guid> <description> <p> We use version 1.33.1. </p> <p> We analysed the problem and now it seems that the problem is at our side. At async_write method (see below) we give the Ccdt_TcpHandler::handleWrite as Callback method. We are not absolutely sure, but the Ccdt_TcpHandler object is deleted before the boost uses Ccdt_TcpHandler::handleWrite as Callback method. </p> <p> If it is true, then we do not understand that in this case the crash has to happen in Ccdt_TcpHandler::handleWrite method, but according the core file the crash is in boost. </p> <p> Now we try to avoid the Ccdt_TcpHandler object deleting before Callback. </p> <p> boost::asio::async_write </p> <blockquote> <p> ( *<a class="missing wiki">TcpSocket</a>, boost::asio::buffer </p> <blockquote> <p> ( pMsg-&gt;data(), pMsg-&gt;length() ), </p> </blockquote> <p> boost::bind </p> <blockquote> <p> ( &amp;Ccdt_TcpHandler::handleWrite, this, ID, pMsg-&gt;id(), pMsg-&gt;command(), pMsg-&gt;info(), pMsg, boost::asio::placeholders::error ) </p> </blockquote> <p> ); </p> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Tue, 12 Jan 2010 22:21:59 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3036#comment:3 https://svn.boost.org/trac10/ticket/3036#comment:3 <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">invalid</span> </li> </ul> <p> Closing as OP said that problem was on their side. </p> Ticket