Bug 516 - Test for possibly unreachable code-- please file a bug report, with a test case, if this is ever hit
Test for possibly unreachable code-- please file a bug report, with a test ca...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: general
ns-3-dev
All All
: P5 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-02 22:42 UTC by Aaron Kelley
Modified: 2009-03-03 19:12 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Kelley 2009-03-02 22:42:50 UTC
Here's another "unreachable code" bug report.

I ran into this when running simulations to test what I'm working on in graduate school.  It's a peer-to-peer simulation, and it worked fine with a pretty simple network topology (a bunch of PointToPoint connections making a "star" type network) but I get an error when I made it a little more complex:

"Test for possibly unreachable code-- please file a bug report, with a test case, if this is ever hit"

No other information is given.  So here I am, filing a bug report.  Let me know what I can do to get it to produce more detailed information.


The simulation runs fine for a while and nothing different happens that should cause an error as far as I can tell.  So... I'm posting a snapshot of my code here if someone would like to check this out.
http://stuff.aaron-kelley.net/netcoding.tar.bz2

You should be able to extract this into the NS directory and just run it like
waf --run netcoding

Like I said, the simulation runs fine for a while and breaks with this error.  Takes about 10 minutes for me.

I have the same error with NS-3 3.2.1, 3.3, and the current dev snapshot.

Thanks!
Comment 1 Aaron Kelley 2009-03-02 23:55:16 UTC
Stack trace and some other output from gdb follows:

Test for possibly unreachable code-- please file a bug report, with a test case, if this is ever hit
[New Thread 47278614805232 (LWP 10892)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47278614805232 (LWP 10892)]
0x00002affe8aa7ff6 in ns3::ArpL3Protocol::Lookup (this=0x5bd9de0, packet=
      {m_ptr = 0x7fffc2560f80}, destination={m_address = 184548617}, device=
      {m_ptr = 0x7fffc2560f70}, cache={m_ptr = 0x7fffc2560f60}, 
    hardwareDestination=0x7fffc2560cd0)
    at ../src/internet-stack/arp-l3-protocol.cc:239
239                   NS_FATAL_ERROR ("Test for possibly unreachable code-- please file a bug report, with a test case, if this is ever hit");

(gdb) bt
#0  0x00002affe8aa7ff6 in ns3::ArpL3Protocol::Lookup (this=0x5bd9de0, packet=
      {m_ptr = 0x7fffc2560f80}, destination={m_address = 184548617}, device=
      {m_ptr = 0x7fffc2560f70}, cache={m_ptr = 0x7fffc2560f60}, 
    hardwareDestination=0x7fffc2560cd0)
    at ../src/internet-stack/arp-l3-protocol.cc:239
#1  0x00002affe8aa3a62 in ns3::ArpIpv4Interface::SendTo (this=0x5c0bf60, p=
      {m_ptr = 0x7fffc2561090}, dest={m_address = 184548617})
    at ../src/internet-stack/arp-ipv4-interface.cc:148
#2  0x00002affe8a65ad5 in ns3::Ipv4Interface::Send (this=0x5c0bf60, p=
      {m_ptr = 0x7fffc2561330}, dest={m_address = 184548617})
    at ../src/internet-stack/ipv4-interface.cc:169
#3  0x00002affe8a6b7bf in ns3::Ipv4L3Protocol::SendRealOut (this=0x5bd9e30, 
    found=true, route=@0x5c4d5d0, packet={m_ptr = 0x7fffc2561460}, 
    ipHeader=@0x7fffc2561ec0) at ../src/internet-stack/ipv4-l3-protocol.cc:754
#4  0x00002affe8a7ad6d in ns3::MemPtrCallbackImpl<ns3::Ipv4L3Protocol*, void (ns3::Ipv4L3Protocol::*)(bool, ns3::Ipv4Route const&, ns3::Ptr<ns3::Packet>, ns3::Ipv4Header const&), void, bool, ns3::Ipv4Route const&, ns3::Ptr<ns3::Packet>, ns3::Ipv4Header const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator() (this=0xdb14090, a1=true, a2=@0x5c4d5d0, a3=
      {m_ptr = 0x7fffc25614c0}, a4=@0x7fffc2561ec0) at debug/ns3/callback.h:245
#5  0x00002affe8a7adf9 in ns3::Callback<void, bool, ns3::Ipv4Route const&, ns3::Ptr<ns3::Packet>, ns3::Ipv4Header const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator() (this=0x7fffc25618b0, a1=true, 
    a2=@0x5c4d5d0, a3={m_ptr = 0x7fffc2561690}, a4=@0x7fffc2561ec0)
    at debug/ns3/callback.h:432
#6  0x00002affe8a862f3 in ns3::Ipv4GlobalRouting::RequestRoute (
    this=0x5c1ff30, ifIndex=3, ipHeader=@0x7fffc2561ec0, packet=
      {m_ptr = 0x7fffc25618c0}, routeReply=
          {<ns3::CallbackBase> = {m_impl = {m_ptr = 0x7fffc25618b0}}, <No data fields>}) at ../src/internet-stack/ipv4-global-routing.cc:235
#7  0x00002affe8a6dce5 in ns3::Ipv4L3Protocol::Lookup (this=0x5bd9e30, 
    ifIndex=3, ipHeader=@0x7fffc2561ec0, packet={m_ptr = 0x7fffc2561b60}, 
    routeReply=
          {<ns3::CallbackBase> = {m_impl = {m_ptr = 0x7fffc2561b40}}, <No data fields>}) at ../src/internet-stack/ipv4-l3-protocol.cc:264
