DSRUU crash on "simple" scenario - double free exception

210 views
Skip to first unread message

Pierre LARRENIE

unread,
Jun 8, 2020, 11:32:32 AM6/8/20
to OMNeT++ Users
Dear All,

I am trying to carry out some comparisons between various MANETs protocols but I'm facing some problems with DSRUU.

When I try to use DSRUU protocol implementation from inetmanet I get the following error :

  • In the prompt (sometimes "double free or corruption" is mentionned): 
 <!> Error -- see /home/pierre/workspaces/omnet_workspace6/TestDsr/logs/DsrTest-#0.out for details for details double free or corruption (!prev)
  • In the log file:
<!> Error: chunk is nullptr -- in module (inet::inetmanet::DSRUU) TestNetwork.host[10].dsr (id=687), at t=7.010607295526s, event #5011



After seting up some gdb, I get further details :

Program received signal SIGSEGV, Segmentation fault.
...
#1  0x00007ffff6468087 in inet::inetmanet::DSRUU::dsr_pkt_free (this=0x555556ec9900, dp=0x555557148c90) at inet/routing/extras/dsr/dsr-uu/dsr-pkt.cc:234
...

The following entry is available in logs/gdb.txt folder using the gdb commands before invoking run command :
- set logging file ../logs/gdb.txt
- set logging on



Since I have not altered source code, I did not expect that it did not work on a "simple" example. So I'm suggesting that I'm doing something wrong.

It would be great if someone could help me. 
I have tried to reproduce a minimal example. Helpers could find the full logs files (including cmdenv logfile and gdb) in the "logs/" folder and a Makefile and some tasks in the makefrag for non-OMNET-IDE users.

Thank you in advance
Kind Regards
Pierre LARRENIE

TestDsr.zip

Alfonso Ariza Quintana

unread,
Jun 8, 2020, 12:14:35 PM6/8/20
to omn...@googlegroups.com


I have just uploaded a patch for the segmentation fault

 

 

 

Enviado desde Correo para Windows 10

 


De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Pierre LARRENIE <pierre....@gmail.com>
Enviado: Monday, June 8, 2020 5:32:32 PM
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: [Omnetpp-l] DSRUU crash on "simple" scenario - double free exception
 
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/92beb53c-2a01-4265-9d86-31380ee9ad69o%40googlegroups.com.

Pierre LARRENIE

unread,
Jun 9, 2020, 4:02:13 AM6/9/20
to OMNeT++ Users
Dear Sir Alfonso Ariza Quintana,

I would like to thank you for your responsiveness.

With the patch, I can now process to my simulation, and that's all I wanted. 

I want just mentionned that some troubles remains since simulation ends  with (only when exiting GUI using Qtenv or after the run using Cmdenv)  : double free or corruption (out). But that's ok because the simulation ran successfully.


Thank you Sir,
Kind Regards

PL
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.

Alfonso Ariza Quintana

unread,
Jun 9, 2020, 4:21:06 AM6/9/20
to OMNeT++ Users
I cannot reproduce the latest problem. I run the DsrTest network that you have sent but the simulation runs end ends without problems

Enviado: martes, 9 de junio de 2020 10:02
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: Re: [Omnetpp-l] DSRUU crash on "simple" scenario - double free exception
 
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/6864dbea-67ba-4665-8d41-67ab5e3b3628o%40googlegroups.com.

Pierre LARRENIE

unread,
Jun 9, 2020, 5:21:20 AM6/9/20
to OMNeT++ Users
Well I found the issue, that's my fault. I have downloaded the patch in another folder and adapted my makefrag.
But it seems that I missed to change some sys variable because renaming back my "inetmanet-4.x-dsr_fix" into "inetmanet-4.x" solves my problem...

I'm sincerely sorry for the inconvenience.

Thank you
Kind regards
PL

Alfonso Ariza Quintana

