|
Bugzilla – Full Text Bug Listing |
| Summary: | PacketMetadata::~PacketMetadata() writes in freed memory | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Nicola Baldo <nicola> |
| Component: | network | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | mathieu.lacage |
| Priority: | P5 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
valgrind error log
proposed fix revised patch |
||
|
Description
Nicola Baldo
2012-02-05 13:15:50 UTC
Created attachment 1328 [details]
proposed fix
I found the problem. The reference count in PacketMetadata::Data is done with an uint16_t, which allows for a maxium 65535 references. The counter wraps around in my simulation scenario due to the fact that the same packet is transmitted to more than 90000 nodes.
I am attaching a proposed fix.
Good for me. +1 Mathieu, you're the maintainer of the network module, can you give me your +1 as well? if you change the size of this field, you need to change the size of the m_data array to be 8 so that the total size of struct Data is 16 bytes. If you do this, you need to be careful in PacketMetadata::Allocate for example: s/10/8/ Created attachment 1339 [details]
revised patch
here is a revised patch.
ack. please, apply (In reply to comment #5) > Created attachment 1339 [details] > revised patch > > here is a revised patch. changeset: 7748:1fbd1de4b24d tag: tip user: Nicola Baldo <nbaldo@cttc.es> date: Tue Feb 28 12:05:16 2012 +0100 summary: fixed bug 1358 |