[fpc-pascal] Understanding valgrind logs

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Nov 8 14:59:59 CET 2009

ik wrote on Sun, 08 Nov 2009:

> Hello all,
> I'm trying to figure out valgrind's log about a program I wrote in Pascal
> using FPC.
> I have a lot of the following messages:\
> ==30348== Mismatched free() / delete / delete []
> ==30348==    at 0x4C21A18: free (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==30348==  Address 0xd2892b0 is 0 bytes inside a block of size 32 alloc'd
> ==30348==    at 0x4C2261C: operator new(unsigned long) (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> Not even one report about my own code, buy all about shard libraries.
> Does anyone know what it means exactly ?

It says that this library is calling free() on a memory block that was  
allocated with new(). This is an error, because they should be calling  
delete() (it's sort of like calling freemem(x) on pointer to an object  
in Pascal, rather than dispose(x,done)).

There is probably nothing you can do about it in your code, since it's  
all inside the C++ library.


This message was sent using IMP, the Internet Messaging Program.

More information about the fpc-pascal mailing list