Simulation terminated with exit code: -1073740940

707 views
Skip to first unread message

Talib Abbas

unread,
Apr 5, 2017, 4:13:40 AM4/5/17
to OMNeT++ Users
I am getting this error on my laptop. I have tried installing latest version of omnet 5.1, I have tried installing Windows 10 (same error on Windows 7 as well). The thing is same code is working omnet 5.0 on windows 10 on my office PC. The work is being synchronized with google drive. I have checked paths and everything. This error occurs during middle of the simulation on both (omnet 5.0 and omnet 5.1) but I never got the error on my office PC.

Michael Kirsche

unread,
Apr 5, 2017, 4:49:54 AM4/5/17
to OMNeT++ Users
Are you using any framework? Which compiler did you use on your working installation, which on the "faulty" ones?
Did you try to debug your simulation to see where this error occurs?

Talib Abbas

unread,
Apr 5, 2017, 6:04:15 AM4/5/17
to OMNeT++ Users
Thanks for quick reply. I am not using any framework. I am just making a tic toc example with 8 nodes to request a route to a destination and it's reply. I am attaching my source file for your reference. I am using built-in functions in omnetpp without any framework
node.cc

Michael Kirsche

unread,
Apr 5, 2017, 7:22:03 AM4/5/17
to OMNeT++ Users
I cannot (and will not) debug a program based on a single file... either post the complete project with a specific error message
or
Debug your program (run it under the debugger) and see where the error occurs.
This way you either see directly what is wrong or people can give you better feedback.
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Talib Abbas

unread,
Apr 6, 2017, 1:16:26 PM4/6/17
to OMNeT++ Users
Sorry for that. I am attaching a complete project file with the post, Plz note that same code is working only on 1 pc (on which the code is written for the first time).
omnetpp.zip

Michael Kirsche

unread,
Apr 6, 2017, 6:25:33 PM4/6/17
to omn...@googlegroups.com
You have a segmentation fault because you try to access memory that was deleted beforehand.

The problem is the else case of the "if (ttmsg->getTreeId() != msgid)" statement.
You delete the ttmsg there ("delete ttmsg;"), but after the else statement, you still access the ttmsg ("msgid = ttmsg->getTreeId();").

You can either move the "msgid = ttmsg->getTreeId();" function somewhere else or omit the "delete ttmsg;" to avoid the segmentation fault.

I've added these comments into a slightly "cleaned up" version of your example, couldn't run it at first under OMNeT 4.6, had to create a new project.
anypathtest.zip

Talib Abbas

unread,
Apr 7, 2017, 3:31:00 AM4/7/17
to OMNeT++ Users


Dear Micheal,
Thank you very much, this solution solved my problem. I don't understand why it is not giving any error on my office PC, but anyhow at least I am now able to move forward...

Michael Kirsche

unread,
Apr 7, 2017, 3:53:12 AM4/7/17
to OMNeT++ Users
You're welcome.
Maybe you are using a different OMNeT setup/version, maybe this non-deterministic error does not occur or maybe something else.
Best advice for segmentation faults is usually to run Valgrind to find the memory leak.
Reply all
Reply to author
Forward
0 new messages