Bugzilla – Bug 1096
PacketMetadata::Enable () always gets called
Last modified: 2014-11-14 17:27:04 EST
Created attachment 1062 [details] Simple program where PacketMetadata::Enable () gets called The method to enable gets called every time, even when writing a very simple program (see attachment). As I need the packet metadata system to be turned off due to bug #1072, I inserted a call to NS_FATAL_ERROR in packet-metadata.cc in the PacketMetadata::Enable () method. There I found that packet metadata gets enabled here: http://code.nsnam.org/ns-3-dev/file/63a8a4ed4054/src/test/ns3tcp/ns3tcp-loss-test-suite.cc#l435 When "Ns3TcpLossTestSuite ns3TcpLossTestSuite;" is executed, it calls the constructor, which in turn enables the packet metadata. My guess is that this should probably not be executed. Simply removing the line fixes this issue for me.
This is on ns-3-dev or ns-3.10? Because, as far as I can tell, in ns-3-dev unit tests are now in separate modules, which are not even linked by default, therefore in theory this bug should be already fixed in ns-3-dev...
I currently use a ns-3-dev snapshot from January (so actually it should be something like ns-3.10). I didn't check the current ns-3-dev branch, so it might be fixed there already as you said. Then I guess this bug may be closed. :-)
this may be related to 1192; am assigning to Mathieu
The patch in 1192 moves the Enable calls to the Setup phase of the test cases, so this would be fixed by that patch. BUT, as Gustavo said, in ns-3-dev tests are not linked into the core libraries. This bug should not happen at all in ns-3-dev.
this seems to have been fixed somewhere along the way, so marking it resolved.