#8  0x00002affe8a6e6ff in ns3::Ipv4L3Protocol::DoForward (this=0x5bd9e30, 
    ifIndex=3, packet={m_ptr = 0x7fffc2561ee0}, ipHeader=
      {<ns3::Header> = {<ns3::Chunk> = {<ns3::ObjectBase> = {_vptr.ObjectBase = 0x7fffc2561ec0}, <No data fields>}, <No data fields>}, m_calcChecksum = 224, m_payloadSize = 49750, m_identification = 32767, m_tos = 0, m_ttl = 0, m_protocol = 176, m_flags = 5, m_fragmentOffset = 2307, m_source = {m_address = 3}, m_destination = {m_address = 96312880}, m_checksum = 0, m_goodChecksum = false})
    at ../src/internet-stack/ipv4-l3-protocol.cc:869
#9  0x00002affe8a6f4cf in ns3::Ipv4L3Protocol::Forwarding (this=0x5bd9e30, 
    ifIndex=3, packet={m_ptr = 0x7fffc2562230}, ipHeader=@0x7fffc2561fa0, 
    device={m_ptr = 0x7fffc2562220})
    at ../src/internet-stack/ipv4-l3-protocol.cc:844
#10 0x00002affe8a6fdee in ns3::Ipv4L3Protocol::Receive (this=0x5bd9e30, device=
      {m_ptr = 0x7fffc2562310}, p={m_ptr = 0x7fffc2562300}, protocol=2048, 
    from=@0x7fffc2562980, to=@0x7fffc2562980, packetType=0)
    at ../src/internet-stack/ipv4-l3-protocol.cc:558
#11 0x00002affe8a7c5e9 in ns3::MemPtrCallbackImpl<ns3::Ipv4L3Protocol*, void (ns3::Ipv4L3Protocol::*)(ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType), void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::operator() (this=0x5c15ef0, a1=
      {m_ptr = 0x7fffc25623a0}, a2={m_ptr = 0x7fffc2562390}, a3=2048, 
    a4=@0x7fffc2562980, a5=@0x7fffc2562980, a6=0) at debug/ns3/callback.h:251
#12 0x00002affe8a20c71 in ns3::Callback<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::operator() (
    this=0x5c15f80, a1={m_ptr = 0x7fffc25624a0}, a2={m_ptr = 0x7fffc2562490}, 
    a3=2048, a4=@0x7fffc2562980, a5=@0x7fffc2562980, a6=0)
    at debug/ns3/callback.h:438
#13 0x00002affe8a1bf04 in ns3::Node::ReceiveFromDevice (this=0x5baa870, device=
      {m_ptr = 0x7fffc2562670}, packet={m_ptr = 0x7fffc2562660}, 
    protocol=2048, from=@0x7fffc2562980, to=@0x7fffc2562980, packetType=0, 
    promiscuous=false) at ../src/node/node.cc:261
#14 0x00002affe8a1c1c8 in ns3::Node::NonPromiscReceiveFromDevice (
    this=0x5baa870, device={m_ptr = 0x7fffc2562700}, packet=
      {m_ptr = 0x7fffc25626f0}, protocol=2048, from=@0x7fffc2562980)
    at ../src/node/node.cc:237
#15 0x00002affe8a20eae in ns3::MemPtrCallbackImpl<ns3::Node*, bool (ns3::Node::*)(ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&), bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator() (this=0x5bcc6f0, a1={m_ptr = 0x7fffc2562780}, a2=
      {m_ptr = 0x7fffc2562770}, a3=2048, a4=@0x7fffc2562980)
    at debug/ns3/callback.h:245
#16 0x00002affe8a534ea in ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator() (this=0x5bcc250, a1=
      {m_ptr = 0x7fffc25629b0}, a2={m_ptr = 0x7fffc25629a0}, a3=2048, 
    a4=@0x7fffc2562980) at debug/ns3/callback.h:432
#17 0x00002affe8af5186 in ns3::PointToPointNetDevice::Receive (this=0x5bcc1c0, 
    packet={m_ptr = 0x7fffc2562a70})
    at ../src/devices/point-to-point/point-to-point-net-device.cc:259
#18 0x00002affe8afb8e1 in Notify (this=0xba25f00) at debug/ns3/make-event.h:113
#19 0x00002affe899027b in ns3::EventImpl::Invoke (this=0xba25f00)
    at ../src/simulator/event-impl.cc:39
#20 0x00002affe89ab1c3 in ns3::DefaultSimulatorImpl::ProcessOneEvent (
    this=0x5ba9ef0) at ../src/simulator/default-simulator-impl.cc:120
#21 0x00002affe89ab20b in ns3::DefaultSimulatorImpl::Run (this=0x5ba9ef0)
    at ../src/simulator/default-simulator-impl.cc:150
#22 0x00002affe8997681 in ns3::Simulator::Run ()
    at ../src/simulator/simulator.cc:164
#23 0x0000000000430135 in main (argc=1, argv=0x7fffc25637e8)
    at ../scratch/netcoding/ns-main.cpp:179
Comment 2 Tom Henderson 2009-03-03 08:32:44 UTC
Aaron,
Thanks for a nice bug report.  I could not reproduce your error on our regression machine.  However, I just pushed a patch that has been lingering (bug 468) that probably is the same issue.  If you pull ns-3-dev now and can't repeat your error, then I will close this out.  If you still have the error with the current ns-3-dev, I'll have another look.
Comment 3 Aaron Kelley 2009-03-03 19:12:18 UTC
Thanks!  Looks fixed to me.