Closed jterrace closed 12 years ago
Author: PatrickHorn I suspect the problem is that I broke in the debugger between when a message was sent and when the response was received. When I hit cont, I suspect the order of actions was:
The solution is probably to keep a boolean in SentMessage::TimerHandler whether it was cancelled instead of looking at the boost::asio::error_code.
Have only encountered this bug once. Only likely to happen when messages are sent over the network.
Author: PatrickHorn Should be fixed in b7409b8. GIve it a try.
Author: PatrickHorn and why does trac keep closing bugs when they aren't marked as fixed yet
Author: danielrh I get a throw() in /home/daniel/sirikata/libcore/src/util/SentMessage.cpp:63 {{{ 48 void SentMessage::timedOut() { 49 RoutableMessageHeader msg; 50 if (this->header().has_destination_object()) { 51 msg.set_source_object(this->header().destination_object()); 52 } 53 if (this->header().has_destination_space()) { 54 msg.set_source_space(this->header().destination_space()); 55 } 56 msg.set_source_port(this->header().destination_port()); 57 msg.set_return_status(RoutableMessageHeader::TIMEOUT_FAILURE); 58 msg.set_reply_id(this->getId()); 59 this->mTimerHandle.reset(); 60 61 // Make sure this is on the same thread-- 62 // We can use mQueryTracker->sendMessage(msg) to send it via the same loop 63 this->mResponseCallback(this, msg, MemoryReference(NULL,0));//dies here 64 } }}}
at /home/daniel/sirikata/libcore/src/util/SentMessage.cpp:63
63 this->mResponseCallback(this, msg, MemoryReference(NULL,0));
{{{
e=@0xffdc9c98)
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/throw_exception.hpp:64
{first = 0x0, second = 0})
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/function/function_template.hpp:986
at /home/daniel/sirikata/libcore/src/util/SentMessage.cpp:63
(this=0x9402e70, p=0x94400b0)
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/bind/mem_fn_template.hpp:49
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/bind.hpp:232
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/bind/bind_template.hpp:20
function_obj_ptr=@0x9402e70)
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/function/function_template.hpp:152
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/function/function_template.hpp:989
error=@0xffdc9f28, wthis=@0xffdc9e84)
at /home/daniel/sirikata/libcore/src/network/IOServiceFactory.cpp:117
f=@0xffdc9f1c, a=@0xffdc9ec4)
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/bind.hpp:292
this=0xffdc9f1c, a1=@0xffdc9f28)
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/bind/bind_template.hpp:32
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/asio/detail/bind_handler.hpp:39
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/asio/handler_invoke_hook.hpp:63
context=0xffdc9f80)
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/asio/detail/handler_invoke_helpers.hpp:39
(function=@0xffdc9f80, this_handler=0xffdc9f80)
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/asio/detail/bind_handler.hpp:72
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/asio/detail/handler_invoke_helpers.hpp:39
base=0x92950f0)
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/asio/detail/handler_queue.hpp:192
this=0x92950f0)
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/asio/detail/handler_queue.hpp:39
this_idle_thread=0x0, ec=@0xffdca08c)
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/asio/detail/task_io_service.hpp:268
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/asio/detail/task_io_service.hpp:130
at /home/daniel/sirikata/dependencies/installed-boost/include/boost-1_37/boost/asio/impl/io_service.ipp:84
ios=0x82078a8)
at /home/daniel/sirikata/libcore/src/network/IOServiceFactory.cpp:63
}}}
Author: danielrh Fixed in c6096a23589c5bfc379d1a406c4ce5ab8309fc6b and bf728677436533e0d2b46cda2adbc3098c7aba2a Additional asserts in 6f81d687ffaf4e2798e9b120cc933b1617ee9b82 and 096ef251972a8d932201bac132d6c89e150e51de to verify usage is single threaded and proper
Happened soon after typing "cont" from gdb--I was in the debugger long enough to cause a timeout. The timedOut function calls the callback function of the parent SentMessage, which has been deleted by that time.