Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Memory leak with madExcept
#1
Hi,

I am having problems with madExcept reporting a memory leak. I am using IW V15.2.65, Delphi 11.1, Firebird 4. I have also posted this in the madExcept forum.

The problem can be easily reproduced.
  • Start a new standalone IW application.

  • On the UserSession form place a TFDConnection (Con) and a TFDQuery (Qry).

  • In the IWUserSessionBaseCreate event configure the connection and execute a simple query.

  • Run the application and you should get a blank page in the browser.

  • Close the server and a leak report is generated.
Here's the code in IWUserSessionBaseCreate:


Code:

Code:
procedure TIWUserSession.IWUserSessionBaseCreate(Sender: TObject);
begin
  Con.DriverName := 'FB';
  Con.LoginPrompt := False;
  Con.Params.Values['User_Name'] := 'XXXX';
  Con.Params.Values['Password'] := 'XXXX';
  Con.Params.Values['CharacterSet'] := 'UTF8';
  Con.Params.Values['SQLDialect'] := '3';
  Con.Params.Database := 'localhost:C:\XXXX\DATA.FDB';

  Qry.Connection := Con;
  Qry.Open('select first 1 * from setup');
end;


The connection and the query are on the form and will be freed when the application closes.

The full leak report is shown below. Any ideas? I'd appreciate any assistance anyone can offer.

allocation number: 42459
program up time: 3.76 s
type: VirtualAlloc
address: $b690000
size: 4096
access rights: read/exec/write

thread $1f00 (TInThreadWithTask):
671aa0a8 madExcept32.dll madExceptDbg 2853 VirtualAllocCallback
007de410 VehicleAllocationWebsite.exe IWRtlFix 161 IW_MakeObjectInstance
006e0376 VehicleAllocationWebsite.exe Vcl.Controls 8725 TWinControl.Create
006a2aa6 VehicleAllocationWebsite.exe Vcl.Forms 3330 TScrollingWinControl.Create
0077691e VehicleAllocationWebsite.exe IWVCLBaseContainer 210 TIWBaseContainer.Create
007d13a5 VehicleAllocationWebsite.exe IWBaseForm 588 TIWBaseForm.CreateNew
007a6fc9 VehicleAllocationWebsite.exe IWForm 338 TIWForm.CreateNew
007d0b43 VehicleAllocationWebsite.exe IWBaseForm 363 TIWBaseForm.Create
007d0bea VehicleAllocationWebsite.exe IWBaseForm 380 TIWBaseForm.Create
007d67ee VehicleAllocationWebsite.exe IWApplication 535 TIWApplication.CreateAndShowDefaultPage
00815dfc VehicleAllocationWebsite.exe IWServerSession 582 TIWServerSession.StartForm
00816c35 VehicleAllocationWebsite.exe IWServerSession 889 TIWServerSession.ExecuteForm
008164ba VehicleAllocationWebsite.exe IWServerSession 784 TIWServerSession.DoExecuteSession
008164e1 VehicleAllocationWebsite.exe IWServerSession 789 TIWServerSession.DoExecuteSession
00816afb VehicleAllocationWebsite.exe IWServerSession 871 TIWServerSession.ExecuteSession
00816b59 VehicleAllocationWebsite.exe IWServerSession 880 TIWServerSession.ExecuteSession
00816b7d VehicleAllocationWebsite.exe IWServerSession 883 TIWServerSession.ExecuteSession
00804567 VehicleAllocationWebsite.exe IWServer 687 TIWServer.ExecuteUrl
00804585 VehicleAllocationWebsite.exe IWServer 689 TIWServer.ExecuteUrl
00804a7c VehicleAllocationWebsite.exe IWServer 761 TIWServer.Execute
00804acd VehicleAllocationWebsite.exe IWServer 763 TIWServer.Execute
00804b58 VehicleAllocationWebsite.exe IWServer 776 TIWServer.Execute
00813293 VehicleAllocationWebsite.exe IWServerSession 97 HttpExecute
008132ae VehicleAllocationWebsite.exe IWServerSession 98 HttpExecute
00895e34 VehicleAllocationWebsite.exe IW.Server.HTTPIndy 246 THTTPServerIndy.DoCommandGet
00895ea7 VehicleAllocationWebsite.exe IW.Server.HTTPIndy 257 THTTPServerIndy.DoCommandGet
00895ee1 VehicleAllocationWebsite.exe IW.Server.HTTPIndy 265 THTTPServerIndy.DoCommandGet
00878200 VehicleAllocationWebsite.exe InCustomHTTPServer 1427 TInCustomHTTPServer.DoExecute
0084fa37 VehicleAllocationWebsite.exe InContext 185 TInContext.Run
004beeaf VehicleAllocationWebsite.exe madExcept HookedTThreadExecute
0055400d VehicleAllocationWebsite.exe System.Classes 15711 ThreadProc
0040b6cc VehicleAllocationWebsite.exe System 25395 ThreadWrapper
004bed95 VehicleAllocationWebsite.exe madExcept CallThreadProcSafe
004bedfa VehicleAllocationWebsite.exe madExcept ThreadExceptFrame
76236737 KERNEL32.DLL BaseThreadInitThunk

