473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 2196
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sergey Tursanov | last post by:
Hello all ! When I use code below and check my program with various memory leak detection tools I get message about memory leaks in stl_alloc.h. #include <string> int main() { std::string s...
8
by: __jakal__ | last post by:
Hello, Is there any good memory leak detection software for C++ available as a freeware... I had used purify but had to discontinue due to huge license fees... Also tried Sun workshop memory...
7
by: mosaic | last post by:
Hi, all I really interested in how to check the memory leak of a program. Your smart guys, do you have excellent ideas that could share with me? Thank you. The following is my idea: In C...
10
by: eyh5 | last post by:
Hi, My C code (running on Soalris Unix) has some "segmentation fault" that I wish to use purify to do it. I poked around the web, and found some information about adding some lines in a Makefile...
20
by: jeevankodali | last post by:
Hi I have an .Net application which processes thousands of Xml nodes each day and for each node I am using around 30-40 Regex matches to see if they satisfy some conditions are not. These Regex...
7
by: Salvador | last post by:
Hi, I am using WMI to gather information about different computers (using win2K and win 2K3), checking common classes and also WMI load balance. My application runs every 1 minute and reports...
3
by: Jack | last post by:
How to investigate a memory leak? Thanks. Jack
4
by: lars.uffmann | last post by:
I just reduced a nasty and hard to pin-down memory leak (according to mtrace() under SuSE 9.3 to a very simple example file and would like to know what the error is about, and whether it maybe is a...
16
by: KS | last post by:
Hello, I have a memory leak in my application and I have identified two lines of code that cause the leak. If I comment out these lines, the program runs fine. If left uncommented, the memory...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.