Skip to content
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

Access Violation at designtime when RootNodeCount is >0 #702

Closed
MikaelBox opened this issue Mar 16, 2017 · 9 comments
Closed

Access Violation at designtime when RootNodeCount is >0 #702

MikaelBox opened this issue Mar 16, 2017 · 9 comments

Comments

@MikaelBox
Copy link

VT_fail.zip
Only one form with virtualtree. In design mode, IDE crashes on open this form or close this form. Access violation in module "borlndmm.dll".
RAD Studio 10.1 and VirtualTree 6.5.0 (older version crashes too (6.3.2))

@the-Arioch
Copy link

the-Arioch commented Mar 17, 2017

RAD Studio 10.1 had problems with FastMM i recall....
Maybe BorlandMM.dll just exposes the same Delphi bug.

pleriche/FastMM4#18


Anyway, BorlandMM.dll seems rather outdated aproach, why ever use it anyway ?

@MikaelBox
Copy link
Author

FastMM is not installed.

@the-Arioch
Copy link

Does not matter, the bug is in Delphi RTL, and it might expose itself with any non-default, additional MM.
So, try to get rid of BorlndMM.dll

PS. BTW, buillt-in MM is also an older fork of FastMM,

@joachimmarder
Copy link
Contributor

In my case the IDE crashes only when I close the form. This is the call stack:

