Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005261 [JEDI VCL] 00 JVCL Components crash have not tried 2010-06-08 18:13 2011-09-21 14:10
Reporter korecek View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0005261: Latest JVCL SVN, TJvFormStorage and AV
Description Hi,
after long time under released JCL & JVCLI decided to switch
into latest SVN of both (JCL & JVCL).

I decided to start with BCB6 (C++ Builder V6) under Win XP.

Installation of the new SVN with new package names was without
problems but I found problem with AV (Access violation) after
compilation of an old project. This AV was never generated with
older JEDI release (see above).

I decided to little investigate and I found following problem:

- AV is generated when the TJvFormStorage component is activated
  and during closing of form where the TJvFormStorage is placed.

I add my old example Example and also some videos which could show little more.
Additional Information   First I thought that it have connection with linker setting - in
  "Project/Options" here - "Use dynamic RTL" under "Linker"
  Tab is Checked but....
  ...I also installed latest JCL & JVCL SVN
  on another PC with BCB6 and to be fair I must
  say that:
  1. My supposition regarding "Project/Options"
   and "Use dynamic RTL" under "Linker" Tab
   is not in all probability true because
   AV behaviour on second PC is different.
   AV is generated any time.
  2. It seems to me that AV is related to the
   Borlad C++ Builder 6 because BDS2006 don't
   generate AV (BDS2006 is AV less).
  3. Older JVCL release with old package names
   don't generate AV.
Tags No tags attached.
Attached Files 7z file icon AppStorageFIni2.7z [^] (4,117 bytes) 2010-06-08 18:13
7z file icon AppIniFStorageVideo.7z [^] (592,009 bytes) 2010-06-08 18:13

- Relationships
related to 0005249resolvedobones JvPropertyStorage bug on CBuilder 6 

-  Notes
(0017480)
vez (reporter)
2010-06-09 09:44

Will see my issue 005246
(0017481)
vez (reporter)
2010-06-09 09:45

Sorry, 5249
(0017543)
SurFan (reporter)
2010-07-31 19:21

Assigning PropertyName to a tep storage seems to cure this problem too (at least in delphi6):
procedure TJvPropertyStorage.WriteProperty(const APath, AStorageName: string; const PersObj: TPersistent; const PropName: {$IFDEF RTL200_UP}ShortString{$ELSE}string{$ENDIF RTL200_UP});
var
  sTempPropName: string;
begin
  sTempPropName := string(PropName);
  if Assigned(AppStorage) then
    if (PropType(PersObj, sTempPropName) = tkClass) and (GetObjectProp(PersObj, sTempPropName) is TComponent) then
      AppStorage.WriteString(AppStorage.ConcatPaths([APath, AppStorage.TranslatePropertyName(PersObj, AStorageName, False)]), TComponent(GetObjectProp(PersObj, sTempPropName)).Name)
    else
      AppStorage.WriteProperty(AppStorage.ConcatPaths([APath, AppStorage.TranslatePropertyName(PersObj, AStorageName, False)]), PersObj, sTempPropName, True);
end;
(0017914)
fegyvej (reporter)
2010-10-17 11:41

Just run into the same problem because of upgrade also.

I think the problem is caused by the string() typecast of PropName which is declared as ShortString in the header.

Delphi help:
A ShortString is 0 to 255 characters long. While the length of a ShortString can change dynamically, its memory is a statically allocated 256 bytes;

By typecasting it to string, probably delphi starts to handle it dynamically and frees and reallocates its memory as needed and on next call fastmm reported to me that the variable is already freed.
(0017915)
fegyvej (reporter)
2010-10-17 11:42

I removed the string() typecasts and the memory problems are gone.
(0018240)
korecek (reporter)
2010-12-08 14:52

I just tested SurFan's suggestion under BCB6, BDS2006 and RAD Studio 2010.
Installation and tested program without problems in all above mentioned versions.
Please could you implement it (even) temporarily before final solution will be done?
(0018658)
obones (administrator)
2011-06-08 12:25

A fix has been put in SVN

- Issue History
Date Modified Username Field Change
2010-06-08 18:13 korecek New Issue
2010-06-08 18:13 korecek File Added: AppStorageFIni2.7z
2010-06-08 18:13 korecek File Added: AppIniFStorageVideo.7z
2010-06-09 09:44 vez Note Added: 0017480
2010-06-09 09:45 vez Note Added: 0017481
2010-06-09 10:06 obones Relationship added related to 0005249
2010-06-09 10:06 obones Assigned To => obones
2010-06-09 10:07 obones Status new => assigned
2010-07-31 19:21 SurFan Note Added: 0017543
2010-10-17 11:41 fegyvej Note Added: 0017914
2010-10-17 11:42 fegyvej Note Added: 0017915
2010-12-08 14:52 korecek Note Added: 0018240
2011-06-08 12:25 obones Note Added: 0018658
2011-06-08 12:25 obones Status assigned => resolved
2011-06-08 12:25 obones Fixed in Version => Daily / SVN
2011-06-08 12:25 obones Resolution open => fixed
2011-09-21 14:10 obones Fixed in Version Daily / SVN => 3.45


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker