Bug #2493
Updated by Junxiao Shi almost 10 years ago
NFD commit:0d6d036e4f0a504c856453788808794c122adfaf commit:a788e25e70f5a210c0623942986155f283e55261 on Ubuntu 12.04 Snippet to reproduce: ``` // g++ --std=c++0x x.cpp `pkg-config --cflags --libs libndn-cxx` #include <ndn-cxx/management/nfd-face-monitor.hpp> int main() { ndn::Face face; ndn::nfd::FaceMonitor facemon(face); facemon.onNotification.connect(std::bind([]{})); facemon.start(); face.processEvents(); return 0; } ``` Steps to reproduce: 1. console A: `sudo valgrind nfd`, wait until initialization completes 2. console B: `./a.out` (the binary compiled from snippet above) `nrd` 3. wait 5~20 seconds 4. console B: press CTRL+C Actual: valgrind complains ``` ==7938== ==26684== Invalid read of size 8 ==7938== ==26684== at 0x5DCA60: 0x5CE10E: std::__shared_ptr<boost::asio::basic_stream_socket<boost::asio::local::stream_protocol, boost::asio::stream_socket_service<boost::asio::local::stream_protocol> >, (__gnu_cxx::_Lock_policy)2>::operator->() const (shared_ptr_base.h:945) ==7938== ==26684== by 0x5DD9AE: 0x5CEFBA: nfd::StreamFace<boost::asio::local::stream_protocol, nfd::LocalFace>::processErrorCode(boost::system::error_code const&) (stream-face.hpp:215) ==7938== ==26684== by 0x5E0163: 0x5D16BF: nfd::StreamFace<boost::asio::local::stream_protocol, nfd::LocalFace>::handleSend(boost::system::error_code const&, unsigned long) (stream-face.hpp:253) ``` Note: This error occurs only for the first time when `a.out` is terminated. If `a.out` is started again and then terminated, the error won't appear again. Expected: no such error