<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 10, 2011, at 12:24 AM, Jonas Maebe wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On 10 Apr 2011, at 00:20, <<a href="mailto:dhkblaszyk@zeelandnet.nl">dhkblaszyk@zeelandnet.nl</a>> <<a href="mailto:dhkblaszyk@zeelandnet.nl">dhkblaszyk@zeelandnet.nl</a>> wrote:<br><br><blockquote type="cite">I get strange errors when using GetMem. In my<br></blockquote><blockquote type="cite">app I keep on allocating and freeing memory in a variable. At a certain<br></blockquote><blockquote type="cite">moment I do keep getting a SIGSEGV on the GetMem call when trying to<br></blockquote><blockquote type="cite">allocate exactly 128bytes. However allocating other sizes seems to work<br></blockquote><blockquote type="cite">just fine. Is there some logical explanation what could be going on<br></blockquote><blockquote type="cite">here?<br></blockquote><br>Most likely it's memory corruption: writing into a freed memory block, writing outside the bounds of an allocated memory block, ... Compiling with -gh may help pinpoint it, and if not and you're on a Unix-based platform, you can try Valgrind.<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>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. I will test with valgrind this afternoon to see if I can get some wiser from it.</div><div>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: <a href="http://scandraid.svn.sourceforge.net/viewvc/scandraid/src/branches/font/">http://scandraid.svn.sourceforge.net/viewvc/scandraid/src/branches/font/</a></div><div> </div><div>Darius</div><div><br></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">>bitmappedglfont</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">Marked memory at $0A5AF068 invalid</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">Wrong signature $9BC362D6 instead of D1853A22</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $0040CFBB</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $00407D08</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $00401948 KEYPRESSED, line 80 of BitmappedGLFont.pas</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $0984E054</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $0984D5DE</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $7E418734</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $7E418816</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $7E42A013</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $7E42A039</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">Heap dump by heaptrc unit</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">11894 memory blocks allocated : 8658563/8704536</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">11893 memory blocks freed : 8658563/8704536</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">1 unfreed memory blocks : 0</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">True heap size : 1146880 (160 used in System startup)</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">True free heap : 1146384</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">Should be : 1146656</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">Marked memory at $0A5AF068 invalid</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">Wrong signature $9BC362D6 instead of D1853A22</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $0040DE47</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $0040CFBB</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $00407D08</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $00401948</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $0984E054</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $0984D5DE</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $7E418734</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $7E418816</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> $7E42A013</span></div></body></html>