View Issue Details

IDProjectCategoryView StatusLast Update
0004716JEDI VCL00 JVCL Componentspublic2009-04-29 14:38
ReporterkdkAssigned Toobones 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.36 
Target VersionFixed in Version3.37 
Summary0004716: Crash in TJvDockTree.DoLoadZone (Docking)
DescriptionLastZone is nil on the line 3561 in JvDockTree.pas:

procedure TJvDockTree.DoLoadZone(Stream: TStream);
var
  Level, LastLevel, I: Integer;
  Zone, LastZone, NextZone: TJvDockZone;
begin
  LastLevel := 0;
  LastZone := nil;
  while True do
  begin
    with Stream do
    begin
      if Read(Level, SizeOf(Level)) <> SizeOf(Level) then
        Break;
      if Level = TreeStreamEndFlag then
        Break;
      Zone := FDockZoneClass.Create(Self);
      CustomLoadZone(Stream, Zone);
      if Zone = nil then
        Continue;
    end;
    if Level = 0 then
      FTopZone := Zone
    else
    if Level = LastLevel then
    begin
      LastZone.NextSibling := Zone;
      Zone.FPrevSibling := LastZone;
      Zone.FParentZone := LastZone.FParentZone;
    end
    else
    if Level > LastLevel then
    begin
      LastZone.ChildZones := Zone; <<<<<<<<<<<<<<<<<<<<<<<< here is LastZone nil
      Zone.FParentZone := LastZone;
    end
    else
TagsNo tags attached.

Activities

obones

2009-03-24 11:44

administrator   ~0015342

Under which conditions?
Please provide the zipped sources of a sample application showing this.

kdk

2009-03-24 11:59

reporter   ~0015344

Hello,

the app is not quite small. Is there anything you can do without the full application source code?

Tim

obones

2009-03-24 12:13

administrator   ~0015345

No we can't, especially since we found out that many errors seen in large applications are not reproducible in small ones, because they are caused by code that is not ours but the user's.
Please try to reproduce in a small application and we'll look into it then.

AHUser

2009-03-24 22:31

developer   ~0015347

I have committed code (rev. 12259) that should a fix this bug. But because I can't reproduce it, I'm not able to guarantee that the fix works for your case.

My guess is that the stream contains malformed data and the first "Read(Level, SizeOf(Level))" doesn't read "0" into Level but a different value. With my fix this is now catched.
http://jvcl.svn.sourceforge.net/viewvc/jvcl/trunk/jvcl/run/JvDockTree.pas?view=markup

obones

2009-04-29 14:38

administrator   ~0015467

Assuming this is fixed.

Issue History

Date Modified Username Field Change
2009-03-24 10:28 kdk New Issue
2009-03-24 11:44 obones Note Added: 0015342
2009-03-24 11:44 obones Status new => feedback
2009-03-24 11:59 kdk Note Added: 0015344
2009-03-24 12:13 obones Note Added: 0015345
2009-03-24 22:31 AHUser Note Added: 0015347
2009-04-29 14:38 obones Note Added: 0015467
2009-04-29 14:38 obones Status feedback => resolved
2009-04-29 14:38 obones Fixed in Version => Daily / SVN
2009-04-29 14:38 obones Resolution open => fixed
2009-04-29 14:38 obones Assigned To => obones