Link to home
Start Free TrialLog in
Avatar of ambuli
ambuliFlag for United States of America

asked on

How to use mtrace

Hi Experts,

It is in reference to one of my earlier posting about detecting memory leaks.  I tried to download mtrace from the location pointed in the web.  It had three files ( mtrace, mtrace.8, mtrace.Readme)
But, I included the header mycheck.h in my code and called mtrace( ) before a memory allocation.  Then I compiled and run the program.  There is a file with the following contents.
= Start
@ ./a.out:[0x80483ef] + 0x9afa378 0x4


But, I couldn't run the mtrace.


I changed the permission on the downloaded mtrace file and tried to execute it.

[ambuli@vader map]$ mtrace a.out test.txt
-bash: mtrace: command not found
[ambuli@vader map]$ ./mtrace a.out test.txt
mtrace: must be root


Could you please help me.

Old question:
https://www.experts-exchange.com/questions/22063970/How-to-use-mtrace-to-detect-memory-leaks.html
ASKER CERTIFIED SOLUTION
Avatar of clockwatcher
clockwatcher

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ambuli

ASKER

Thank you clockwatcher,

But, Can I install this on Centos linux?
If it has glibc then I would assume so.  A quick google check comes up with:

  http://rpm2html.osmirror.nl/CentOS-3.html

which leads to:

  http://rpm2html.osmirror.nl/centos/3.7/os/ia64/RedHat/RPMS/glibc-utils-2.3.2-95.39.ia64.html

So it appears that way.
Looked a little bit more at what CentOS is and:

 yum install glibc-utils