Re: [Boost-bugs] [Boost C++ Libraries] #3036: Segmentation fault at boost::asio

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3036: Segmentation fault at boost::asio
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-05-18 09:09:25


#3036: Segmentation fault at boost::asio
-----------------------------------------------+----------------------------
  Reporter: elod.biro_at_[hidden] | Owner: chris_kohlhoff
      Type: Bugs | Status: new
 Milestone: | Component: asio
   Version: Boost 1.34.0 | Severity: Problem
Resolution: | Keywords: segmentation fault boost::asio
-----------------------------------------------+----------------------------

Comment(by anonymous):

 We use version 1.33.1.

 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.

 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.

 Now we try to avoid the Ccdt_TcpHandler object deleting before Callback.


 boost::asio::async_write
   (
   *TcpSocket,
   boost::asio::buffer
     (
     pMsg->data(),
     pMsg->length()
     ),
   boost::bind
     (
     &Ccdt_TcpHandler::handleWrite,
     this,
     ID,
     pMsg->id(),
     pMsg->command(),
     pMsg->info(),
     pMsg,
     boost::asio::placeholders::error
     )
   );

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3036#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC