• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2928
  • Last Modified:

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:
  • 4
1 Solution
The program you downloaded isn't the mtrace that you're after.  You downloaded this:


What you're after is the mtrace in glibc-utils.


ambuliAuthor Commented:
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:


which leads to:


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

 yum install glibc-utils

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now