469,642 Members | 1,241 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,642 developers. It's quick & easy.

memory leak using mtrace to find

Hi,

I am using mtrace to check for memory leaks in my code. The code is
divided into many fucntion which are placed in different directories.
While using mtrace the following output is given. Now the problem is
to find where in the code and in which function memory leaks occurs as
the trace does not give line number or name of the function.
------------------------------------------------------------------
Memory not freed:
-----------------
Address Size Caller
0x0804a400 0xa4 at 0x400a3bf4
0x0804a6c8 0x18 at 0x4005ec28
0x0804a710 0x18 at 0x4005e7b8
0x0804a768 0x18 at 0x4005e7b8
0x0804a788 0xc at 0x4005d8d1
0x0804a8b8 0x18 at 0x4005d783
0x0804a990 0x18 at 0x4005ec28
0x0804ab08 0x18 at 0x4005ec28
0x0804ab28 0x18 at 0x4005d783
0x0804ab58 0xc at 0x4005d8d1
0x0804ac48 0x18 at 0x4005d82a
0x0804ad48 0x18 at 0x4005d783
0x0804ad78 0xc at 0x4005d8d1
0x0804ad98 0xc at 0x4005d8d1
0x0804aeb8 0x18 at 0x4005d82a
0x0804aed8 0x24 at 0x4005c31d
0x0804b2d0 0x7c at 0x400592f8
0x0804b3f0 0xc at 0x4005d8d1
0x0804b400 0xc at 0x4005d8d1
0x0804b770 0x18 at 0x4005d783
0x0804b8b8 0x24 at 0x4005c31d
0x0804b8e0 0x18 at 0x4005d82a
0x0804b960 0x18 at 0x4005ec28
0x0804b9b0 0x18 at 0x4005e7b8
0x0804b9d0 0x18 at 0x4005e7b8
0x0804b9f0 0x18 at 0x4005d783
0x0804ba10 0xc at 0x4005d8d1
0x0804ba50 0xc at 0x4005d8d1
0x0804cb48 0x18 at 0x4005e7b8
0x0804d6d8 0x24 at 0x4005c31d
0x0804e6a0 0x18 at 0x4005e7b8
0x0804f150 0x1f0 at 0x4005928b
0x0804f348 0xa4 at 0x4005c75a
0x0804f3f0 0x1210 at 0x4005cb81
0x08050608 0x190 at 0x4005d6ca
0x08050aa0 0x450 at 0x4005e35e
0x08050ef8 0x18 at 0x4005e7b8
0x08051018 0x1210 at 0x4005cdde
0x08052330 0x1210 at 0x4005d0ab
0x08053948 0xa4 at 0x4005c75a
0x080539f0 0x1210 at 0x4005cb81
0x08054c08 0x190 at 0x4005d6ca
0x08054da0 0x18 at 0x4005d82a
0x08054fc0 0x18 at 0x4005d783
0x08054fe0 0x18 at 0x4005d82a
----------------------------------------------------------

Any help will be deeply appreciated,

thanks
subir

Apr 7 '06 #1
3 2010
subirs opined:
Hi,

I am using mtrace to check for memory leaks in my code.
C knows not of `mtrace`...
The code is divided into many fucntion which are placed in different
directories.
"Show me the money!"
While using mtrace the following output is given. Now the problem is
to find where in the code and in which function memory leaks occurs
as the trace does not give line number or name of the function.
"Show me the money!"

<snip meaningless gibberish>
Any help will be deeply appreciated,


If you really are after help, help us help you by providing the actual
code reduced to minimal compilable example that exhibits the problem,
and as much real information as possible.

If you can't be bothered, I'll venture a guess: your problem is on line
42, column 21, of the file zaphod.c, in the directory whatsit on the
Z: drive. Replace 74 with 82, and you're done!