[50039ED7]{borlndmm.dll} borlndmm.SysFreeMem (Line 2918, "GETMEM.INC" + 14) + $0
[5006896D]{rtl240.bpl  } System.UnicodeToUtf8 (Line 37472, "System.pas" + 19) + $16
[5016E982]{rtl240.bpl  } System.Classes.TComponent.Notification (Line 16004, "System.Classes.pas" + 8) + $1D
[50060744]{rtl240.bpl  } System.TMonitor.TryEnter (Line 18445, "System.pas" + 10) + $0
[50067FF6]{rtl240.bpl  } System.TInstBucket.RemoveInstItem (Line 36922, "System.pas" + 1) + $4
[50067528]{rtl240.bpl  } System.@IntfClear (Line 36349, "System.pas" + 10) + $0
[50063DA4]{rtl240.bpl  } System.@FinalizeArray (Line 31491, "System.pas" + 139) + $0
[50063C70]{rtl240.bpl  } System.@FinalizeRecord (Line 31198, "System.pas" + 25) + $0
[500601B8]{rtl240.bpl  } System.TMonitor.Destroy (Line 18078, "System.pas" + 0) + $0
[5005F839]{rtl240.bpl  } System.TObject.CleanupInstance (Line 16698, "System.pas" + 37) + $0
[5005A1A8]{rtl240.bpl  } System.@FreeMem (Line 4662, "System.pas" + 20) + $0
[50067528]{rtl240.bpl  } System.@IntfClear (Line 36349, "System.pas" + 10) + $0
[50063DA4]{rtl240.bpl  } System.@FinalizeArray (Line 31491, "System.pas" + 139) + $0
[50063C70]{rtl240.bpl  } System.@FinalizeRecord (Line 31198, "System.pas" + 25) + $0
[500601B8]{rtl240.bpl  } System.TMonitor.Destroy (Line 18078, "System.pas" + 0) + $0
[5005F839]{rtl240.bpl  } System.TObject.CleanupInstance (Line 16698, "System.pas" + 37) + $0
[5005A1A8]{rtl240.bpl  } System.@FreeMem (Line 4662, "System.pas" + 20) + $0
[5005F618]{rtl240.bpl  } System.TObject.FreeInstance (Line 16461, "System.pas" + 2) + $2
[5005FF0A]{rtl240.bpl  } System.@ClassDestroy (Line 17833, "System.pas" + 0) + $2
[5017B9B7]{rtl240.bpl  } System.Classes.{System.Generics.Collections}TList<System.Classes.TComponent>.Destroy (Line 4159, "System.Generics.Collections.pas" + 3) + $6
[5005F79C]{rtl240.bpl  } System.TObject.Free (Line 16529, "System.pas" + 1) + $4
[5016E905]{rtl240.bpl  } System.Classes.TComponent.RemoveNotification (Line 15983, "System.Classes.pas" + 13) + $15
[525BEF95]{vcldesigner240.bpl} VCLSurface.TVclDesignSurface.Destroy (Line 2917, "VCLSurface.pas" + 11) + $6
[5016E91E]{rtl240.bpl  } System.Classes.TComponent.RemoveFreeNotification (Line 15989, "System.Classes.pas" + 1) + $4
[525CD463]{vcldesigner240.bpl} VCLFormContainer.TEmbeddedFormHostWrapper.Destroy (Line 1844, "VCLFormContainer.pas" + 2) + $3
[5006876F]{rtl240.bpl  } System.TInterfacedObject._Release (Line 37333, "System.pas" + 7) + $7
[50067528]{rtl240.bpl  } System.@IntfClear (Line 36349, "System.pas" + 10) + $0
[525D0E6C]{vcldesigner240.bpl} VCLFormDesigner.TVCLRootDesigner.DeinitializeDesigner (Line 576, "VCLFormDesigner.pas" + 6) + $6
[21293357]{designide240.bpl} ComponentDesigner.TComponentRoot.InternalDeinitializeDesigner (Line 4973, "ComponentDesigner.pas" + 18) + $5
[21295FDD]{designide240.bpl} ComponentDesigner.TComponentRoot.Close (Line 5914, "ComponentDesigner.pas" + 5) + $5
[21F700A4]{delphicoreide240.bpl} DelphiModule.TPascalCodeMgrModHandler.Destroyed (Line 756, "DelphiModule.pas" + 11) + $5
[208EBF0D]{coreide240.bpl} DocModul.TCodeIDocModule.NotifyDestroyed (Line 2437, "DocModul.pas" + 1) + $8
[2126A039]{designide240.bpl} ToolUtils.ForEach (Line 99, "ToolUtils.pas" + 5) + $F
[208EBE7E]{coreide240.bpl} DocModul.TCodeIDocModule.NotifyDestruction (Line 2421, "DocModul.pas" + 1) + $3
[208E8E4C]{coreide240.bpl} DocModul.TDocModule.BeforeDestruction (Line 993, "DocModul.pas" + 12) + $2B
[5005FF69]{rtl240.bpl  } System.@BeforeDestruction (Line 17873, "System.pas" + 10) + $0
[20712232]{coreide240.bpl} SourceModule.TSourceModule.Create (Line 426, "SourceModule.pas" + 30) + $C4
[5005F79C]{rtl240.bpl  } System.TObject.Free (Line 16529, "System.pas" + 1) + $4
[208EA03A]{coreide240.bpl} DocModul.WalkDependencies (Line 1628, "DocModul.pas" + 7) + $E
[208EA085]{coreide240.bpl} DocModul.WalkDependencies (Line 1634, "DocModul.pas" + 13) + $E
[208E9177]{coreide240.bpl} DocModul.TDocModule.Close (Line 1107, "DocModul.pas" + 10) + $5
[208E9CEE]{coreide240.bpl} DocModul.TDocModule.SaveAndClose (Line 1467, "DocModul.pas" + 2) + $8
[208EB4D0]{coreide240.bpl} DocModul.TCodeIDocModule.GetViewCount (Line 2143, "DocModul.pas" + 0) + $0
[207DEF05]{coreide240.bpl} EditorBuffer.TEditBuffer.Save (Line 2728, "EditorBuffer.pas" + 2) + $7
[207E322F]{coreide240.bpl} EditorBuffer.TEditView.SaveAndClose (Line 5010, "EditorBuffer.pas" + 1) + $8
[20830BBC]{coreide240.bpl} EditorControl.TCustomEditControl.CloseView (Line 1926, "EditorControl.pas" + 8) + $5
[207E3E47]{coreide240.bpl} EditorBuffer.TEditView.TryCloseView (Line 5500, "EditorBuffer.pas" + 2) + $C
[2081FF87]{coreide240.bpl} EditorForm.TEditWindow.UpdateIncrSearchText (Line 4786, "EditorForm.pas" + 37) + $23
[50AA4097]{vcl240.bpl  } Vcl.Controls.TControl.Click (Line 7429, "Vcl.Controls.pas" + 9) + $8
[50C36358]{vcl240.bpl  } Vcl.Buttons.TSpeedButton.Click (Line 1550, "Vcl.Buttons.pas" + 0) + $0
[50C36342]{vcl240.bpl  } Vcl.Buttons.TSpeedButton.MouseUp (Line 1543, "Vcl.Buttons.pas" + 25) + $C
[50AA44D0]{vcl240.bpl  } Vcl.Controls.TControl.DoMouseUp (Line 7557, "Vcl.Controls.pas" + 2) + $28
[50AA4550]{vcl240.bpl  } Vcl.Controls.TControl.WMLButtonUp (Line 7570, "Vcl.Controls.pas" + 9) + $6
[50AA3B2A]{vcl240.bpl  } Vcl.Controls.TControl.WndProc (Line 7313, "Vcl.Controls.pas" + 91) + $6
[50AA3764]{vcl240.bpl  } Vcl.Controls.TControl.Perform (Line 7091, "Vcl.Controls.pas" + 10) + $8
[50AA7F20]{vcl240.bpl  } Vcl.Controls.TWinControl.IsControlMouseMsg (Line 9920, "Vcl.Controls.pas" + 15) + $29
[50AA84D6]{vcl240.bpl  } Vcl.Controls.TWinControl.WndProc (Line 10089, "Vcl.Controls.pas" + 104) + $6
[50AA7C94]{vcl240.bpl  } Vcl.Controls.TWinControl.MainWndProc (Line 9850, "Vcl.Controls.pas" + 3) + $6
[50170C64]{rtl240.bpl  } System.Classes.StdWndProc (Line 17178, "System.Classes.pas" + 8) + $0
[50063C70]{rtl240.bpl  } System.@FinalizeRecord (Line 31198, "System.pas" + 25) + $0
[50063DA4]{rtl240.bpl  } System.@FinalizeArray (Line 31491, "System.pas" + 139) + $0
[50063C70]{rtl240.bpl  } System.@FinalizeRecord (Line 31198, "System.pas" + 25) + $0
[50BEFFDD]{vcl240.bpl  } Vcl.Forms.TApplication.CancelHint (Line 11363, "Vcl.Forms.pas" + 6) + $D
[50BEEC6F]{vcl240.bpl  } Vcl.Forms.TApplication.ProcessMessage (Line 10534, "Vcl.Forms.pas" + 23) + $1
[50BEECB2]{vcl240.bpl  } Vcl.Forms.TApplication.HandleMessage (Line 10564, "Vcl.Forms.pas" + 1) + $4
[50BEEFE5]{vcl240.bpl  } Vcl.Forms.TApplication.Run (Line 10702, "Vcl.Forms.pas" + 26) + $3

