I don't understand.
I believe that Omnet sends copy of a message. But when i try to re-send a frame after a collision valgrind told me
==8743== Invalid read of size 4
==8743== at 0x805F189: CSMACAMacLayer::handleSendData() (CSMACAMacLayer.cc:244)
==8743== by 0x805FB66: CSMACAMacLayer::handleSelfMsg(cMessage*) (CSMACAMacLayer.cc:179)
==8743== by 0x406C96B: BasicLayer::handleMessage(cMessage*) (BasicLayer.cc:72)
==8743== by 0x41D0C5C: cSimulation::doOneEvent(cSimpleModule*) (in /home/marco/omnetpp/lib/libsim_std.so.3.3)
==8743== by 0x4179E0A: TCmdenvApp::simulate() (in /home/marco/omnetpp/lib/libcmdenv.so.3.3)
==8743== by 0x417A660: TCmdenvApp::run() (in /home/marco/omnetpp/lib/libcmdenv.so.3.3)
==8743== by 0x4161F38: main (in /home/marco/omnetpp/lib/libenvir.so.3.3)
==8743== Address 0x46E8B20 is 0 bytes inside a block of size 120 free'd
==8743== at 0x4021096: operator delete(void*) (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==8743== by 0x4058CA6: MacPkt::~MacPkt() (MacPkt_m.cc:87)
==8743== by 0x41E3D52: cMessage::~cMessage() (in /home/marco/omnetpp/lib/libsim_std.so.3.3)
==8743== by 0x40552EA: AirFrame::~AirFrame() (AirFrame_m.cc:88)
==8743== by 0x40E9BB6: SnrDecider::handleLowerMsg(AirFrame*, std::list<SnrListEntry, std::allocator<SnrListEntry> > const&) (SnrDecider.cc:63)
==8743== by 0x406B860: BasicDecider::handleMessage(cMessage*) (BasicDecider.cc:62)
==8743== by 0x41D0C5C: cSimulation::doOneEvent(cSimpleModule*) (in /home/marco/omnetpp/lib/libsim_std.so.3.3)
==8743== by 0x4179E0A: TCmdenvApp::simulate() (in /home/marco/omnetpp/lib/libcmdenv.so.3.3)
==8743== by 0x417A660: TCmdenvApp::run() (in /home/marco/omnetpp/lib/libcmdenv.so.3.3)
==8743== by 0x4161F38: main (in /home/marco/omnetpp/lib/libenvir.so.3.3)
Does the SnrEval delete a packet and when i try to re-send i catch a SegFault?
The line in handleSendData is where i try to do sendDown with te frame in te queue.
Do i have to write a SnrEval which doesn't delete frame if there is a collision or i have to save dup() of my packet in the queue?
And what about the copy of the frame?
Thanks
Marco
Enviado: martes, 27 de noviembre, 2007 9:38:00