--
"sic transit discus mundi"
(From the System Administrator's Guide, by Lars Wirzenius)

<http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>

Apr 7 '06 #2
subirs wrote:
Hi,

I am using mtrace to check for memory leaks in my code. The code is
divided into many fucntion which are placed in different directories.
While using mtrace the following output is given. Now the problem is
to find where in the code and in which function memory leaks occurs as
the trace does not give line number or name of the function.
------------------------------------------------------------------
Memory not freed:
-----------------
Address Size Caller
0x0804a400 0xa4 at 0x400a3bf4
0x0804a6c8 0x18 at 0x4005ec28
0x0804a710 0x18 at 0x4005e7b8
0x0804a768 0x18 at 0x4005e7b8
0x0804a788 0xc at 0x4005d8d1
0x0804a8b8 0x18 at 0x4005d783
0x0804a990 0x18 at 0x4005ec28
0x0804ab08 0x18 at 0x4005ec28
0x0804ab28 0x18 at 0x4005d783
0x0804ab58 0xc at 0x4005d8d1
0x0804ac48 0x18 at 0x4005d82a
0x0804ad48 0x18 at 0x4005d783
0x0804ad78 0xc at 0x4005d8d1
0x0804ad98 0xc at 0x4005d8d1
0x0804aeb8 0x18 at 0x4005d82a
0x0804aed8 0x24 at 0x4005c31d
0x0804b2d0 0x7c at 0x400592f8
0x0804b3f0 0xc at 0x4005d8d1
0x0804b400 0xc at 0x4005d8d1
0x0804b770 0x18 at 0x4005d783
0x0804b8b8 0x24 at 0x4005c31d
0x0804b8e0 0x18 at 0x4005d82a
0x0804b960 0x18 at 0x4005ec28
0x0804b9b0 0x18 at 0x4005e7b8
0x0804b9d0 0x18 at 0x4005e7b8
0x0804b9f0 0x18 at 0x4005d783
0x0804ba10 0xc at 0x4005d8d1
0x0804ba50 0xc at 0x4005d8d1
0x0804cb48 0x18 at 0x4005e7b8
0x0804d6d8 0x24 at 0x4005c31d
0x0804e6a0 0x18 at 0x4005e7b8
0x0804f150 0x1f0 at 0x4005928b
0x0804f348 0xa4 at 0x4005c75a
0x0804f3f0 0x1210 at 0x4005cb81
0x08050608 0x190 at 0x4005d6ca
0x08050aa0 0x450 at 0x4005e35e
0x08050ef8 0x18 at 0x4005e7b8
0x08051018 0x1210 at 0x4005cdde
0x08052330 0x1210 at 0x4005d0ab
0x08053948 0xa4 at 0x4005c75a
0x080539f0 0x1210 at 0x4005cb81
0x08054c08 0x190 at 0x4005d6ca
0x08054da0 0x18 at 0x4005d82a
0x08054fc0 0x18 at 0x4005d783
0x08054fe0 0x18 at 0x4005d82a
----------------------------------------------------------

Any help will be deeply appreciated,

thanks
subir
This means (very probably) the following Address Size Caller
0x0804a400 0xa4 at 0x400a3bf4

The memory block at address 0x804a400 of size 164 bytes
allocated by the function at the address 0x400a3bf4 was
not freed.

Your problem is to find now what function is at address 400a3bf4.
You can find out by using some utility specific to the operating system
that gives you the address of the functions starting with an executable
image.
If you do not know of any utility like that load your program at the
debugger and see what function is at that address.

If nothing works you give me money and I will do it for you.

:-)

jacob
Apr 7 '06 #3
On Sun, 09 Apr 2006 23:00:07 +0200, jacob navia
<ja***@jacob.remcomp.fr> wrote:
subirs wrote:


Nothing relevant to the C language.

To the OP: please try to find an appropriate newsgroup. This is not
the one.

To Jacob: You should know better.

--
Al Balmer
Sun City, AZ
Apr 7 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Sergey Tursanov | last post: by
8 posts views Thread by __jakal__ | last post: by
7 posts views Thread by mosaic | last post: by
10 posts views Thread by eyh5 | last post: by
20 posts views Thread by jeevankodali | last post: by
7 posts views Thread by Salvador | last post: by
3 posts views Thread by Jack | last post: by
4 posts views Thread by lars.uffmann | last post: by
16 posts views Thread by KS | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.