Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] crash on io_service object destruction.
From: Commander Pirx (CmdPirx_at_[hidden])
Date: 2009-10-12 06:55:01


Hi,

doesn't know your app, but it seems to me that there is a pending timer that
returns a little to late. If a timer is canceled it "returns" with error
code boost::asio::error::operation_aborted error code even if the scheduler
is already stopped. Cancel all your timers first and then stop the
scheduler.

Pirx!

"Alexander Gutenev" <gutenev_at_[hidden]> schrieb im Newsbeitrag
news:hafkfe$9rt$1_at_ger.gmane.org...
> Hi
>
> This is probably bug in my app, but I need an idea how to track it down.
>
> Seen on MSVC8, XP
>
> Occurs after io_service, which is processing many timers, sockets and
> posts in one thread is stopped from another thread. It is stopped fine,
> however it crashes on service object destruction at this line:
>
> // Delete the timer.
> void destroy()
> {
> destroy_func_(this); ////
> }
>
> destroy_func_ is often 0xfeeefeee, but sometimes it is 0x0 or any other
> value.
>
> Call stack is:
>
> boost::asio::detail::timer_queue<boost::asio::time_traits<boost::posix_time::ptime>
> >::timer_base::destroy() Line 211 + 0xe bytes C++
> boost::asio::detail::timer_queue<boost::asio::time_traits<boost::posix_time::ptime>
> >::destroy_timer_list(boost::asio::detail::timer_queue<boost::asio::time_traits<boost::posix_time::ptime>
> >::timer_base * & t=0x01acd090) Line 415 C++
> boost::asio::detail::timer_queue<boost::asio::time_traits<boost::posix_time::ptime>
> >::destroy_timers() Line 189 C++
> boost::asio::detail::win_iocp_io_service::shutdown_service() Line 148 +
> 0x2c bytes C++
> boost::asio::detail::service_registry::~service_registry() Line 75 + 0xf
> bytes C++
> boost::asio::detail::service_registry::`scalar deleting destructor'() +
> 0x2b bytes C++
> boost::asio::io_service::~io_service() Line 52 + 0x2e bytes C++
>
>
> Any ideas ?


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