-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[console] console application leak origin detail not logged #89
Comments
I'd suppose you lack debug information in your .EXE file. You can press See Also: A text in Russian from EurekaLog's (or madExcept's? i personally use JCL so am not sure which is which of those two commercial swissknives) developer: https://www.gunsmoker.ru/2009/04/delphi_19.html Official docs: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Linking Also ntCore's CFF Explorer Suite might be handy to peep into the generated EXE/DLL file to see if there among standard PE sections exists and extra one with debug-info (this is compiler-specific, not PE-standard, so harder to identify) |
PS: anyway, here is the project -> Projects.zip. Do you experience the same? |
Would anything change if you do instead
Also, make Win32 Map file "detailed" and then read it in Notepad, what would be there for your 4F9986 ? |
|
A.S. Funny thing, you seem to only partially configure the project, or so it seems to me. I was not nitpicking on the specific chapter you opened in the config dialog (not specific enough), and it seems it did not affected this case, but you have to be aware that you was probably looking into the wrong options chapter.
I did not say it would resolve anything, i said it would give you more information, i toold you to read the file in the Notepad, did you? Here is the relevant map block as generated in Delphi XE2
The address in question is
So, your suspicious address should be 0x42100 + 0x3EE or in seg:ofs format, Can you find this address ANYWHERE in the map file, either among identifiers (funcitons, variables, etc) or among line numbers? Seems, Delphi just does not generate any information for that address, so what FastMM4 can do, without bloating much itself? I also tried to add an anonymous procedure instead:
Sadly, in Delphi XE2 this leads to AV during execution.
This works though, but again - line number's address and memory allocation's address do not match. |
And here is a simplified program's Debug View -> CPU
As you can see I suppose, because there is no identifer in map/debug info - FastMM4 just has no anchor to scan back addresses to find a last known address and to report something like Would this be implemented (and complicate FastMM's code) - will this be safe? will it never backfire by mis-attributting addresses in other places? I am not sure. It is up to you to scratch your itch, if you feel it is worth it. Here is another fundamentally similar case, with
Good luck finding
|
@the-Arioch , many thanks for this detailed analysis! |
program Project7;
{$APPTYPE CONSOLE}
{$INCLUDE .\FastMM4Options.inc}
{$R *.res}
uses
FastMM4
, System.SysUtils
;
begin
ReportMemoryLeaksOnShutdown := true;
try
try
{ TODO -oUser -cConsole Main : Insert code here }
TObject.Create;
finally
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.
FullDebugMode
in FastMM4Options.inc, the resulting Project7_MemoryManager_EventLog.txt is as follows:--------------------------------2021/10/11 10:35:34--------------------------------
A memory block has been leaked. The size is: 12.
This block was allocated by thread 0x2C90, and the stack trace (return addresses) at the time was:
40707E [System.pas][System][@getmem$qqri][4843]
4088AB [System.pas][System][TObject.NewInstance][17861]
408FD2 [System.pas][System][@ClassCreate$qqrpvzc][19251]
408990 [System.pas][System][TObject.Create][17920]
40A1C0 [System.pas][System][InitUnits$qqrv][23832]
4F9986
76A00419 [BaseThreadInitThunk]
77B372AD [RtlGetAppContainerNamedObjectPath]
77B3727D [RtlGetAppContainerNamedObjectPath]
The block is currently used for an object of class: System.TObject
The allocation number is: 537
...
-> Did I miss a setting in FastMM4Options.inc ?
The text was updated successfully, but these errors were encountered: