Project

General

Profile

Actions

Bug #2446

open

ndn-test: segfault in ndn::time::system_clock::now() called by L3Protocol::initializeManagement

Added by Junxiao Shi about 9 years ago. Updated over 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
tests
Target version:
-
Start date:
01/29/2015
Due date:
% Done:

0%

Estimated time:

Description

Environment: Ubuntu 12.04 64-bit with Boost 1.55

Scenario: ./waf --run ndn-test --command-template="gdb --args %s"

(gdb) run
Starting program: /home/shijunxiao/ns-3/build/src/ndnSIM/tests/ns3-dev-ndn-test-debug 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5ab5683 in ndn::time::system_clock::now () at ../src/util/time.cpp:52
52      return g_systemClock->getNow();
(gdb) p g_systemClock
$1 = {<std::__shared_ptr<ndn::time::CustomClock<ndn::time::system_clock>, (__gnu_cxx::_Lock_policy)2>> = {_M_ptr = 0x72af00, _M_refcount = {
      _M_pi = 0x72aee0}}, <No data fields>}
(gdb) p *(ndn::time::CustomClock<ndn::time::system_clock>*)0x72af00
$2 = {_vptr.CustomClock = 0x0}
(gdb) bt
#0  0x00007ffff5ab5683 in ndn::time::system_clock::now () at ../src/util/time.cpp:52
#1  0x00007ffff5849e03 in nfd::StatusServer::StatusServer (this=0x7398c0, face=..., forwarder=..., keyChain=...)
    at ../src/ndnSIM/NFD/daemon/mgmt/status-server.cpp:39
#2  0x00007ffff59befdc in std::_Sp_counted_ptr_inplace<nfd::StatusServer, std::allocator<nfd::StatusServer>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::shared_ptr<nfd::InternalFace>&, std::reference_wrapper<nfd::Forwarder>, std::reference_wrapper<ndn::KeyChain>&> (this=0x7398a0, __a=...)
    at /usr/include/c++/4.6/bits/shared_ptr_base.h:410
#3  0x00007ffff59bd67f in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<nfd::StatusServer, std::allocator<nfd::StatusServer>, std::shared_ptr<nfd::InternalFace>&, std::reference_wrapper<nfd::Forwarder>, std::reference_wrapper<ndn::KeyChain>&> (this=0x7fffffffd488, __a=...)
    at /usr/include/c++/4.6/bits/shared_ptr_base.h:518
#4  0x00007ffff59bc53d in std::__shared_ptr<nfd::StatusServer, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<nfd::StatusServer>, std::shared_ptr<nfd::InternalFace>&, std::reference_wrapper<nfd::Forwarder>, std::reference_wrapper<ndn::KeyChain>&> (this=0x7fffffffd480, __tag=..., __a=...)
    at /usr/include/c++/4.6/bits/shared_ptr_base.h:987
#5  0x00007ffff59bae3a in std::shared_ptr<nfd::StatusServer>::shared_ptr<std::allocator<nfd::StatusServer>, std::shared_ptr<nfd::InternalFace>&, std::reference_wrapper<nfd::Forwarder>, std::reference_wrapper<ndn::KeyChain>&> (this=0x7fffffffd480, __tag=..., __a=...) at /usr/include/c++/4.6/bits/shared_ptr.h:317
#6  0x00007ffff59b9106 in std::allocate_shared<nfd::StatusServer, std::allocator<nfd::StatusServer>, std::shared_ptr<nfd::InternalFace>&, std::reference_wrapper<nfd::Forwarder>, std::reference_wrapper<ndn::KeyChain>&>(std::allocator<nfd::StatusServer> const&, std::shared_ptr<nfd::InternalFace>&, std::reference_wrapper<nfd::Forwarder>&&, std::reference_wrapper<ndn::KeyChain>&) (__a=...) at /usr/include/c++/4.6/bits/shared_ptr.h:535
#7  0x00007ffff59b6ff0 in std::make_shared<nfd::StatusServer, std::shared_ptr<nfd::InternalFace>&, std::reference_wrapper<nfd::Forwarder>, std::reference_wrapper<ndn::KeyChain>&>(std::shared_ptr<nfd::InternalFace>&, std::reference_wrapper<nfd::Forwarder>&&, std::reference_wrapper<ndn::KeyChain>&) ()
    at /usr/include/c++/4.6/bits/shared_ptr.h:551
#8  0x00007ffff59b1ec3 in ns3::ndn::L3Protocol::initializeManagement (this=0x72b050) at ../src/ndnSIM/model/ndn-l3-protocol.cpp:233
#9  0x00007ffff59b194a in ns3::ndn::L3Protocol::initialize (this=0x72b050) at ../src/ndnSIM/model/ndn-l3-protocol.cpp:180
#10 0x00007ffff58d41fa in ns3::ndn::StackHelper::Install (this=0x7fffffffdc90, node=...) at ../src/ndnSIM/helper/ndn-stack-helper.cpp:156
#11 0x00007ffff58d3f0c in ns3::ndn::StackHelper::Install (this=0x7fffffffdc90, c=...) at ../src/ndnSIM/helper/ndn-stack-helper.cpp:129
#12 0x00007ffff58d3ff4 in ns3::ndn::StackHelper::InstallAll (this=0x7fffffffdc90) at ../src/ndnSIM/helper/ndn-stack-helper.cpp:137
#13 0x0000000000420b30 in ns3::Tester::run (this=0x7fffffffe240, argc=1, argv=0x7fffffffe378) at ../src/ndnSIM/tests/ndn-test.cpp:196
#14 0x00000000004219cb in main (argc=1, argv=0x7fffffffe378) at ../src/ndnSIM/tests/ndn-test.cpp:243

p *(ndn::time::CustomClock<ndn::time::system_clock>*)0x72af00 looks suspicious.

Actions #1

Updated by Junxiao Shi about 9 years ago

This failure occurs on the dev box for ndn-cxx-breaks, but it's working on TravisCI https://travis-ci.org/yoursunny/ndn-cxx-breaks/jobs/48787248

Actions #2

Updated by Spyros Mastorakis about 9 years ago

Junxiao thanks for the bug report and the update.

In general, many strange things happen on Ubuntu 12.04 (we also had problems with boost libraries and gcc).

I will try to reproduce the error and see what's going on.

Actions #3

Updated by Alex Afanasyev about 9 years ago

I don't know what could be causing this problem. Could be some interaction of linker, static variables, and static library. I suspect the problem will disappear after issue #2243 is closed.

Actions #4

Updated by Spyros Mastorakis over 8 years ago

Does this issue still exist?

Actions

Also available in: Atom PDF