I am trying to connect the trace source Rx in class Ipv4L3Protocol to the IPv4ReceivedPackets function, before starting the simulator as following:
However, when I run the simulator it aborts the simulation and reports the following error, from which it seems that the trace path I specified does not exist
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff74dabc3 in ns3::Callback<void, ns3::Ptr<ns3::Packet const>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoAssign (
this=0x7fffffffb640, other=...) at ./ns3/callback.h:1256
1256 NS_FATAL_ERROR ("Incompatible types. (feed to \"c++filt -t\" if needed)" << std::endl <<
(gdb) bt
#0 0x00007ffff74dabc3 in ns3::Callback<void, ns3::Ptr<ns3::Packet const>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoAssign (
this=0x7fffffffb640, other=...) at ./ns3/callback.h:1256
#1 0x00007ffff74d9196 in ns3::Callback<void, ns3::Ptr<ns3::Packet const>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::Assign (
this=0x7fffffffb640, other=...) at ./ns3/callback.h:1220
#2 0x00007ffff74d83f4 in ns3::TracedCallback<ns3::Ptr<ns3::Packet const>, ns3::Ptr<ns3::Ipv4>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::ConnectWithoutContext (
this=0x6b6c38, callback=...) at ./ns3/traced-callback.h:267
#3 0x00007ffff74c7b70 in ns3::Accessor::ConnectWithoutContext (this=0x684be0, obj=0x6b6b70, cb=...) at ./ns3/trace-source-accessor.h:148
#4 0x00007ffff50c9255 in ns3::ObjectBase::TraceConnectWithoutContext (this=0x6b6b70, name=..., cb=...) at ../src/core/model/object-base.cc:307
#5 0x00007ffff511b5e3 in ns3::Config::MatchContainer::ConnectWithoutContext (this=0x7fffffffb820, name=..., cb=...) at ../src/core/model/config.cc:123
#6 0x00007ffff5121963 in ns3::ConfigImpl::ConnectWithoutContext (this=0x7ffff53aa0a0, path=..., cb=...) at ../src/core/model/config.cc:557
#7 0x00007ffff5124191 in ns3::Config::ConnectWithoutContext (path=..., cb=...) at ../src/core/model/config.cc:736
I tried to connect the trace source after running the simulation by encapsulating the ConnectWithoutContext in a user function and schedule it after certain time (To have the Internet Stack Object Created) but I get the same result. So what is the source of the problem?
Thanks a lot.