BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MM stack trace?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Language BASM
View previous topic :: View next topic  
Author Message
Brad White
Guest





PostPosted: Tue Nov 22, 2005 5:57 pm    Post subject: MM stack trace? Reply with quote



Even with the debug info dll, and Use Debug dcu's,
this is all I get for a stack trace.

Stack trace of when this block was allocated (return addresses):
448292B
449547E
4494AD5
449725C
7C816D4F [RegisterWaitForInputIdle]

The debug info dll added [RegisterWaitForInputIdle]
That was missing without the dll.

What is the secret?
--
Brad.



Back to top
Pierre le Riche
Guest





PostPosted: Tue Nov 22, 2005 6:53 pm    Post subject: Re: MM stack trace? Reply with quote



Hi Brad,

Quote:
What is the secret?

If the leak was caused by a dynamically loaded DLL that was unloaded before
the leak checking code is run, then the unit/line parsing code will not be
able to translate addresses in the range where the dll was loaded to
unit/line info.

Regards,
Pierre



Back to top
Brad White
Guest





PostPosted: Tue Nov 22, 2005 8:59 pm    Post subject: Re: MM stack trace? Reply with quote



program TestMemoryLeak;

{$APPTYPE CONSOLE}

uses
FastMM4,
SysUtils,
Classes,
Windows;

var TestLeak: TStringList;
begin
TestLeak := TStringList.Create;
OutputDebugString(PChar(TestLeak.Text));
end.

Results in:

--------------------------------2005/11/22
11:14:32--------------------------------
A memory block has been leaked. The size is: 68

Stack trace of when this block was allocated (return addresses):
448292B
7C816D4F [RegisterWaitForInputIdle]

The block is currently used for an object of class: TStringList

Current memory dump of 256 bytes starting at pointer address 94DA90:
04 37 49 04 08 00 00 00 B8 56 95 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 D0
25 6B FF D4 BB 49 04
D4 BB 49 04 D4 BB 49 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00

--------------------------------2005/11/22
11:14:32--------------------------------
A memory block has been leaked. The size is: 12

Stack trace of when this block was allocated (return addresses):
448292B
449547E
4494AD5
449725C
7C816D4F [RegisterWaitForInputIdle]

The block is currently used for an object of class: Unknown

Current memory dump of 256 bytes starting at pointer address 9556B0:
01 00 00 00 02 00 00 00 0D 0A 00 00 B0 A9 6A FF 00 00 00 00 31 58 95 00 00
00 00 00 00 00 00 00
00 00 00 00 2B 29 48 04 BE EF 48 04 7E FE 48 04 4F 3A 48 04 B7 3A 48 04 4F
6D 81 7C 00 00 00 00
00 00 00 00 00 00 00 00 4B 29 48 04 7E FE 48 04 4F 3A 48 04 B7 3A 48 04 4F
6D 81 7C 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 00 00 00 00 00 C8 56 95 00 D4
B8 49 04 D4 BB 49 04
D4 BB 37 A9 6A FF 49 04 00 00 00 00 61 55 95 00 00 00 00 00 00 00 00 00 00
00 00 00 2B 29 48 04
67 F0 48 04 7E FE 48 04 4F 3A 48 04 B7 3A 48 04 4F 6D 81 7C 00 00 00 00 00
00 00 00 00 00 00 00
4B 29 48 04 E7 39 48 04 7F 3C 48 04 4F 6D 81 7C 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00
00 00 00 00 0C 00 00 00 00 00 00 00 40 57 95 00 D4 B8 49 04 D4 BB 49 04 D4
BB 49 04 BF A8 6A FF

--------------------------------2005/11/22
11:14:32--------------------------------
This application has leaked memory. The small block leaks are:

5 - 12 bytes: Unknown x 1
53 - 68 bytes: TStringList x 1

--
Brad.



Back to top
Pierre le Riche
Guest





PostPosted: Tue Nov 22, 2005 11:40 pm    Post subject: Re: MM stack trace? Reply with quote

Hi Brad,

The example you gave works for me. I get the following stack trace:

--------------------------------2005/11/23
1:37:53--------------------------------
A memory block has been leaked. The size is: 52

Stack trace of when this block was allocated (return addresses):
4028CF [System][@GetMem]
40363F [System][TObject.NewInstance]
4038EA [System][@ClassCreate]
40366C [System][TObject.Create]
4163F4 [C:temp10Project2.dpr][Project2][Project2][13]
7C90E64E [ZwSetInformationThread]
7C816D4F [RegisterWaitForInputIdle]
7C8399F3 [FindAtomW]
7C816D58 [RegisterWaitForInputIdle]
....

I set the linker to create a detailed map file and I defined
"FullDebugMode".

Regards,
Pierre


Back to top
Pierre le Riche
Guest





PostPosted: Tue Nov 22, 2005 11:43 pm    Post subject: Re: MM stack trace? Reply with quote

Hi Brad,

Quote:
Even with the debug info dll, and Use Debug dcu's,
this is all I get for a stack trace.

You also need to include either TD32 debug info, a .map file, a .jdbg file
or embedded jcl debug info.

Regards,
Pierre



Back to top
Brad White
Guest





PostPosted: Wed Nov 23, 2005 1:51 am    Post subject: Re: MM stack trace? Reply with quote

"Pierre le Riche" <pleriche (AT) hotmail (DOT) com> wrote

Quote:
Hi Brad,

Even with the debug info dll, and Use Debug dcu's,
this is all I get for a stack trace.

You also need to include either TD32 debug info, a .map file, a .jdbg file
or embedded jcl debug info.


OK. Thanks, that helps a lot. Right down to the line numbers.
I didn't see this requirement documented anywhere.
Did I miss it somehow?

--
Brad White



Back to top
Pierre le Riche
Guest





PostPosted: Wed Nov 23, 2005 8:22 pm    Post subject: Re: MM stack trace? Reply with quote

Hi Brad,

Quote:
I didn't see this requirement documented anywhere.
Did I miss it somehow?

Oops... you're right. I guess it belongs in the FAQ. Will correct ASAP.

Regards,
Pierre



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Language BASM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.