Page 1 of 1

Exception on close of application only if ReportLeaks is on

PostPosted: Tue Jan 15, 2019 8:34 pm
by simpsons

I'm using latest madExcept 5.0.0 in an 32bit application, built with Delphi 10.3 Rio.
When I switch on ReportMemoryLeaks the application throws an exception on closing due to access violations.
Juding from the bugreport this happens when madExcept looks for leftovers in the memory.
This does NOT happen with madExcept activated but option ReportMemoryLeaks is OFF.
The bugreport is attached.
Do you need more info for this problem?


compiled with : Delphi 10.3 Rio
madExcept version : 5.0.0
callstack crc : $8bda69cd, $40125df3, $a0353c6f
exception number : 1
exception class : EAccessViolation
exception message : Zugriffsverletzung bei Adresse 0040606B in Modul 'TrackTool.exe'. Lesen von Adresse 00000000.

main thread ($308):
0040606b +017 TrackTool.exe System 67 +0 SysFreeMem
671a5651 +131 madExcept32.dll madExceptDbg 1863 +38 FreeMemCallback
00407360 +004 TrackTool.exe System 67 +0 @FreeMem
0040aa8c +01c TrackTool.exe System 67 +0 @UStrClr
0040c6e4 +098 TrackTool.exe System 67 +0 @FinalizeArray
0040c5fc +040 TrackTool.exe System 67 +0 @FinalizeRecord
00408bc0 +02c TrackTool.exe System 67 +0 TObject.CleanupInstance
00408ac1 +005 TrackTool.exe System 67 +0 TObject.FreeInstance
004af479 +019 TrackTool.exe madExcept InterceptClassDestroy
00a78dab +0db TrackTool.exe JamShellBreadCrumbBar 7112 +11 TJamShellBreadCrumbBar.Destroy
005a0d06 +0d6 TrackTool.exe Vcl.Controls TWinControl.Destroy
005efd68 +038 TrackTool.exe Vcl.ComCtrls TTabSheet.Destroy
005a0d06 +0d6 TrackTool.exe Vcl.Controls TWinControl.Destroy
005eee81 +085 TrackTool.exe Vcl.ComCtrls TCustomTabControl.Destroy
005f0408 +048 TrackTool.exe Vcl.ComCtrls TPageControl.Destroy
005a0d06 +0d6 TrackTool.exe Vcl.Controls TWinControl.Destroy
005a9dc0 +01c TrackTool.exe Vcl.Controls TCustomControl.Destroy
005a0d06 +0d6 TrackTool.exe Vcl.Controls TWinControl.Destroy
0068f723 +04b TrackTool.exe Vcl.Forms TScrollingWinControl.Destroy
0069070c +11c TrackTool.exe Vcl.Forms TCustomForm.Destroy
00408b08 +008 TrackTool.exe System 67 +0 TObject.Free
00528db6 +076 TrackTool.exe System.Classes TComponent.DestroyComponents
0068e4bd +035 TrackTool.exe Vcl.Forms DoneApplication
00452d59 +021 TrackTool.exe System.SysUtils DoExitProc
0040a7d2 +06e TrackTool.exe System 67 +0 @Halt0
00d54a79 +0cd TrackTool.exe TrackTool 139 +22 initialization
761cfe07 +017 KERNEL32.DLL BaseThreadInitThunk

Re: Exception on close of application only if ReportLeaks is

PostPosted: Tue Jan 15, 2019 8:44 pm
by madshi
This could have all sorts of reasons. A bug in madExcept sure is one explanation, but far from the only one. This crash not occuring without resource leaking activated doesn't prove anything, unfortunately. Different timing, different memory managers etc could all play role here. E.g. if there's a buffer overrun, it can sometimes produce crashes and sometimes it won't.

Have you tried activating "instantly crash on buffer overrun" instead of leak reporting? Does it cause any crashes?

Re: Exception on close of application only if ReportLeaks is

PostPosted: Wed Jan 16, 2019 11:04 am
by simpsons
Thanks for the tip with the buffer overrun check, haven't used that before.
madExcept found a buffer overrun when initialising one of the components in my app.
After encapsuling that with a try..except block, I finally get the memory leaks report on closing the app again.

Re: Exception on close of application only if ReportLeaks is

PostPosted: Wed Jan 16, 2019 12:58 pm
by madshi
Would be better to solve the buffer overrun instead of hiding it, of course... :D

Re: Exception on close of application only if ReportLeaks is

PostPosted: Wed Jan 16, 2019 2:49 pm
by simpsons
I've reported it to the manufacturer already!