Memory leak with Delphi/DBExpress - delphi

I've a weird problem with my application, its memory usage goes up a few hundred megabytes at once every now and then and eventually the application freezes. The application is written with Delphi, it uses database, COM (for OPC) and TCP/IP.
With FastMM I've got following the screen shot of memory usage. I'm not completely sure how to read that table, but it looks like something has allocated 296463552 bytes (0x100fb000, is that "magic number"?) three times.
Any ideas? Is there any way to track non-Delphi-MM memory allocations?
I'm using Delphi 2007 with FastMM 4.96.
Edit:
I wrote a small helper class using IMallocSpy to track COM memory allocations. Here's excerpt from what I got:
00119023 5:52:27.484 [4496] TCOMAllocSpy.PreRealloc size: 269462304
00119024 5:52:27.734 [4496] (0002760C){ntdll.dll } [7C82860C] KiFastSystemCallRet + $0
00119025 5:52:27.734 [4496] (0009F83A){MyApp.exe} [004A083A] JclDebug.JclCreateThreadStackTrace (Line 3943, "JclDebug.pas" + 7) + $1E
00119026 5:52:27.734 [4496] (003D496A){MyApp.exe} [007D596A] ComLeakHelper.TCOMAllocSpy.DebugStack (Line 46, "ComLeakHelper.pas" + 2) + $9
00119027 5:52:27.734 [4496] (003D4B52){MyApp.exe} [007D5B52] ComLeakHelper.TCOMAllocSpy.PreRealloc (Line 125, "ComLeakHelper.pas" + 4) + $2
00119028 5:52:27.734 [4496] (000053B6){MyApp.exe} [004063B6] System.#WStrAsg (Line 14090, "sys\system.pas" + 10) + $0
00119029 5:52:27.734 [4496] (002E4490){MyApp.exe} [006E5490] DBXCommon.TDBXCommand.SetText (Line 5304, "..\..\..\..\..\src\pas\dbx\driver\DBXCommon.pas" + 13) + $5
00119030 5:52:27.734 [4496] (0010A340){MyApp.exe} [0050B340] WideStrings.TWideStrings.GetValue (Line 580, "common\WideStrings.pas" + 3) + $D
00119031 5:52:27.734 [4496] (002E1AFC){MyApp.exe} [006E2AFC] DBXCommon.TDBXProperties.GetValue (Line 4046, "..\..\..\..\..\src\pas\dbx\driver\DBXCommon.pas" + 1) + $7
00119032 5:52:27.734 [4496] (002E3FC9){MyApp.exe} [006E4FC9] DBXCommon.TDBXConnectionEx.GetProductName (Line 5071, "..\..\..\..\..\src\pas\dbx\driver\DBXCommon.pas" + 1) + $E
00119033 5:52:27.734 [4496] (003765FA){MyApp.exe} [007775FA] SqlExpr.TSQLConnection.DoConnect (Line 2467, "..\..\..\..\..\src\pas\dbx\vcl\SqlExpr.pas" + 66) + $21
00119034 5:52:27.734 [4496] (0011876D){MyApp.exe} [0051976D] DB.TCustomConnection.SetConnected (Line 2628, "DB.pas" + 8) + $4
00119035 5:52:27.734 [4496] (00118728){MyApp.exe} [00519728] DB.TCustomConnection.Open (Line 2611, "DB.pas" + 0) + $4
00119036 5:52:27.734 [4496] (00375D6F){MyApp.exe} [00776D6F] SqlExpr.TSQLConnection.CheckConnection (Line 2302, "..\..\..\..\..\src\pas\dbx\vcl\SqlExpr.pas" + 4) + $2
00119037 5:52:27.734 [4496] (00379241){MyApp.exe} [0077A241] SqlExpr.TCustomSQLDataSet.CheckConnection (Line 3955, "..\..\..\..\..\src\pas\dbx\vcl\SqlExpr.pas" + 2) + $2
00119038 5:52:27.734 [4496] (0037968A){MyApp.exe} [0077A68A] SqlExpr.TCustomSQLDataSet.OpenCursor (Line 4045, "..\..\..\..\..\src\pas\dbx\vcl\SqlExpr.pas" + 3) + $4
00119039 5:52:27.734 [4496] (00125EA9){MyApp.exe} [00526EA9] DB.TDataSet.SetActive (Line 9245, "DB.pas" + 12) + $7
00119040 5:52:27.734 [4496] (00125CA1){MyApp.exe} [00526CA1] DB.TDataSet.Open (Line 9201, "DB.pas" + 1) + $6
...
So, the problem seems to be in database connection. I'm using Firebird 2.1, DBExpress and InterXpress for Firebird drivers from Upscene.
Edit2:
This seems to analyze similar problem, at least the focus is on same lines as here: http://www.yac.com.pl/mt.texts.sqlexpr-2.en.html

