[ndnSIM] SIGSEGV, Segmentation fault in boost::asio::io_service.

Anil Jangam anilj.mailing at gmail.com
Thu Mar 3 23:35:00 PST 2016


Hi,

The issue I believe pertains to the point #6 and #7 in this article.
http://ndnsim.net/2.1/guide-to-simulate-real-apps.html

Can you please elaborate how this code should be modified it to work? The
related code which uses the io_service is here:
https://github.com/named-data/NLSR/blob/master/nsync/sync-socket.cc#L74

Note that the reference to io_service is taken from the ndn::face object as
recommended in point #6.

   -

   ndn::Face::getIoService()
   <http://ndnsim.net/2.1/doxygen/classndn_1_1Face.html#a517205cc925595c1a194fed7a98ebfb5>
   should be used only to obtain a reference to
boost::asio::io_service. *Application
   MUST NOT use any methods of* boost::asio::io_service, *otherwise the
   simulation will crash.*

   ndn::Face face;...// Supported (the rewired Scheduler
implementation does not access io_service methods)Scheduler
scheduler(face.getIoService());
   // Not supported in ndnSIM and will result in
crashface.getIoService().stop();




Program received signal SIGSEGV, Segmentation fault.
0x00007ffff543ee86 in
boost::asio::io_service::post<std::_Bind<std::_Mem_fn<void
(Sync::SyncSocket::*)(std::shared_ptr<ndn::Data>, ndn::Name const&,
unsigned long, unsigned long)> (Sync::SyncSocket*,
std::shared_ptr<ndn::Data>, ndn::Name, unsigned long, unsigned long)>
>(std::_Bind<std::_Mem_fn<void
(Sync::SyncSocket::*)(std::shared_ptr<ndn::Data>, ndn::Name const&,
unsigned long, unsigned long)> (Sync::SyncSocket*,
std::shared_ptr<ndn::Data>, ndn::Name, unsigned long, unsigned long)>&&)
(this=0x0,
    handler=<unknown type in
/home/anilj1/sandbox/ndnSIM/ns-3/build/libns3-dev-ndnSIM-debug.so, CU
0x3714149, DIE 0x377548c>) at
/usr/include/boost/asio/impl/io_service.hpp:108
108      impl_.post(init.handler);
(gdb) bt
#0  0x00007ffff543ee86 in
boost::asio::io_service::post<std::_Bind<std::_Mem_fn<void
(Sync::SyncSocket::*)(std::shared_ptr<ndn::Data>, ndn::Name const&,
unsigned long, unsigned long)> (Sync::SyncSocket*,
std::shared_ptr<ndn::Data>, ndn::Name, unsigned long, unsigned long)>
>(std::_Bind<std::_Mem_fn<void
(Sync::SyncSocket::*)(std::shared_ptr<ndn::Data>, ndn::Name const&,
unsigned long, unsigned long)> (Sync::SyncSocket*,
std::shared_ptr<ndn::Data>, ndn::Name, unsigned long, unsigned long)>&&)
(this=0x0,
    handler=<unknown type in
/home/anilj1/sandbox/ndnSIM/ns-3/build/libns3-dev-ndnSIM-debug.so, CU
0x3714149, DIE 0x377548c>) at
/usr/include/boost/asio/impl/io_service.hpp:108
#1  0x00007ffff543d846 in Sync::SyncSocket::publishData (this=0x858fe8,
prefix=..., session=0, buf=0xb4ab48 "NoData", len=6, freshness=1000,
seq=122045907075183)
    at ../src/ndnSIM/NLSR/nsync/sync-socket.cc:75
#2  0x00007ffff5452a4a in nlsr::SyncLogicHandler::publishSyncUpdate
(this=0x855980, updatePrefix=..., seqNo=122045907075183) at
../src/ndnSIM/NLSR/src/communication/sync-logic-handler.cpp:298
#3  0x00007ffff5452689 in nlsr::SyncLogicHandler::publishRoutingUpdate
(this=0x855980) at
../src/ndnSIM/NLSR/src/communication/sync-logic-handler.cpp:279
#4  0x00007ffff547910d in nlsr::Lsdb::buildAndInstallOwnAdjLsa
(this=0x855830) at ../src/ndnSIM/NLSR/src/lsdb.cpp:604
#5  0x00007ffff5477b2b in nlsr::Lsdb::buildAdjLsa (this=0x855830) at
../src/ndnSIM/NLSR/src/lsdb.cpp:472
#6  0x00007ffff548a6b5 in std::_Mem_fn<void
(nlsr::Lsdb::*)()>::operator()<, void>(nlsr::Lsdb*) const (this=0x939680,
__object=0x855830) at /usr/include/c++/4.8/functional:601
#7  0x00007ffff548925a in std::_Bind<std::_Mem_fn<void (nlsr::Lsdb::*)()>
(nlsr::Lsdb*)>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>)
(this=0x939680,
    __args=<unknown type in
/home/anilj1/sandbox/ndnSIM/ns-3/build/libns3-dev-ndnSIM-debug.so, CU
0x3aa9a90, DIE 0x3b43cb4>) at /usr/include/c++/4.8/functional:1296
#8  0x00007ffff54874f4 in std::_Bind<std::_Mem_fn<void (nlsr::Lsdb::*)()>
(nlsr::Lsdb*)>::operator()<, void>() (this=0x939680) at
/usr/include/c++/4.8/functional:1355
#9  0x00007ffff5484f71 in std::_Function_handler<void (),
std::_Bind<std::_Mem_fn<void (nlsr::Lsdb::*)()> (nlsr::Lsdb*)>
>::_M_invoke(std::_Any_data const&) (__functor=...)
    at /usr/include/c++/4.8/functional:2071
#10 0x00007ffff51b09cc in std::function<void ()>::operator()() const
(this=0x84c430) at /usr/include/c++/4.8/functional:2471
#11 0x00007ffff5301a8f in ns3::EventImpl* ns3::MakeEvent<void
(std::function<void ()>::*)() const, std::function<void ()> >(void
(std::function<void ()>::*)() const, std::function<void
()>)::EventMemberImpl0::Notify() (this=0x84c420) at ./ns3/make-event.h:323
#12 0x00007fffedf8b861 in ns3::EventImpl::Invoke (this=0x84c420) at
../src/core/model/event-impl.cc:51
#13 0x00007fffedf90228 in ns3::DefaultSimulatorImpl::ProcessOneEvent
(this=0x750210) at ../src/core/model/default-simulator-impl.cc:149
#14 0x00007fffedf905a2 in ns3::DefaultSimulatorImpl::Run (this=0x750210) at
../src/core/model/default-simulator-impl.cc:202
#15 0x00007fffedf8c598 in ns3::Simulator::Run () at
../src/core/model/simulator.cc:204
#16 0x000000000041cbaf in ns3::main (argc=1, argv=0x7fffffffccf8) at
../src/ndnSIM/examples/ndn-nlsr-simple.cpp:86
#17 0x000000000041cd6e in main (argc=1, argv=0x7fffffffccf8) at
../src/ndnSIM/examples/ndn-nlsr-simple.cpp:97
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160303/e85a9d40/attachment.html>


More information about the ndnSIM mailing list