How to use Valgrind to debug omnetpp

1,015 views
Skip to first unread message

felix4U

unread,
Mar 8, 2011, 6:35:17 AM3/8/11
to omnetpp
Hi OMNET-Community,

i discovered several memory leaks in my simulation and now i want to
use valgrind in order to find them.

I use the following command to start a memory check, however the
omnetpp.ini can´t be found:

valgrind --leak-check=yes ./out/gcc-release/src/inet -c
myconfiguration -r 0 -u Cmdenv


----> Output:

"
==22327== Memcheck, a memory error detector
==22327== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et
al.
==22327== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h
for copyright info
==22327== Command: ./out/gcc-release/src/inet -c myconfiguration -r 0 -
u Cmdenv
==22327==
OMNeT++ Discrete Event Simulation (C) 1992-2010 Andras Varga, OpenSim
Ltd.
Version: 4.1, build: 100611-4b63c38, edition: Academic Public License
-- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

<!> Error during startup: Cannot open ini file `omnetpp.ini'.

End.

...
...
"
Furthermore i want to mention that the omnetpp.ini - file isn`t in the
same folder than my inet-Executeable. It is different from this
example (http://groups.google.com/group/omnetpp/msg/1cdc08939d06e6c9).
How can i define the target of "myconfiguration"? -myconfiguration is
a configuration of the omnetpp.ini file. The "omnetpp.ini" is located
in the following directory: myinetmanet/scenarios/testscenario/
omnetpp.ini

Greetings,
Felix

Rudolf Hornig

unread,
Mar 8, 2011, 7:17:19 AM3/8/11
to omn...@googlegroups.com
If you do not provide the location of the omnetpp.ini explicity it is assumed to be in the current working directory. From your command line it seems that your current working dir is the root of the INET project which surely does not contain any omnetpp.ini file.

I suggest change to the directory where your omnetpp.ini is present and change the path to the inet executable accordingly.
Rudol

ps: as a side note, the 4.2b1 ide contains direct support for valgrind. (simulation should be started in the Profile As... menu)


--
You received this message because you are subscribed to the Google Groups "omnetpp" group.
To post to this group, send email to omn...@googlegroups.com.
To unsubscribe from this group, send email to omnetpp+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/omnetpp?hl=en.


felix8...@yahoo.de

unread,
Mar 8, 2011, 10:20:41 AM3/8/11
to omn...@googlegroups.com
Hi Rudolf,

Thank you for your hints.
I updated omnet to Version 4.2b1 and at the moment Valgrind does a great Job!

Hopefully i can find the errors...

Regards
Felix


From: Rudolf Hornig <rudolf...@gmail.com>;
To: <omn...@googlegroups.com>;
Subject: Re: [Omnetpp-l] How to use Valgrind to debug omnetpp
Sent: Tue, Mar 8, 2011 12:17:19 PM
Reply all
Reply to author
Forward
0 new messages