PDA

View Full Version : memory corruption


Ludek
13-Mar-2009, 02:23 PM
scenario:
delphi 2009
eurekalog 6.0.19 rc4
eurekalog in own runtime package, WITHOUT reference to delphi packages, just following:

contains
ExceptionLog;

(delphi warnings cancelled)

main executable with following code:


uses generics.collections;

{$R *.dfm}

type
TEnum = (e1, e2);
TTestRec = record
d: double;
b: tenum;
end;
TRecord = TPair<integer, TTestRec>;
TRecords = TDictionary<integer, TTestRec>;

procedure TForm8.Button1Click(Sender: TObject);
var
records: TRecords;
rec: TRecord;
begin
records := TRecords.Create(4);
for rec in records do
assert(false);
end;


the executable uses runtime packages - only the named runtime package, no delphi packages.

the executable says "assertion failed" - the code "assert" gets called, although the dictionary is empty! the record "rec" contains some invalid data.

it happens only with eurekalog activated (perhaps in both projects, package and the executable) and more regularly with the "catch memory leaks" activated. (i can reproduce it in the sample only with "catch memory leaks" on, but in my project it happens also without this option active.

Please, could you have a look at it? thanks, Ludek.

Unregistered
16-Mar-2009, 11:02 PM
Have you tried the 6.0.19 release?

Ludek
17-Mar-2009, 08:11 AM
Yes, I did, the bug persists. But, it is really bug in TDictionary.TPairEnumerator.MoveNext. Unbelievable, how buggy could such basic(!!!!) things be in d2009, even with update 2!

Sorry for this thread, there's nothing bad in EL, it is just the d2009 generics.collection unit. d2009 really sucks.

Alex
17-Mar-2009, 02:32 PM
Personally I do believe in D2009 :) Yes there are many stupid bugs (did you know that D2009 considers us all as Far-East users? ;) ), but I did not expected that moving to unicode can be done in such short-terms (1 year?) properly. The bugs in other parts (not related to unicode) are probably done due to this rush.
Let's hope that the next Delphi version (or may be SP) will fix these issues. Just do not forget to report bugs on QC and vote for ones that you cares about.