[fpc-pascal] valgrind: "invalid read"

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Jun 4 19:51:14 CEST 2015


David Emerson wrote on Thu, 04 Jun 2015:

> I have just started using valgrind, and I was surprised that I got a  
> lot of errors, particularly in places that look like clean code. So  
> I whittled things down and created a test program. Here is the error  
> I am seeing (I've removed the procid, ==11180==):
>
> Invalid read of size 16
>    at 0x401727: SYSTEM_INDEXBYTE$formal$INT64$BYTE$$INT64 (in  
> /Docs/fpc/test/vg_stringlist_const_error)

It's a false positive. You can create valgrind suppression files to  
filter out such false positives. Someone once started a generic  
suppression file for FPC  
(http://svn.freepascal.org/svn/fpcbuild/trunk/install/unix/valgrind-fpc.supp  
), but as you can see it's far from complete. You can even get  
Valgrind to generate the suppression itself when it prints out errors:  
http://valgrind.org/docs/manual/manual-core.html (search for  
--gen-suppressions=yes).


Jonas



More information about the fpc-pascal mailing list