Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] need help with timer crash please
From: bnv (bnv_at_[hidden])
Date: 2009-03-26 20:13:11


Igor R <boost.lists <at> gmail.com> writes:

> > I'm seeing two distinct crashes (gdb output below) on expiration of a
> > deadline timer, and could use some help identifying possible reasons.
> >
> > The timer has not been deleted. The timer expired once before and was later
> > rescheduled using expires_from_now() and async_wait(). The timer is only
> > accessed by threads in io_service::run(), and is protected by a mutex.
>
> If the crash occurs during the time-out handler invocation, then
> probably the handler is bound to a dead object or tries to access a
> dead object.

Hi Igor,

Thanks for the reply. However, I've confirmed that the
boost::asio::deadline_timer object still exists.

In examples I've found for repeating timers, that the timer is re-scheduled
within the handler itself. In my case, the timer is re-scheduled sometime after
the handler has run. I wonder if a timer cannot be re-used this way?

-Brian


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net