Simulation terminated with exit code: 139

4,620 views
Skip to first unread message

Anna

unread,
Apr 15, 2011, 1:25:25 AM4/15/11
to omnetpp
Hello!

I've been working on my project in OMNeT++ 4,1, everything is great...
except this error that bogles me:

Simulation terminated with exit code: 139.

I know, I know... It's been written about before. It appears in
different moments of the simulation, not all the time, but very often
lately, and exits the simulation. I have searched online for info on
it and I know it has to do with segmentation faults (memory problems,
right?), but I don't know how to fix it. I installed Valgrind and did
a memcheck with leak-check. There were 60 errors, but all of them came
from the C libraries. I have read in the Valgrind manual that such
errors are likely to appear and, of course, I have no business
changing the C library code.

I thought that maybe I have some mistakes when working with my
classes, not destroying objects when I'm done with them. Is it true
that I have to call the destructor myself, doesn't it jump in by
itself at the right time like in Java? Also, I did call the
destructors to see if this was the problem, but the exit code still
happens.

Can you give me some advice? I'm getting kind of stuck...

Thank you

Anna

unread,
Apr 15, 2011, 1:27:24 AM4/15/11
to omnetpp
I forgot to mention, I also tried to increase the Linux stack size to
256MB and set the total-stack parameter in my simulation to 200MB, but
it still doesn't work.

Karl Wessel

unread,
Apr 15, 2011, 2:27:40 AM4/15/11
to omn...@googlegroups.com
Hi,

Segmentation Fault means that your code tried to access an invalid
memory address, most times this comes from accessing an already deleted
pointer somewhere in your code.
The best tool to find the place where this happens is a debugger like
"gdb" under linux from the command line or the debugger from the omnet IDE.

Regards,
Karl

Enrico Orsini

unread,
Apr 15, 2011, 6:03:18 AM4/15/11
to omn...@googlegroups.com
I get this error every time i close a simulation. Even with the INET samples.
The simulation runs well then i stop and close it, when i ruturn to the IDE i see on the console "Simulation terminated with exit code: 139".
I'm running omnet on a 64bit linux pc.

ktn varma

unread,
Nov 27, 2012, 5:38:41 AM11/27/12
to omn...@googlegroups.com, wesse...@googlemail.com
Can anyone suggest some good tutorial on how to use the debugger from omnet++ ide.  I am unable to understand how to trace in which line of my code the segmentation fault is occuring.

alfonso ariza

unread,
Nov 27, 2012, 2:25:42 PM11/27/12
to omn...@googlegroups.com

--
--
Sent from the OMNeT++ mailing list. To configure your membership,
visit http://groups.google.com/group/omnetpp
 
 
 

ktn varma

unread,
Nov 28, 2012, 3:25:55 AM11/28/12
to omn...@googlegroups.com, aari...@hotmail.com
@alfonso ariza : Thank You for your help. I found the material very helpful.

Ameera Al-harthi

unread,
Apr 9, 2018, 9:19:09 PM4/9/18
to OMNeT++ Users
I ave same problem  *☹* Do you find the solution ?
Reply all
Reply to author
Forward
0 new messages