The problem is bug in Delphi 2007 DbExpress which surface in multithreaded environment (It's not thread safe, after all). More information here: http://www.yac.com.pl/mt.texts.sqlexpr-2.en.html

When your application is frozen, your can try to look at the stack to discover why it is frozen:
http://code.google.com/p/asmprofiler/wiki/ProcessStackViewer
You can try memproof to trace all resource allocation (and their stacktrace):
http://www.torry.net/tools/debug/memory/memp0948.zip

Try EurekaLog to locate the problem.

Related

What can it be that causes the error "List index out of bounds (..)" after upgrading from Delphi 11.1 to 11.2?

Only since the upgrade I got the subjected error, and after pressing the Details-button in the error message it shows:
[6F6A815B]{rtl280.bpl } System.Classes.TList.Get (Line 5108, "System.Classes.pas" + 2) + $A
[7119EC97]{vcl280.bpl } Vcl.AppEvnts.TMultiCaster.GetAppEvents (Line 686, "Vcl.AppEvnts.pas" + 1) + $B
[7119E5BE]{vcl280.bpl } Vcl.AppEvnts.TMultiCaster.DoActivate (Line 438, "Vcl.AppEvnts.pas" + 5) + $9
[7114362F]{vcl280.bpl } Vcl.Forms.TApplication.WndProc (Line 11035, "Vcl.Forms.pas" + 140) + $C
[6F6C580C]{rtl280.bpl } System.Classes.StdWndProc (Line 18490, "System.Classes.pas" + 8) + $0
[71D85883]{vclide280.bpl} IDEVirtualTrees.TVirtualTreeHintWindow.IsHintMsg (Line 7121, "IDEVirtualTrees.pas" + 7) + $13
[7114417F]{vcl280.bpl } Vcl.Forms.TApplication.ProcessMessage (Line 11460, "Vcl.Forms.pas" + 23) + $1
[711441C2]{vcl280.bpl } Vcl.Forms.TApplication.HandleMessage (Line 11490, "Vcl.Forms.pas" + 1) + $4
[71144501]{vcl280.bpl } Vcl.Forms.TApplication.Run (Line 11629, "Vcl.Forms.pas" + 27) + $3
[00B98082]{bds.exe } bds.bds (Line 227, "" + 16) + $2
I did not add any code since my programs run normally, except when exiting the error appears. Apparently, at that point the debugger is already closed.
Apart from a series of GetIt libraries and components, Spring4D is the only third-party software from an external source.
The GetIt plugins:
Bookmarks-11-1.6.3
Essentials-2022.06-D11
JEDICodeLibraryJCL-2022.02
JEDIVisualComponentLibraryJVCL-2022.02
LockBox-2021.11-11
ParallelDebugger-11-1.0.3
ParnassusCoreEditor-11-1.6.3
PNGComponents-2021.11-11
PowerPDF-2021.09-11
Python4Delphi-1.0
Embarcadero keep backward compatibility in runtime bpls, but made changes into design time bpls when doing minor upgrading from 11.1 to 11.2. Seems like you have installed some third party components, which were not rebuilt for the 11.2 version. Take your time. Developers will rebuild it or Embarcadero will make some patch to fix it.

"Property Images does not exist"

I get the "Property Images does not exist" for an old project that I opened today with Delphi Tokyo 10.2 Trial.
How to (re)produce it:
Select multiple controls on a form (at design time). At least one of the controls needs to have an 'Images' property. For example, I select with Shift+Click a TLabel and a Tbutton.
For the button I see its 'Images' property listed in Object Inspector. And it seems to work ok: I can assign a list of images to it.
So, what is the actual problem? Why do I see this error (ONLY when I select multiple controls)?
[5011EB3F]{rtl250.bpl } System.TypInfo.PropertyNotFound (Line 1126, "System.TypInfo.pas" + 1) + $21
[5011EBEA]{rtl250.bpl } System.TypInfo.FindPropInfo (Line 1160, "System.TypInfo.pas" + 3) + $6
[5011ED11]{rtl250.bpl } System.TypInfo.GetObjectProp (Line 1210, "System.TypInfo.pas" + 1) + $8
[157A850D]{dclQuickEdit250.bpl} Quickedit.TQuickEditor.GetVerb + $1FD
[157A8729]{dclQuickEdit250.bpl} Quickedit.TQuickEditor.PrepareItem + $E1
[525BE924]{vcldesigner250.bpl} VCLSurface.AddSelectionVerbs (Line 2717, "VCLSurface.pas" + 15) + $14
[525BEB8B]{vcldesigner250.bpl} VCLSurface.TVclDesignSurface.BuildLocalMenu (Line 2771, "VCLSurface.pas" + 9) + $1
[21F6AA6C]{delphicoreide250.bpl} PropInspManage.TDesignerPropSelection.GetHotCommandMenuItems (Line 331, "PropInspManage.pas" + 3) + $13
[21F6BCF7]{delphicoreide250.bpl} PropInspManage.TDesignerPropSelection.UpdateHotCommands (Line 690, "PropInspManage.pas" + 2) + $C
[21F6B602]{delphicoreide250.bpl} PropInspManage.TDesignerPropSelection.SelectionChanged (Line 597, "PropInspManage.pas" + 15) + $2
[2120B4DF]{designide250.bpl} ComponentDesigner.DesignNotificationSelectionChanged (Line 8832, "ComponentDesigner.pas" + 5) + $A
[21206B24]{designide250.bpl} ComponentDesigner.TComponentDesigner.SetSelection (Line 7021, "ComponentDesigner.pas" + 20) + $5
[212070AA]{designide250.bpl} ComponentDesigner.TComponentDesigner.UpdateSelections (Line 7089, "ComponentDesigner.pas" + 19) + $C
[21206841]{designide250.bpl} ComponentDesigner.TComponentDesigner.RootActivated (Line 6941, "ComponentDesigner.pas" + 5) + $2
[525D04A2]{vcldesigner250.bpl} VCLFormDesigner.TVCLRootDesigner.Activate (Line 344, "VCLFormDesigner.pas" + 4) + $1E
[525C0BB6]{vcldesigner250.bpl} VCLSurface.TVclDesignSurface.IsDesignMsg (Line 3584, "VCLSurface.pas" + 114) + $A
[5005FBA2]{rtl250.bpl } System.#IsClass (Line 17427, "System.pas" + 1) + $8
[50AC499B]{vcl250.bpl } Vcl.Controls.TControl.WndProc (Line 7239, "Vcl.Controls.pas" + 4) + $21
[211AEFCA]{designide250.bpl} DeskUtil.SetFocusHook (Line 463, "DeskUtil.pas" + 4) + $C
[50AC97FB]{vcl250.bpl } Vcl.Controls.TWinControl.WndProc (Line 10197, "Vcl.Controls.pas" + 166) + $6
[50AC8DC8]{vcl250.bpl } Vcl.Controls.TWinControl.MainWndProc (Line 9896, "Vcl.Controls.pas" + 3) + $6
[5016EBC4]{rtl250.bpl } System.Classes.StdWndProc (Line 17406, "System.Classes.pas" + 9) + $2
[50C119C7]{vcl250.bpl } Vcl.Forms.TApplication.ProcessMessage (Line 10596, "Vcl.Forms.pas" + 6) + $9
[50C11AB2]{vcl250.bpl } Vcl.Forms.TApplication.HandleMessage (Line 10643, "Vcl.Forms.pas" + 1) + $4
[50C11DE5]{vcl250.bpl } Vcl.Forms.TApplication.Run (Line 10781, "Vcl.Forms.pas" + 26) + $3
[005088E2]{bds.exe } bds.bds (Line 212, "" + 7) + $7
Yes. It is a "Known bug".
https://quality.embarcadero.com/browse/RSP-19984
Type: Bug
Status: Open
Priority: Major Major
Resolution: Unresolved
Affects Version/s: 10.2 Tokyo Release 3, 10.2 Tokyo Release 2
Fix Version/s: None

DataSnap server socket error 10061

I have decided to move from SOAP servers to DataSnap servers & REST. I have viewed and followed several tutorials and even tried the DXE5 demos but I keep getting the same result. The issue is that I cannot connect the TSQLConnection on the client app to the DataSnap server that is running.
Here is the Code :
Socket Error # 10061
Connection refused..
OS = Windows 7 64bit
RAD Studio XE5 Update 2
Following DataSnap multi-tier video tutorial by Pawel Glowacki (and ohters).
In creating a Datasnap client/server app, I cannot connect the client TSQLConnection to the DSServer.
The server is running (localhost)!
Firewal de-activated.
Added port 211 to Windows Firewall Inbound & Outbound rules.
I have tried creating a DataSnat REST application and the same error occurs.
I get the same results when doing this in DXE and DXE3.
Steps to reproduce
Create Datasnap server (Tried both DataModule & DSServerModule).
Leave default port to 211 (Have also tried several other ports (8080, 9000).
Run the server. All is OK up to here.
Create a VCL Form App.
Add a TSQLConnection to Main form.
Set driver to DataSnap.
CommunicationProtocol = tcp/ip.
DataSnapCOntext = datasnap/
HostName = localhost (have tried 127.0.0.1 and my computer's IP address).
LoginPropt = False.
Run server.
Start server.
Open in browser works correctly.
Set Connected property on TSQLConnection to true.
Socket error 10061 is generated and I cannot get past this.
Here is the stack trace.
[5110E67F]{IndySystem190.bpl} IdStack.TIdStack.RaiseSocketError (Line 771, "IdStack.pas" + 42) + $21
[5110E606]{IndySystem190.bpl} IdStack.TIdStack.RaiseLastSocketError (Line 725, "IdStack.pas" + 1) + $F
[5110E571]{IndySystem190.bpl} IdStack.TIdStack.CheckForSocketError (Line 699, "IdStack.pas" + 2) + $3
[5110A9F4]{IndySystem190.bpl} IdStackWindows.TIdStackWindows.Connect (Line 1771, "IdStackWindows.pas" + 20) + $13
[50DF5849]{IndyCore190.bpl} IdSocketHandle.TIdSocketHandle.Connect (Line 294, "IdSocketHandle.pas" + 1) + $25
[50E01CF9]{IndyCore190.bpl} IdIOHandlerStack.TIdIOHandlerStack.ConnectClient (Line 344, "IdIOHandlerStack.pas" + 52) + $A
[50E05283]{IndyCore190.bpl} IdIOHandlerSocket.TIdIOHandlerSocket.Open (Line 332, "IdIOHandlerSocket.pas" + 13) + $4
[50E01011]{IndyCore190.bpl} IdTCPClient.TIdTCPClientCustom.Connect (Line 317, "IdTCPClient.pas" + 52) + $B
[16F76AFD]{IndyIPClient190.bpl} IPPeerClient.TIdTCPClientPeerIP.Connect (Line 1166, "IPPeerClient.pas" + 0) + $5
[520AC809]{DbxClientDriver190.bpl} Data.DbxSocketChannelNative.TDBXIdTCPLayer.Open (Line 378, "Data.DbxSocketChannelNative.pas" + 27) + $5
[520AC44B]{DbxClientDriver190.bpl} Data.DbxSocketChannelNative.TDBXSocketChannel.Open (Line 149, "Data.DbxSocketChannelNative.pas" + 13) + $E
[50059970]{rtl190.bpl } System.#FreeMem (Line 4364, "System.pas" + 20) + $0
[50060DA0]{rtl190.bpl } System.#UStrClr (Line 23846, "System.pas" + 14) + $0
[520AEA09]{DbxClientDriver190.bpl} Data.DBXTransportFilter.TDBXFilterSocketChannel.SetDBXProperties (Line 712, "Data.DBXTransportFilter.pas" + 8) + $10
[520AE999]{DbxClientDriver190.bpl} Data.DBXTransportFilter.TDBXFilterSocketChannel.Open (Line 693, "Data.DBXTransportFilter.pas" + 0) + $5
[520B0897]{DbxClientDriver190.bpl} Data.DBXClient.TDBXClientConnection.DerivedOpen (Line 430, "Data.DBXClient.pas" + 5) + $8
[5214F8D7]{DbxCommonDriver190.bpl} Data.DBXCommon.TDBXConnection.Open (Line 8599, "Data.DBXCommon.pas" + 5) + $4
[5214AC72]{DbxCommonDriver190.bpl} Data.DBXCommon.TDBXConnectionFactory.GetConnection (Line 6724, "Data.DBXCommon.pas" + 14) + $5
[5214AB6D]{DbxCommonDriver190.bpl} Data.DBXCommon.TDBXConnectionFactory.GetConnection (Line 6701, "Data.DBXCommon.pas" + 0) + $5
[51392D29]{dbexpress190.bpl} Data.SqlExpr.TSQLConnection.DoConnect (Line 2490, "Data.SqlExpr.pas" + 56) + $6
[50A8AA4D]{dbrtl190.bpl} Data.DB.TCustomConnection.SetConnected (Line 3482, "Data.DB.pas" + 8) + $4
[50128326]{rtl190.bpl } System.TypInfo.SetOrdProp (Line 2583, "System.TypInfo.pas" + 21) + $1
[2110BA52]{designide190.bpl} DesignEditors.TPropertyEditor.SetOrdValue (Line 839, "DesignEditors.pas" + 2) + $E
[211564F7]{designide190.bpl} VCLEditors.TBooleanProperty.MouseUp (Line 1864, "VCLEditors.pas" + 5) + $10
[212A13CD]{vclide190.bpl} PropBox.TCustomPropListBox.ItemMouseUp (Line 1631, "PropBox.pas" + 17) + $1B
[212A15C3]{vclide190.bpl} PropBox.TCustomPropListBox.MouseUp (Line 1696, "PropBox.pas" + 1) + $D
[504634D8]{vcl190.bpl } Vcl.Controls.TControl.DoMouseUp (Line 7468, "Vcl.Controls.pas" + 2) + $28
[50463554]{vcl190.bpl } Vcl.Controls.TControl.WMLButtonUp (Line 7481, "Vcl.Controls.pas" + 9) + $6
[212A6D50]{vclide190.bpl} IDEInspListBox.TInspListBox.WMLButtonUp (Line 1632, "IDEInspListBox.pas" + 3) + $4
[50462B49]{vcl190.bpl } Vcl.Controls.TControl.WndProc (Line 7224, "Vcl.Controls.pas" + 91) + $6
[1ECD5CD1]{cxLibraryRS19.bpl} dxHooks.TdxSystemHook.ProcessHookProcs$qqriuii + $99
[1ECD5A9A]{cxLibraryRS19.bpl} dxHooks.dxSystemGetMessageHook$qqsiuii + $16
[50466E9F]{vcl190.bpl } Vcl.Controls.TWinControl.IsControlMouseMsg (Line 9807, "Vcl.Controls.pas" + 1) + $9
[50467669]{vcl190.bpl } Vcl.Controls.TWinControl.WndProc (Line 10039, "Vcl.Controls.pas" + 153) + $6
[5048AF69]{vcl190.bpl } Vcl.StdCtrls.TCustomListBox.WndProc (Line 7108, "Vcl.StdCtrls.pas" + 55) + $5
[50466CAC]{vcl190.bpl } Vcl.Controls.TWinControl.MainWndProc (Line 9751, "Vcl.Controls.pas" + 3) + $6
[501749C4]{rtl190.bpl } System.Classes.StdWndProc (Line 17010, "System.Classes.pas" + 5) + $0
[5059214F]{vcl190.bpl } Vcl.Forms.TApplication.CancelHint (Line 11117, "Vcl.Forms.pas" + 6) + $E
[50590DC3]{vcl190.bpl } Vcl.Forms.TApplication.ProcessMessage (Line 10288, "Vcl.Forms.pas" + 23) + $1
[50590E06]{vcl190.bpl } Vcl.Forms.TApplication.HandleMessage (Line 10318, "Vcl.Forms.pas" + 1) + $4
[50591141]{vcl190.bpl } Vcl.Forms.TApplication.Run (Line 10456, "Vcl.Forms.pas" + 26) + $3
How can i do this ?
Make sure the ServerContainer data module is automatically created on start-up, or create it yourself.
I was getting Socket Error #10061 with the wizard creating a DataSnap REST Client module (when testing the port 8080) on LocalHost
What I did is I ran the DataSnap REST Server application (.exe) and started it on LocalHost on port 8080. I added a new DataSnap REST Client Module. Tested the 8080 port and voilĂ  ! it worked.
Solved it by adding a TDSTCPServerTransport component to my ServerContainer data module.

Access Violation when i drop a TidSMTP on a Form

i've a problem with Delphi XE4: when i drop on a form an TIdSmtp or TIsSSLIOHandlerSocketOpenSSL i receive this error:
[511EDABF]{IndySystem180.bpl} IdStack.TIdStack.IncUsage (Line 688, "IdStack.pas" + 11) + $7
[511EEBB2]{IndySystem180.bpl} IdComponent.TIdComponent.InitComponent (Line 229, "IdComponent.pas" + 1) + $5
[50EE84A2]{IndyCore180.bpl} IdTCPConnection.TIdTCPConnection.InitComponent (Line 912, "IdTCPConnection.pas" + 1) + $2
[50EE0D99]{IndyCore180.bpl} IdTCPClient.TIdTCPClientCustom.InitComponent (Line 256, "IdTCPClient.pas" + 1) + $2
[50FC53D5]{IndyProtocols180.bpl} IdExplicitTLSClientServerBase.TIdExplicitTLSClient.InitComponent (Line 262, "IdExplicitTLSClientServerBase.pas" + 1) + $2
[50FC8E5D]{IndyProtocols180.bpl} IdMessageClient.TIdMessageClient.InitComponent (Line 643, "IdMessageClient.pas" + 1) + $2
[510B9AF9]{IndyProtocols180.bpl} IdSMTPBase.TIdSMTPBase.InitComponent (Line 193, "IdSMTPBase.pas" + 1) + $2
[510BB47D]{IndyProtocols180.bpl} IdSMTP.TIdSMTP.InitComponent (Line 383, "IdSMTP.pas" + 1) + $2
[511CF547]{IndySystem180.bpl} IdBaseComponent.TIdInitializerComponent.Create (Line 186, "IdBaseComponent.pas" + 4) + $4
[21D64B2B]{delphicoreide180.bpl} CompPalMgr.TComponentPalettePageItemDelegate.CreateComponent (Line 2756, "CompPalMgr.pas" + 2) + $7
[2113FFAB]{designide180.bpl} ComponentDesigner.TComponentRoot.DoCreateComponent (Line 2359, "ComponentDesigner.pas" + 12) + $17
[21145796]{designide180.bpl} ComponentDesigner.TComponentRoot.CreateCurrentComponent (Line 4450, "ComponentDesigner.pas" + 2) + $32
[2115DBAA]{designide180.bpl} Surface.TDesignSurface.CreateItem (Line 195, "Surface.pas" + 1) + $11
[2111193A]{designide180.bpl} Designer.TDesigner.DoDragCreate (Line 794, "Designer.pas" + 1) + $F
[211121E8]{designide180.bpl} Designer.TDesigner.DragEnd (Line 974, "Designer.pas" + 19) + $3
[21114880]{designide180.bpl} Designer.TDesigner.MouseUp (Line 1763, "Designer.pas" + 1) + $2
[51FEEE82]{vcldesigner180.bpl} VCLSurface.MouseEvent (Line 3187, "VCLSurface.pas" + 45) + $11
[5005F7EB]{rtl180.bpl } System.TMonitor.Exit (Line 16933, "System.pas" + 2) + $7
[51FEFA6F]{vcldesigner180.bpl} VCLSurface.TVclDesignSurface.IsDesignMsg (Line 3448, "VCLSurface.pas" + 48) + $6
[50582B07]{vcl180.bpl } Vcl.Forms.TApplication.DispatchAction (Line 11494, "Vcl.Forms.pas" + 9) + $C
[0B6A7E30]{IDEFixPack.dll} VCLDesignerGuideLinesHideFix.IsDesignMsg + $94
[5045287F]{vcl180.bpl } Vcl.Controls.TControl.WndProc (Line 7137, "Vcl.Controls.pas" + 4) + $21
[50170090]{rtl180.bpl } System.Classes.StdWndProc (Line 16860, "System.Classes.pas" + 8) + $0
[50456DEB]{vcl180.bpl } Vcl.Controls.TWinControl.IsControlMouseMsg (Line 9807, "Vcl.Controls.pas" + 1) + $9
[504575B5]{vcl180.bpl } Vcl.Controls.TWinControl.WndProc (Line 10039, "Vcl.Controls.pas" + 153) + $6
[505777F9]{vcl180.bpl } Vcl.Forms.TCustomForm.WndProc (Line 4388, "Vcl.Forms.pas" + 201) + $5
[51FF84BF]{vcldesigner180.bpl} VCLFormContainer.TControlSizer.ControlWndProc (Line 311, "VCLFormContainer.pas" + 33) + $C
[50456BF8]{vcl180.bpl } Vcl.Controls.TWinControl.MainWndProc (Line 9751, "Vcl.Controls.pas" + 3) + $6
[50170090]{rtl180.bpl } System.Classes.StdWndProc (Line 16860, "System.Classes.pas" + 8) + $0
[50582213]{vcl180.bpl } Vcl.Forms.TApplication.CancelHint (Line 11117, "Vcl.Forms.pas" + 6) + $E
[50580E87]{vcl180.bpl } Vcl.Forms.TApplication.ProcessMessage (Line 10288, "Vcl.Forms.pas" + 23) + $1
[50580ECA]{vcl180.bpl } Vcl.Forms.TApplication.HandleMessage (Line 10318, "Vcl.Forms.pas" + 1) + $4
[50581205]{vcl180.bpl } Vcl.Forms.TApplication.Run (Line 10456, "Vcl.Forms.pas" + 26) + $3
Anyone can help me?
With other components like IdUserPassProvider or IdSASLPlain work fine.
Regards
It is hard to diagnose your problem without seeing the actual error message. Is it an actual EAccessViolation exception, or is it a different type of exception? Just because an exception is raised does not guarantee it is actually an EAccessViolation unless it really is an Access Violation.
TIdStack.IncUsage() ensures that Indy's global GStack object exists. That object is what provides access to all of the low-level platform-specific socket API functions used throughout Idny. IncUsage() itself is a class method, so it is not called on a TIdStack object instance, so merely calling IncUsage() itself is not the cause of the exception.
Internally, IncUsage() uses three global variables in the IdStack unit:
GStackCriticalSection: TIdCriticalSection
GInstanceCount: LongWord
GStackClass: TIdStackClass
All three variables are initialized to 0/nil in their respective declarations, and then GStackClass and GStackCriticalSection are assigned/constructed in the initialization section of the IdStack unit.
An exception can only occur if one of those variables is invalid at the time IncUsage() is called (unless the exception is coming from a TIdStack constructor, but I do not see that in your call stack).
Perhaps something in your project is preventing the initialization from being called, causing IncUsage() to crash when it tries to enter the GStackCriticalSection lock (but I do not see TIdCriticalSection.Enter in your call stack)? There is an Assert() to make sure GStackCriticalSection is not nil before it is used, but maybe your copy of Indy was compiled with asserts disabled?
thanks for the support,
I solved the problem but I have not yet understood why.
the problem is in the Design package; I attach the differences between the dproj that working and the dproj with the error.
I still have not figured out if it depends on a single package or more, anyway, enabling all packages work correctly.
Thanks again,
I go back to replicate if i find the package that generates the error.

List Index out of bounds in inherited form

I want migrate a old Delphi 6 project to Delphi XE2 and ReportBuilder 14.
In my project I have a user component TReportBase inherited from TppReport, there are 4 or 5 new properties I need. I have base form TBaseForm with a TReportBase component and some other controls. Many other forms inherit from this TBaseForm.
This behaviour worked for me in Delphi 6, and, I tested too with good results in Delphi 7 and Delphi 2007. But in Delphi XE2
I found problems in Preview and in the Design.
When I add a Tpplabel I receive a List Index out of bounds error and this:
[500A3234]{rtl160.bpl } System.Classes.TList.Insert (Line 3932, "System.Classes.pas" + 5) + $1
[11CF1E98]{rbRCL1416.bpl} Ppclass.TppBand.AddObject + $84
[11CF5700]{rbRCL1416.bpl} Ppclass.TppComponent.SetBand + $54
[11BDCC80]{rbRCL1416.bpl} Ppctrls.TppCustomText.SetBand + $0
[11ED079A]{rbIDE1416.bpl} Ppdesignworkspacecontroller.TppDesignWorkspaceController.AddComponent + $E6
[11ED17CA]{rbIDE1416.bpl} Ppdesignworkspacecontroller.TppDesignWorkspaceController.ehWorkspace_MouseUp + $BA
[11AD6627]{rbRTL1416.bpl} Ppmulticast.TppMulticastEvent.Notify + $27
[11EBEF56]{rbIDE1416.bpl} Ppdesignerworkspace.TppWorkspace.MouseUp + $4A
[503331A8]{vcl160.bpl } Vcl.Controls.TControl.DoMouseUp (Line 7448, "Vcl.Controls.pas" + 2) + $28
[50333224]{vcl160.bpl } Vcl.Controls.TControl.WMLButtonUp (Line 7461, "Vcl.Controls.pas" + 9) + $6
[50332814]{vcl160.bpl } Vcl.Controls.TControl.WndProc (Line 7204, "Vcl.Controls.pas" + 91) + $6
[11FC6660]{rbIDE1416.bpl} Ppsynuedit.TSynEditPlugin + $70
[503369AB]{vcl160.bpl } Vcl.Controls.TWinControl.IsControlMouseMsg (Line 9745, "Vcl.Controls.pas" + 1) + $9
[50337163]{vcl160.bpl } Vcl.Controls.TWinControl.WndProc (Line 9976, "Vcl.Controls.pas" + 152) + $6
[503367B8]{vcl160.bpl } Vcl.Controls.TWinControl.MainWndProc (Line 9689, "Vcl.Controls.pas" + 3) + $6
[500B5FCC]{rtl160.bpl } System.Classes.MakeObjectInstance (Line 13921, "System.Classes.pas" + 0) + $0
[504524EF]{vcl160.bpl } Vcl.Forms.TApplication.ProcessMessage (Line 10164, "Vcl.Forms.pas" + 23) + $1
[50452532]{vcl160.bpl } Vcl.Forms.TApplication.HandleMessage (Line 10194, "Vcl.Forms.pas" + 1) + $4
[50452865]{vcl160.bpl } Vcl.Forms.TApplication.Run (Line 10331, "Vcl.Forms.pas" + 26) + $3
Thanks in advance.
lmir

Resources