Author Topic: How to Use Valgrind  (Read 12293 times)

Offline TuxD3v

  • Multiple posting newcomer
  • *
  • Posts: 12
How to Use Valgrind
« on: March 10, 2013, 08:14:15 pm »
Hi Guys,
i qant to run valgrind to check if i have memleaks..

When i run it from the menu Valgrind->Run MemCheck...

it gives me an error...

valgrind --version
execvp(valgrind, --version) failed with error 2!
valgrind --leak-check=yes --leak-check=full --track-origins=yes --show-reachable=yes --xml=yes "/media/MY_STUFF2/PROGRAMING/Practice/c++/first/bin/Debug/first"
execvp(valgrind, --leak-check=yes, --leak-check=full, --track-origins=yes, --show-reachable=yes, --xml=yes, /media/MY_STUFF2/PROGRAMING/Practice/c++/first/bin/Debug/first, ) failed with error 2!

Code::blocks make the fork, but when it run the exec fail...why??

I have to run any config first to run Valgring??

I am running the last Code::Blocls version , and Mint LMDE 64bits...in the plugins valgrins apeared with the status...instaled??!!

Thanks in Advance..

Ps-> i'am in a c++ project

regards

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to Use Valgrind
« Reply #1 on: March 10, 2013, 08:35:26 pm »
Do you have the valgrind-package of mint installed ?
The plugin is just a wrapper for the executable, that has to be installed, of course.

Offline TuxD3v

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: How to Use Valgrind
« Reply #2 on: March 11, 2013, 01:53:00 am »
OMG...  :o

Thanks Jens  ;)

Unfortunately, seems that the failure is my destiny...  >:(

is there any option to the linker to solve this problem??

valgrind --version
valgrind-3.7.0
valgrind  --leak-check=full --track-origins=yes --show-reachable=yes --xml=yes --xml-file=/media/MY_STUFF2/PROGRAMING/Practice/c++/first/ValgrindOut.xml "/media/MY_STUFF2/PROGRAMING/Practice/c++/first/bin/Debug/first"

valgrind:  Fatal error at startup: a function redirection
valgrind:  which is mandatory for this platform-tool combination
valgrind:  cannot be set up.  Details of the redirection are:
valgrind: 
valgrind:  A must-be-redirected function
valgrind:  whose name matches the pattern:      strlen
valgrind:  in an object with soname matching:   ld-linux-x86-64.so.2
valgrind:  was not found whilst processing
valgrind:  symbols from the object with soname: ld-linux-x86-64.so.2
valgrind: 
valgrind:  Possible fixes: (1, short term): install glibc's debuginfo
valgrind:  package on this machine.  (2, longer term): ask the packagers
valgrind:  for your Linux distribution to please in future ship a non-
valgrind:  stripped ld.so (or whatever the dynamic linker .so is called)
valgrind:  that exports the above-named function using the standard
valgrind:  calling conventions for this platform.  The package you need
valgrind:  to install for fix (1) is called
valgrind: 
valgrind:    On Debian, Ubuntu:                 libc6-dbg
valgrind:    On SuSE, openSuSE, Fedora, RHEL:   glibc-debuginfo
valgrind: 
valgrind:  Cannot continue -- exiting now.  Sorry.

I don  have this package in the repos of mint LMDE... : libc6-dbg

Does any one know how to solve this problem?

Thanks in advance for the help

regards

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to Use Valgrind
« Reply #3 on: March 11, 2013, 06:25:13 am »
Try to find the package containing the debug-symbols for ld-linux-x86-64.so.2 on http://packages.linuxmint.com/ for your mint-installation or ask the mint maintainers.

Offline TuxD3v

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: How to Use Valgrind
« Reply #4 on: March 12, 2013, 01:28:41 am »
thanks Jens,

The guys in Mint LMDE can  help...i have all the packages installed...

Can you guys  confirm if everithing goes well with you??

I mean, if you can run Valgrind with code blocks?I'm sorry for the trouble....

thanks in advance...i don  know what to do more...  >:(

regards

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: How to Use Valgrind
« Reply #5 on: March 12, 2013, 01:36:27 am »
Can you guys  confirm if everithing goes well with you??
Valgrind works fine (very slow, but fine) launched from Code::Blocks for me on Ubuntu LTS.

Offline TuxD3v

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: How to Use Valgrind
« Reply #6 on: March 12, 2013, 04:56:52 am »

[/quote]
Valgrind works fine (very slow, but fine) launched from Code::Blocks for me on Ubuntu LTS.
[/quote]

thanks for the reply...i think I'm closest to have an Hard atack(i have removed a librarie that almost destroyed my usability and the chance to get my OS back... >:() )

Can you please do a :

apt policy libc6-dbg

and a:

dpkg -l | grep -i binutils

and a :

dpkg -l | grep- i libc6


And Post the results here ?PLEASE ...

sorry for the trouble...i don't  know how to run Valgrind in Mint LMDE...the error seems to be related with the gnu linker...but right now my head is to mutch hot, and tired, and I can't figure it out.... ???

A BIG Thanks in advance...

regards

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: How to Use Valgrind
« Reply #7 on: March 12, 2013, 08:59:14 pm »
apt policy libc6-dbg
Code
No command 'apt' found, did you mean: [...]

dpkg -l | grep -i binutils
Code
ii  binutils                               2.22-6ubuntu1                                       GNU assembler, linker and binary utilities
ii  binutils-mingw-w64-i686                2.22-2ubuntu1+1                                     Cross-binutils for Win32 (x86) using MinGW-w64
ii  binutils-mingw-w64-x86-64              2.22-2ubuntu1+1                                     Cross-binutils for Win64 (x64) using MinGW-w64

dpkg -l | grep -i libc6
Code
ii  libc6                                  2.15-0ubuntu10.3                                    Embedded GNU C Library: Shared libraries
ii  libc6-dbg                              2.15-0ubuntu10.3                                    Embedded GNU C Library: detached debugging symbols
ii  libc6-dev                              2.15-0ubuntu10.3                                    Embedded GNU C Library: Development Libraries and Header Files

Offline TuxD3v

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: How to Use Valgrind
« Reply #8 on: March 13, 2013, 06:40:26 pm »
Thanks Alpha for the help ;)

I stated that the problem doesn't came from Code::Blocks...but instead from a conflict with my libraries...i have enabled multiarch, and now i have a conflict in i386 and amd64 libraries...

I have, more or less,(debian packages) the same versions you have...

Thanks for the Help ;)

regards
« Last Edit: March 13, 2013, 06:44:44 pm by TuxD3v »