Bug 78 - OLSR & ascii tracing triggers assertion: packet-metadata.cc, line=1043, cond="GetTotalSize () == data.GetSize ()"
OLSR & ascii tracing triggers assertion: packet-metadata.cc, line=1043, cond=...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: core
pre-release
All All
: P1 major
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-24 06:48 UTC by Gustavo J. A. M. Carneiro
Modified: 2007-09-24 11:13 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo J. A. M. Carneiro 2007-09-24 06:48:23 UTC
1. clone http://code.nsnam.org/gjc/ns-3-olsr/
2. Go to examples/simple-point-to-point-olsr.cc, line 215, change #if 0 to #if 1 (to enable ascii tracing)
3. run the olsr example: NS_DEBUG=OlsrAgent waf --run simple-point-to-point-olsr

Result:

OLSR node 10.1.1.1 sending a OLSR packet
assert failed. file=../src/common/packet-metadata.cc, line=1043, cond="GetTotalSize () == data.GetSize ()"

It would be nice to not have to disable Ascii Tracing for OLSR...
Comment 1 Gustavo J. A. M. Carneiro 2007-09-24 10:48:40 UTC
It seems this bug in particular is caused by PacketMetadata::Enable () being called in the middle of a simulation, after the first packet was sent.  In my example I was starting the OLSR agents before enabling ascii tracing.

Explanation: the OLSR agent receives a packet, creates a subset of the packet, and later retransmits it to other nodes, it happens in this case that it receives a packet with no metadata, and tries to re-transmit it with new prepended headers, thereby triggering the assertion, because by then we have a packet with only partial metadata.

I'll try to come up with a patch to detect this particular case and give a clear error message explaining what to do (calling PacketMetadata::Enable () at the top solves this problem).
Comment 2 Gustavo J. A. M. Carneiro 2007-09-24 11:13:19 UTC
Committed http://code.nsnam.org/ns-3-dev/rev/648048bca501