[Ns-bugs] [Bug 416] New: pcap traces not always closing cleanly at simulation end
code@nsnam.ece.gatech.edu
code at nsnam.ece.gatech.edu
Wed Nov 19 17:03:35 PST 2008
http://www.nsnam.org/bugzilla/show_bug.cgi?id=416
Summary: pcap traces not always closing cleanly at simulation end
Product: ns-3
Version: ns-3-dev
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P3
Component: helpers
AssignedTo: craigdo at ee.washington.edu
ReportedBy: tomh at tomh.org
CC: ns-bugs at isi.edu
Estimated Hours: 0.0
Created an attachment (id=308)
--> (http://www.nsnam.org/bugzilla/attachment.cgi?id=308)
start of a patch to fix this
I noticed some non-deterministic output in the pcap tracing while debugging
something else, and I tracked it down to the fact that the destructor for
PcapWriter is not being called in most cases, and the ofstream is not being
flushed and closed.
I saw some support in InternetStackHelper for scheduling a SimulatorDestroy()
event to cleanup and close these ofstreams. However, there are two problems
that I see with that particular support:
- it tries to cause the destructor to be invoked by zeroing the smart pointer,
but my testing suggests that this is not sufficient (hence I added an explicit
Close() method in the attached patch)
- it only covers the case when EnablePcapAll() has been selected, but not when
Pcap is enabled with finer granularity.
Attached is a start of a patch to try to fix this behavior, but it would need
to be extended to all NetDevices (esp. WifiNetDevice) and it would need to
cover all of the entry points into Pcap tracing (rather than just
EnablePcapAll()).
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the Ns-bugs
mailing list