View Issue Details

IDProjectCategoryView StatusLast Update
0006479JEDI VCL00 JVCL Componentspublic2015-12-10 19:34
ReporterAriochAssigned ToAHUser 
Status resolvedResolutionfixed 
PlatformXE2OSOS Version
Product VersionDaily / GIT 
Target VersionDaily / GITFixed in VersionDaily / GIT 
Summary0006479: Crash in TDataSet due to bug in TJvDbGrid
Descriptioni somewhat frozen at 2013 GIT version with few fixes.
But for what i can see there was no change for it.

In some conditions JvDbGrid might cause AV in TDataSet

Bug is attempt to recreate the control when there is none and when the dataset is in process of being closed.

Line 4115 TJvDBGrid.DoAutoSizeColumns

Proposed fix: insert there: "if WindowHandle = 0 then exit;"
Steps To ReproduceXE2 Win32, UnifiedIB (UIBDataSet) -> DataSource -> TJvDBUltimGrid

   UibDataSet.SQL := .... with ORDER BY

   read saved sort order
   JvDBUltimGrid.Sort ( saved sorted fields )

    ....from there it goes into OnUserSort and closes the dataset.
    ....from there it goes into TJvDBGrid.DoAutoSizeColumns
    ....the 7th line of the procedure is "AvailableWidth := ClientWidth;" calls "VCL.TControl.HandleNeeded" // while WindowHandle=0 !!! calls RecreateWnd calls re-enter into Auto-Width-Columns sequence when TDataset is half-closed ( Datalink.Active = true but DataSet.Active = false !!! ) makes fetching fields and their values calls TDataSet.ActiveRecord when FBuffers dyn-array is nil -> AV

Additional InformationThe proposed fix avoids fitting columns until the grid is visualized normal way.
And anyway, there is just no point to o on with complex and heavy autofitting when there is no real window created yet!
TagsNo tags attached.



2015-12-10 19:34

developer   ~0021249

Fixed in master branch.

I added that while csLoading is set, the method is also skipped, what reduces the amount of unnecessary work.

Issue History

Date Modified Username Field Change
2015-12-10 15:26 Arioch New Issue
2015-12-10 19:34 AHUser Note Added: 0021249
2015-12-10 19:34 AHUser Status new => resolved
2015-12-10 19:34 AHUser Fixed in Version => Daily / GIT
2015-12-10 19:34 AHUser Resolution open => fixed
2015-12-10 19:34 AHUser Assigned To => AHUser