memory dump:
0b690000 00 00 00 00 59 e9 72 e3 - 14 f5 e8 f5 ff ff ff 00 ....Y.r.........
0b690010 00 00 00 00 00 00 00 e8 - e8 ff ff ff 0a 00 69 0b ..............i.
0b690020 00 00 00 00 e8 db ff ff - ff 17 00 69 0b 00 00 00 ...........i....
0b690030 00 e8 ce ff ff ff 24 00 - 69 0b 00 00 00 00 e8 c1 ......$.i.......
0b690040 ff ff ff 31 00 69 0b 00 - 00 00 00 e8 b4 ff ff ff ...1.i..........
0b690050 3e 00 69 0b 00 00 00 00 - e8 a7 ff ff ff 4b 00 69 >.i..........K.i
0b690060 0b 00 00 00 00 e8 9a ff - ff ff 58 00 69 0b 00 00 ..........X.i...
0b690070 00 00 e8 8d ff ff ff 65 - 00 69 0b 00 00 00 00 e8 .......e.i......
0b690080 80 ff ff ff 72 00 69 0b - 00 00 00 00 e8 73 ff ff ....r.i......s..
0b690090 ff 7f 00 69 0b 00 00 00 - 00 e8 66 ff ff ff 8c 00 ...i......f.....
0b6900a0 69 0b 00 00 00 00 e8 59 - ff ff ff 99 00 69 0b 00 i......Y.....i..
0b6900b0 00 00 00 e8 4c ff ff ff - a6 00 69 0b 00 00 00 00 ....L.....i.....
0b6900c0 e8 3f ff ff ff b3 00 69 - 0b 00 00 00 00 e8 32 ff .?.....i......2.
0b6900d0 ff ff c0 00 69 0b 00 00 - 00 00 e8 25 ff ff ff cd ....i......%....
0b6900e0 00 69 0b 00 00 00 00 e8 - 18 ff ff ff da 00 69 0b .i............i.
0b6900f0 00 00 00 00 e8 0b ff ff - ff e7 00 69 0b 00 00 00 ...........i....
0b690100 00 e8 fe fe ff ff f4 00 - 69 0b 00 00 00 00 e8 f1 ........i.......
0b690110 fe ff ff 01 01 69 0b 00 - 00 00 00 e8 e4 fe ff ff .....i..........
0b690120 0e 01 69 0b 00 00 00 00 - e8 d7 fe ff ff 1b 01 69 ..i............i
0b690130 0b 00 00 00 00 e8 ca fe - ff ff 28 01 69 0b 00 00 ..........(.i...

allocation number: 28519
program up time: 3.31 s
type: Thread Handle
handle: $c7c
access rights: $1fffff
threadId: $1a68
processId: $4170
process exe: C:\Projects\WIS\Websites\DispatcherPortal\Win32\Debug\VehicleAllocationWebsite.exe

thread $4504 (TInThreadWithTask):
671ad1ee madExcept32.dll madExceptDbg 4058 CreateThreadCallback
004bf31b VehicleAllocationWebsite.exe madExcept HookedCreateThread
004bf360 VehicleAllocationWebsite.exe madExcept HookedCreateThread
7647641f ucrtbase.dll _beginthreadex
00ac75c4 VehicleAllocationWebsite.exe FireDAC.Phys.FB 529 TFDPhysFBConnection.InternalConnect
00a794bd VehicleAllocationWebsite.exe FireDAC.Phys 3347 TFDPhysConnection.DoConnect
00a79fcd VehicleAllocationWebsite.exe FireDAC.Phys 3521 TFDPhysConnection.Open
00a7a035 VehicleAllocationWebsite.exe FireDAC.Phys 3530 TFDPhysConnection.Open
00a7a086 VehicleAllocationWebsite.exe FireDAC.Phys 3537 TFDPhysConnection.Open
0097b735 VehicleAllocationWebsite.exe FireDAC.Comp.Client 4185 TFDCustomConnection.SetConnected
0097b7b1 VehicleAllocationWebsite.exe FireDAC.Comp.Client 4194 TFDCustomConnection.SetConnected
008be2d0 VehicleAllocationWebsite.exe Data.DB 3520 TCustomConnection.Open
0097a0d9 VehicleAllocationWebsite.exe FireDAC.Comp.Client 3685 TFDCustomConnection.CheckActive
0097a134 VehicleAllocationWebsite.exe FireDAC.Comp.Client 3688 TFDCustomConnection.CheckActive
0097c0ac VehicleAllocationWebsite.exe FireDAC.Comp.Client 4410 TFDCustomConnection.Trace
00980fb7 VehicleAllocationWebsite.exe FireDAC.Comp.Client 6501 TFDCustomCommand.SetPrepared
00981147 VehicleAllocationWebsite.exe FireDAC.Comp.Client 6533 TFDCustomCommand.SetPrepared
0098138e VehicleAllocationWebsite.exe FireDAC.Comp.Client 6584 TFDCustomCommand.SetPrepared
00474191 VehicleAllocationWebsite.exe System.Variants 905 @VarClr
0098156d VehicleAllocationWebsite.exe FireDAC.Comp.Client 6597 TFDCustomCommand.Prepare
00816a40 VehicleAllocationWebsite.exe IWServerSession 851 TIWServerSession.ExecuteSession
00407698 VehicleAllocationWebsite.exe System 4935 @GetMem
00ec0ca9 VehicleAllocationWebsite.exe ServerController 49 TIWServerController.IWServerControllerBaseNewSession
0076cc5f VehicleAllocationWebsite.exe IWServerControllerBase 1060 TIWServerControllerBase.DoNewSession
00816a40 VehicleAllocationWebsite.exe IWServerSession 851 TIWServerSession.ExecuteSession
00813293 VehicleAllocationWebsite.exe IWServerSession 97 HttpExecute
00895e34 VehicleAllocationWebsite.exe IW.Server.HTTPIndy 246 THTTPServerIndy.DoCommandGet
00878200 VehicleAllocationWebsite.exe InCustomHTTPServer 1427 TInCustomHTTPServer.DoExecute
0084fa37 VehicleAllocationWebsite.exe InContext 185 TInContext.Run
004beeaf VehicleAllocationWebsite.exe madExcept HookedTThreadExecute
0055400d VehicleAllocationWebsite.exe System.Classes 15711 ThreadProc
004076b4 VehicleAllocationWebsite.exe System 4983 @FreeMem
00409834 VehicleAllocationWebsite.exe System 17926 TObject.FreeInstance
004beb69 VehicleAllocationWebsite.exe madExcept InterceptClassDestroy
0040991d VehicleAllocationWebsite.exe System 17981 TObject.Destroy
00ab0227 VehicleAllocationWebsite.exe FireDAC.Phys.IBWrapper 3406 TIBDatabase.Attach
00ab0273 VehicleAllocationWebsite.exe FireDAC.Phys.IBWrapper 3416 TIBDatabase.Attach
00ab0297 VehicleAllocationWebsite.exe FireDAC.Phys.IBWrapper 3418 TIBDatabase.Attach
00abb55a VehicleAllocationWebsite.exe FireDAC.Phys.IBDef 327 TFDPhysIBConnectionDefParams.GetOpenMode
00abf5f4 VehicleAllocationWebsite.exe FireDAC.Phys.IBBase 1748 TFDPhysIBConnectionBase.InternalConnect
00abf65d VehicleAllocationWebsite.exe FireDAC.Phys.IBBase 1756 TFDPhysIBConnectionBase.InternalConnect
00abf919 VehicleAllocationWebsite.exe FireDAC.Phys.IBBase 1783 TFDPhysIBConnectionBase.InternalConnect
00ac75c4 VehicleAllocationWebsite.exe FireDAC.Phys.FB 529 TFDPhysFBConnection.InternalConnect
00ac75ff VehicleAllocationWebsite.exe FireDAC.Phys.FB 531 TFDPhysFBConnection.InternalConnect
00a79400 VehicleAllocationWebsite.exe FireDAC.Phys 3321 TFDPhysConnection.ConnectBase
00a794bd VehicleAllocationWebsite.exe FireDAC.Phys 3347 TFDPhysConnection.DoConnect
00a79fcd VehicleAllocationWebsite.exe FireDAC.Phys 3521 TFDPhysConnection.Open
00a7a035 VehicleAllocationWebsite.exe FireDAC.Phys 3530 TFDPhysConnection.Open
00a7a086 VehicleAllocationWebsite.exe FireDAC.Phys 3537 TFDPhysConnection.Open
0097ac16 VehicleAllocationWebsite.exe FireDAC.Comp.Client 3999 TFDCustomConnection.DoInternalLogin
0097b8f8 VehicleAllocationWebsite.exe FireDAC.Comp.Client 4219 TFDCustomConnection.DoConnect
0097b9ec VehicleAllocationWebsite.exe FireDAC.Comp.Client 4232 TFDCustomConnection.DoConnect
0097ba3a VehicleAllocationWebsite.exe FireDAC.Comp.Client 4238 TFDCustomConnection.DoConnect
008be315 VehicleAllocationWebsite.exe Data.DB 3538 TCustomConnection.SetConnected
0097b735 VehicleAllocationWebsite.exe FireDAC.Comp.Client 4185 TFDCustomConnection.SetConnected
0097b7b1 VehicleAllocationWebsite.exe FireDAC.Comp.Client 4194 TFDCustomConnection.SetConnected
008be2d0 VehicleAllocationWebsite.exe Data.DB 3520 TCustomConnection.Open
0097a0d9 VehicleAllocationWebsite.exe FireDAC.Comp.Client 3685 TFDCustomConnection.CheckActive
0097a134 VehicleAllocationWebsite.exe FireDAC.Comp.Client 3688 TFDCustomConnection.CheckActive
0097c0ac VehicleAllocationWebsite.exe FireDAC.Comp.Client 4410 TFDCustomConnection.Trace
00980fb7 VehicleAllocationWebsite.exe FireDAC.Comp.Client 6501 TFDCustomCommand.SetPrepared
00981147 VehicleAllocationWebsite.exe FireDAC.Comp.Client 6533 TFDCustomCommand.SetPrepared
0098138e VehicleAllocationWebsite.exe FireDAC.Comp.Client 6584 TFDCustomCommand.SetPrepared
00474191 VehicleAllocationWebsite.exe System.Variants 905 @VarClr
00948b80 VehicleAllocationWebsite.exe FireDAC.Comp.DataSet 1827 TFDDataSet.DoMasterDefined
Reply
#2
Does the same leak happen without the FD stuff in it? If it's an IntraWeb leak it should happen with or without a DB connection of any kind.

I haven't used madExcept in a long long time but I've checked IntraWeb for these kind of leaks (that can't be detected by FastMM) with Deleaker (https://www.deleaker.com/) and it doesn't show any leak, especially a thread handle. Maybe madExcept is simply wrong?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)