Bug 362 - "Test for possibly unreachable code-- please file a bug report if this is ever hit"
"Test for possibly unreachable code-- please file a bug report if this is eve...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: internet
ns-3-dev
All All
: P3 normal
Assigned To: Tom Henderson
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-23 13:02 UTC by Gustavo J. A. M. Carneiro
Modified: 2008-10-31 00:58 UTC (History)
2 users (show)

See Also:


Attachments
gustavo's test case (1.46 KB, patch)
2008-10-27 12:45 UTC, Rajib Bhattacharjea
Details | Diff
patch to fix (1.17 KB, patch)
2008-10-29 00:40 UTC, Tom Henderson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo J. A. M. Carneiro 2008-09-23 13:02:46 UTC
Guess what? :-)

#0  0x00007f54dbb08f62 in ns3::ArpL3Protocol::Lookup (this=0xe4c610, packet=@0x421e6ed0, destination={m_address = 167837953}, 
    device=@0x421e6ee0, cache=@0x421e6ec0, hardwareDestination=0x421e6fd0) at ../src/internet-stack/arp-l3-protocol.cc:224
224	              NS_FATAL_ERROR ("Test for possibly unreachable code-- please file a bug report if this is ever hit");

In my case, I have a wifi node sending a flow to an AP; after a while I drag the node out of wifi range, and then after a short time that error occurs.
Comment 1 Tom Henderson 2008-09-25 09:09:05 UTC
I think I see the problem-- I'll take this bug.
Comment 2 Tom Henderson 2008-10-24 13:50:14 UTC
Gustavo,
I've spent a couple of hours trying to reproduce this event, and no luck.  Can you easily provide a test program?

I think it is safe to uncomment that FATAL_ERROR as a workaround.  However, I'd like to understand how to get to that state in the code. 
Comment 3 Rajib Bhattacharjea 2008-10-27 12:45:38 UTC
Created attachment 282 [details]
gustavo's test case
Comment 4 Tom Henderson 2008-10-29 00:38:20 UTC
So, the reason this triggers in the wifi case, and not the csma case, is that what is going on in this example is a Wifi::LinkUp() event that triggers an ArpCache flush.  However, the WaitReplyTimer was left running, leading to the supposedly "unreachable" state.

The attached patch will cancel the WaitReplyTimer when an ArpCache is flushed.  The unreachable test can remain to see if we ever get another example.
Comment 5 Tom Henderson 2008-10-29 00:40:28 UTC
Created attachment 285 [details]
patch to fix
Comment 6 Gustavo J. A. M. Carneiro 2008-10-29 06:34:33 UTC
+1
Comment 7 Tom Henderson 2008-10-31 00:58:08 UTC
changeset 761f94afe2a2