[Ns-bugs] [Bug 80] valgrind error when finalizing PacketMetadata
bugzilla-daemon@nsnam-www.ece.gatech.edu
bugzilla-daemon at nsnam-www.ece.gatech.edu
Thu Sep 27 10:12:44 PDT 2007
http://www.nsnam.org/bugzilla/show_bug.cgi?id=80
------- Comment #1 from gjcarneiro at gmail.com 2007-09-27 13:12 -------
OK, I think I understand the problem better now...
==14271== by 0x5086AD2: std::vector<ns3::PacketMetadata::Data*,
std::allocator<ns3::PacketMetadata::Data*>
>::push_back(ns3::PacketMetadata::Data* const&) (stl_vector.h:606)
==14271== by 0x5083892:
ns3::PacketMetadata::Recycle(ns3::PacketMetadata::Data*)
(packet-metadata.cc:655)
==14271== by 0x40959E: ns3::PacketMetadata::~PacketMetadata()
(packet-metadata.h:340)
==14271== by 0x409681: ns3::Packet::~Packet() (packet.h:75)
When the packet is destroyed, it tries to add the metadata chunk back to the
free list. But the free list vector has already been destroyed at that
point...
Now, any opinions on which is the best solution:
1. Add a boolean global variable telling when the free list has already been
destroyed;
2. Make the "static DataFreeList m_freeList;" member of PacketMetadata a
pointer, allocate it with new, never deallocate.
3. Other option?
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Ns-bugs
mailing list