Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install valgrind 3.9.0 in centos 5.5

I am trying to install valgrind on my CentOS-5.5-32bit, to check for memory issue in my source. As i am very unfamiliar with Linux, I couldn't do it myself and couldn't find any such commands by searching also.

I downloaded an extracted valgrind 3.9.0 using these commands. But don't know how to install and run my source under valgrind.

wget http://valgrind.org/downloads/valgrind-3.9.0.tar.bz2
tar xvjf valgrind-3.9.0.tar.bz2

Thanks in advance for the help!

like image 905
Obaida.Opu Avatar asked Mar 19 '14 03:03

Obaida.Opu


1 Answers

After Several attempts, i finally got it working. The steps i followed:

wget http://valgrind.org/downloads/valgrind-3.9.0.tar.bz2  //download valgrind
tar xvjf valgrind-3.9.0.tar.bz2                            //now extract
cd valgrind-3.9.0                                          //move to the corresponding dir
./configure                                                //prepare everything
make
make install                                               //now install

Now I can Execute my target executable under valgrind!

To execute under valgrind use:

valgrind --tool=memcheck --leak-check=yes COMMAND_TO_RUN_MY_TARGET_EXECUTABLE

To Add origin information use:

--track-origins=yes

To save all the reports in a log file use:

--log-file="Valgrind_Report.txt"
like image 148
Obaida.Opu Avatar answered Oct 04 '22 20:10

Obaida.Opu