[asio] crash on io_service object destruction.

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 ?

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@gmail.com> schrieb im Newsbeitrag news:hafkfe$9rt$1@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 ?
participants (2)
-
Alexander Gutenev
-
Commander Pirx