It however does not contain any Virtual TreeView code. Is your call stack similar?

@joachimmarder
Copy link
Contributor

So, try to get rid of BorlndMM.dll

@the-Arioch: I don't think BorlandMM.dll is actively used by the sample or Virtual TreeView, but only by RAD Studio.

@joachimmarder
Copy link
Contributor

joachimmarder commented Mar 18, 2017

I added a minmized version of the project:
Minimal.zip

It seems that this is sufficient to provoke the AV:

  object vstCalendar: TVirtualStringTree
    NodeDataSize = 4
    RootNodeCount = 7
  end

Setting NodeDataSize to its default value 0 prevents the AV.

@joachimmarder joachimmarder changed the title borlndmm.dll fail Access Violation at designtime when RootNodeCount is >0 Mar 18, 2017
@joachimmarder
Copy link
Contributor

Reopening issue because this fix causes some projects to fail at runtime if their form was opened in the IDE. Example: GeneralAbilities.dfm in Advanced.dproj.

Reason: A NodeDataSize of 4 instead of no value is written to the DFM, which prevents ValidateNodeDataSize() to be called.

joachimmarder pushed a commit that referenced this issue Mar 28, 2017
…aSize of 4 was written to DFM files which prevented the OnGetNodeDataSize event from being fired.

* Fixed issue that selection was not cleared in multi-selection scenario on simple mouse click on a different node.
@the-Arioch
Copy link

the-Arioch commented Mar 28, 2017

Hmmm.... indeed. Merely opening your MINIMAL project in my XE2 and then closing it WITHOUT SAVE kills my IDE - it gets into invinite AV loop within vcl160bpl

So your fixe basically moved IDE crash from "on open" to "on close" :-)

i meant previous, 4bd18a2 commit

@joachimmarder
Copy link
Contributor

So your fixe basically moved IDE crash from "on open" to "on close" :-)

At least not in 10.1 Berlin, the AV disappeared reliably here.

ValtsS pushed a commit to ValtsS/Virtual-TreeView that referenced this issue Jan 25, 2019
…tNodeCount is >0

# Conflicts:
#	CHANGES.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants