Project

General

Profile

Actions

Bug #2493

closed

UnixStreamFace::processErrorCode invalid read when app with active FaceMonitor quits

Added by Junxiao Shi almost 10 years ago. Updated about 9 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Faces
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

NFD commit:0d6d036e4f0a504c856453788808794c122adfaf 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)
  3. wait 5~20 seconds
  4. console B: press CTRL+C

Actual: valgrind complains

==7938== Invalid read of size 8
==7938==    at 0x5DCA60: 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==    by 0x5DD9AE: nfd::StreamFace<boost::asio::local::stream_protocol, nfd::LocalFace>::processErrorCode(boost::system::error_code const&) (stream-face.hpp:215)
==7938==    by 0x5E0163: 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


Files

nohup.out (57.4 KB) nohup.out full valgrind log Junxiao Shi, 02/08/2015 12:22 PM
Actions

Also available in: Atom PDF