[fpc-pascal] Problems with GetMem

Darius Blaszyk dhkblaszyk at zeelandnet.nl
Sun Apr 10 21:32:15 CEST 2011


On Apr 10, 2011, at 3:38 PM, Jonas Maebe wrote:

> 
> On 10 Apr 2011, at 15:02, Darius Blaszyk wrote:
> 
>> You're right that there seems to be a memleak somewhere, but it's something strange, heaptrc reports 1 unfreed block and 0bytes unfreed. Never seen this before.
> 
> It's because you have memory corruption. Then heaptrc cannot give accurate statistics.
> 
>> I will test with valgrind this afternoon to see if I can get some wiser from it.
>> BTW, for those interested, I ported some code that allows bitmapped freetype fonts be used in OpenGL this works a lot simpler than using the freetype support from fcl-image. If you wish you can find the code here: http://scandraid.svn.sourceforge.net/viewvc/scandraid/src/branches/font/
>> 
>> Darius
>> 
>>> bitmappedglfont
>> Marked memory at $0A5AF068 invalid
>> Wrong signature $9BC362D6 instead of D1853A22
>> $0040CFBB
>> $00407D08
>> $00401948  KEYPRESSED,  line 80 of BitmappedGLFont.pas
>> $0984E054
>> $0984D5DE
>> $7E418734
>> $7E418816
>> $7E42A013
>> $7E42A039
> 
> This shows that you have memory corruption somewhere ("Marked memory at ... invalid").

Valgrind made it possible to solve the memory corruption bug. It appeared that I just did not reserve enough for the textures. After solving this, the SIGSEGV also disappeared like you predicted. Thanks Jonas!

Darius


More information about the fpc-pascal mailing list