[fpc-pascal] Need help fixing leaks

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Dec 21 08:39:52 CET 2010

On 21 Dec 2010, at 04:33, leledumbo wrote:

> Could anyone please help me fixing leaks in my 
> http://free-pascal-general.1045716.n5.nabble.com/file/n3312878/llvmirbuilder.zip
> project ?
> This is the output when I debug in gdb:
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000000 in ?? ()
> (gdb) bt
> #0  0x00000000 in ?? ()
> #1  0x00406c32 in SYSTEM_TOBJECT_$__FREE ()
> #2  0x0040d916 in TFPGOBJECTLIST$TLLVMVALUE__DEREF (ITEM=0x55138,
>    this=<error reading variable>) at llvmirbuilder.pp:362
> #3  0x00421451 in FGL_TFPSLIST_$__DEREF$LONGINT$LONGINT ()
> #4  0x00000000 in ?? ()
> That line is the end of a method and I have no idea why the item got
> dereferenced.

If you have access to a Linux or Mac OS X system, you can compile it with -gv and run it under Valgrind. It's very good at finding memory problems. Note that it may also give some false about the use of uninitialised values in some RTL helpers like fpc_pchar_to_shortstr (search for 80808080 in rtl/i386/* to see the routines where this can happen).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20101221/999504c9/attachment.html>

More information about the fpc-pascal mailing list