From: JINMEI Tatuya Date: Thu, 9 May 2013 06:05:14 +0000 (-0700) Subject: [master] exit from SyncUDPServer::handleRead immediately if stopped. X-Git-Tag: bind10-1.2.0beta1-release~471 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89e0087450e73ea2336f56c0f7024f4741eaeba0;p=thirdparty%2Fkea.git [master] exit from SyncUDPServer::handleRead immediately if stopped. while not really correct, this seems to work as a workaround for the crash problem reported in #2946. okayed on jabber. --- diff --git a/src/lib/asiodns/sync_udp_server.cc b/src/lib/asiodns/sync_udp_server.cc index 9a066911a6..989484f4eb 100644 --- a/src/lib/asiodns/sync_udp_server.cc +++ b/src/lib/asiodns/sync_udp_server.cc @@ -75,6 +75,15 @@ SyncUDPServer::scheduleRead() { void SyncUDPServer::handleRead(const asio::error_code& ec, const size_t length) { + // If the server has been stopped, it could even have been destroyed + // by the time of this call. We'll solve this problem in #2946, but + // until then we exit as soon as possible without accessing any other + // invalidated fields (note that referencing stopped_ is also incorrect, + // but experiments showed it often keeps the original value in practice, + // so we live with it until the complete fix). + if (stopped_) { + return; + } if (ec) { using namespace asio::error; const asio::error_code::value_type err_val = ec.value();