Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5311: io_service::post/dispatch, io_service::stop, deadline_timer crashes
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-16 03:51:33
#5311: io_service::post/dispatch, io_service::stop, deadline_timer crashes
---------------------------------+------------------------------------------
Reporter: nfries88@⦠| Owner: chris_kohlhoff
Type: Bugs | Status: closed
Milestone: To Be Determined | Component: asio
Version: Boost 1.46.0 | Severity: Problem
Resolution: invalid | Keywords: asio, io_service, post, dispatch, stop, deadline_timer, crash
---------------------------------+------------------------------------------
Changes (by chris_kohlhoff):
* status: new => closed
* resolution: => invalid
Comment:
If you use a debugger you will probably see that the myservice pointer is
always null. Specifically, your Service class's constructor calls doWork()
which in turn calls io_service.run(). This means the constructor never
returns, and the myservice global is never set in runServer().
N.B. Even if you move the doWork() call out of the constructor, you will
still have a race condition in the initialisation of the myservice global.
Unrelated: if you stop your service in this way you will also leak the
Connection object that is created in Service::accept().
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5311#comment:3> 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:05 UTC