unread,
Jun 9, 2020, 5:31:40 AM6/9/20
to OMNeT++ Users
It doesn't matter, and thanks for your help, I cannot test all the code that I have included witht he years with the changes in inet-framework, it helps that people comment me the problems

Enviado: martes, 9 de junio de 2020 11:21
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/74572b12-beba-4036-83f5-cf7999234212o%40googlegroups.com.

Pierre LARRENIE

unread,
Jun 17, 2020, 9:13:48 AM6/17/20
to OMNeT++ Users
Hi,

After further review the proposed patched does not "resolve" the problem that occurs with DSRUU.
 
It's true that no longer fatal errors occur but when analizing the data it turned out to be that each DSR-UU packet is dropped, for instance (see logfile1) :
[INFO] (E#573) TestNetwork.host[15].wlan[0].mac: Received an erroneous frame from PHY, dropping it.

And it happened for each packet, for  inetmanet protocols (at least AODV-UU and DSR-UU are concerned [due to ManetRoutingBase ?]), and so examples with AODV-UU and DSR-UU doesn't work anymore too.

So I've tried to go back to the version that I've installed in march and try to apply the proposed patch (by commenting 2 lines in dsr-pkt.cc as done in commit 230429e3fc90179abe7877c5e27f8bd46c0dd8ff). But the problem is still there (see logfile2). However, the error raise no SIG and the stack is empty when debugging with gdb.


I suppose that the first issue is due to on going work on the inetmanet-4.x framework, and I sincerely hope that the second has been already solved by more recent commit and don't imply that the original problem is more difficult to patch...


PS: I had to truncate the output file in order to post it. Sorry for the incovenience.

Thank you,
Kind Regards,  
PL
logfile1__dsr-patched__truncated.out
logfile2__truncated.out

Alfonso Ariza Quintana

unread,
Jun 18, 2020, 3:54:34 AM6/18/20
to omn...@googlegroups.com

Usually is the frame has error of transmission, the physical layer using the S/N and the error model determine the probability of error of the packet and the packet is marked like erroneous, the mac layer receives the packet and delete it.

 

Probably, the distance between nodes are too much



Enviado: miércoles, 17 de junio de 2020 15:13
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/3f97af11-e16f-4645-8328-8b68900900c7o%40googlegroups.com.

Pierre LARRENIE

unread,
Jun 18, 2020, 6:03:48 AM6/18/20
to OMNeT++ Users
Dear Sir,

I understand, but that is indeed not the case, please find attached some minimal example where we can see the "problem".

As could see, the 3 "Simple" config (SimpleAodvUU, SimpleDsrUU, SimpleInetAodv), don't work properly.
But we can observe that the Aodv in Inet is working using inet (and not inetmanet). Does inetmanet add some changes to inet code that could explain this ? 

Thank you,
Kind Regards,
PL  

TestDsr2.zip

Alfonso Ariza Quintana

unread,
Jun 18, 2020, 6:53:46 AM6/18/20
to omn...@googlegroups.com
The files doesn't work with DSR, DSR doesn't work like an udp app


Enviado: jueves, 18 de junio de 2020 12:03
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/dbc93877-1184-4ee5-82a7-edf95f8526e4o%40googlegroups.com.

Alfonso Ariza Quintana

unread,
Jun 18, 2020, 7:05:30 AM6/18/20
to omn...@googlegroups.com
I cannot run the model, entries undefined, problems with the configuration,

De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Alfonso Ariza Quintana <aari...@hotmail.com>
Enviado: jueves, 18 de junio de 2020 12:53
Para: omn...@googlegroups.com <omn...@googlegroups.com>
Asunto: RE: [Omnetpp-l] DSRUU crash on "simple" scenario - double free exception
 

Alfonso Ariza Quintana

unread,
Jun 18, 2020, 8:08:05 AM6/18/20
to omn...@googlegroups.com
I have fixed a problem that I have included the last week with the bandwith in 802.11, but in the simpledsr example, the nodes aren't in the coverage area

De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Alfonso Ariza Quintana <aari...@hotmail.com>
Enviado: jueves, 18 de junio de 2020 13:05

Pierre LARRENIE

unread,
Jun 18, 2020, 9:44:49 AM6/18/20
to OMNeT++ Users
They are not at the begining but they are in indirect communication and then direct (scenario in the example directory).

I have first missreaded your last message and tried to give you directly an inemanet example that was not working.
Then I have pulled your very last commit and simulation is successfully ran without problems.


I would like to thank you for your answer and your reactivity. I think I can't imagine how it's difficult to develop and manage such big (useful) project.

Kind Regards
PL

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.

Alfonso Ariza Quintana

unread,
Jun 18, 2020, 11:06:49 AM6/18/20
to omn...@googlegroups.com
The last week I fixed a problem with the HT and VHT models and introduced other problem with the defualt model, the latest commit fixed the default model problem

Enviado: jueves, 18 de junio de 2020 15:44
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/b16642f6-20cc-4e31-bc8c-49d546e8e31eo%40googlegroups.com.

Pierre LARRENIE

unread,
Jun 23, 2020, 6:07:30 AM6/23/20
to OMNeT++ Users
Dear Sir,

I don't know if I should start a new "subject", because I'm still facing issue with DSRUU and get a "chunk is nullptr" error when running my "DsrTest" config when using the patch that we've talked last week (i.e. Dsr seg fault + ieee80211 bandwith) .

I've backtracked the issue, with "std::cerr" prompts (please find a record attached). Well, this is not a minimal example I am really able to determine why this particular thing happens (because this error is not raised with some example).

The issue happened during event #7144, host[10] has reached maximum retry and host[10].wlan[0].mac.dcf is dropping frame "ping3". ManetRoutingBase then receive a LinkBreak signal and etc. The error is located in line 980 of dsr-uu-omnetpp.cc during packetFailed() method call.

What I've identified is, that the "chunk is nullptr" is raised because dynamicPtrCast<DSRPkt> (networkHeader->dupShared()) is passed as argument in the insertDsrProtocolHeader. But Ipv4Header is a priori not a DSRPkt so the real argument passed is in fact a nullptr.*

Please notice, that similar behavior should happen too on line 1006


I hope that could help you to fix the thing. The file with (ugly) "backtrace prompt" are attached and a record of current terminal output (i.e. with backtrace) get by the usefull "script" linux command. The "backtrace prompt" is directly written in terminal (not in ide or logfile, whatever env is used). 

Kind Regards,
PL
backtrace_record.txt
dsr-uu-omnetpp.cc
DsrUuPktOmnet.cc
ManetRoutingBase.cc

Alfonso Ariza Quintana

unread,
Jun 23, 2020, 6:12:59 AM6/23/20
to omn...@googlegroups.com
I am going to check it, it is possible that the method could be erroneous, the structure of the packets from inet 3 to inet 4 has changed completly and the port could have errors

Enviado: martes, 23 de junio de 2020 12:07
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/45a5555b-358f-4fdb-9ced-dddbdb8be0feo%40googlegroups.com.

Alfonso Ariza Quintana

unread,
Jun 23, 2020, 9:35:00 AM6/23/20
to omn...@googlegroups.com
I have uploaded a patch for this problem, if you find other problem, please, report it.

INET Framework for the OMNeT++ discrete event simulator - aarizaq/inetmanet-4.x


De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Alfonso Ariza Quintana <aari...@hotmail.com>
Enviado: martes, 23 de junio de 2020 12:12

pierre....@gmail.com

unread,
Jun 24, 2020, 5:44:13 AM6/24/20
to OMNeT++ Users
Dear Sir,

I have done some testing, with various scenarios and it seems that the problem is fixed.

Thank you again for your responsiveness.

Kind Regards
PL 

Reply all
Reply to author
Forward
0 new messages