View Issue Details

IDProjectCategoryView StatusLast Update
0017456LazarusLCLpublic2010-11-23 08:14
ReporterJuha Manninen Assigned ToPaul Ishenin  
Status closedResolutionfixed 
Product Version0.9.29 (SVN) 
Target Version0.9.30Fixed in Version0.9.29 (SVN) 
Summary0017456: Assertion in ImageList fails on 64-bit Linux
DescriptionIn lcl/include/ :

procedure TCustomImageList.AllocData(ACount: Integer);
  n: Integer;
  Assert(FAllocCount >= FCount, 'Less space allocated than images');

The assertion above fails when starting Lazarus, compiled with -Sa.
This happens only on 64-bit system. Tested on Fedora 13 Linux.
Apparently the assertion itself is correct so there is a memory corruption, too.
TagsNo tags attached.
Fixed in Revision28397
Attached Files


related to 0017999 closedMartin Friebe Remove a nonsense assertion in synedit 


Juha Manninen

2010-11-20 13:56

developer   ~0043299

Ok, please change the assertion to:

  Assert(FAllocCount >= FCount-1, 'Less space allocated than images');

so, subtract 1 from FCount because it is incremented in advance.

Other option is to remove this assertion completely because the code seems to be correct otherwise.
In general assertions are useful and should be used more. They are better than exceptions for the kind of errors that should never happen because they don't add code to the optimized release version.

Juha Manninen

2010-11-21 10:19

developer   ~0043325

It is line 177 of
The change is also included in the patch for the related issue.
However it is a very small change, just 2 chars.

Paul Ishenin

2010-11-22 08:08

manager   ~0043349

ok. please close if ok.

Issue History

Date Modified Username Field Change
2010-09-21 17:44 Juha Manninen New Issue
2010-09-21 17:44 Juha Manninen LazTarget => -
2010-10-29 11:11 Vincent Snijders LazTarget - => 0.9.30
2010-10-29 11:11 Vincent Snijders Status new => acknowledged
2010-10-29 11:11 Vincent Snijders Target Version => 0.9.30
2010-11-20 13:56 Juha Manninen Note Added: 0043299
2010-11-20 14:40 Juha Manninen Relationship added related to 0017999
2010-11-21 10:19 Juha Manninen Note Added: 0043325
2010-11-22 08:08 Paul Ishenin Fixed in Revision => 28397
2010-11-22 08:08 Paul Ishenin Status acknowledged => resolved
2010-11-22 08:08 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-11-22 08:08 Paul Ishenin Resolution open => fixed
2010-11-22 08:08 Paul Ishenin Assigned To => Paul Ishenin
2010-11-22 08:08 Paul Ishenin Note Added: 0043349
2010-11-23 08:14 Juha Manninen Status resolved => closed