[Rd] valgrind and C++

Martyn Plummer plummerm at iarc.fr
Tue Mar 18 17:53:55 CET 2014


I think the server that runs the valgrind checks is still running the
old version of your package (2.17) not the new one (2.18). Wait for an
update.

Martyn

On Mon, 2014-03-17 at 17:26 +0000, Jarrod Hadfield wrote:
> Hi,
> 
> I am sorry if this is perceived as a C++ question rather than an R  
> question. After uploading an R library to CRAN (MCMCglmm) the C++ code  
> failed to pass the memory checks.  The errors come in pairs like:
> 
> Mismatched free() / delete / delete []
> at 0x4A077E6: free (vg_replace_malloc.c:446)
> by 0x144FA28E: MCMCglmm (MCMCglmm.cc:2184)
> 
> 
> Address 0x129850c0 is 0 bytes inside a block of size 4 alloc'd
> at 0x4A07CE4: operator new[](unsigned long) (vg_replace_malloc.c:363)
> by 0x144F12B7: MCMCglmm (MCMCglmm.cc:99)
> 
> which is associated with lines allocating and freeing memory (nG is an  
> integer):
> 
> int *keep = new int [nG];
> 
> and
> 
> delete [] keep;
> 
> To me this looks fine, and on my machine (Scientific Linux 6.4) using  
> gcc 4.4.7-3 and valgrind 1:3.8.1-3.2 I get no such errors. Its not  
> clear to me which flavour of Linux or compiler the CRAN team used,  
> although from MCMCglmm-Ex.Rout I can see the same version of valgrind  
> was used. Any insight would be very welcome.
> 
> Kind Regards,
> 
> Jarrod
> 
> 
> 
> 
> 
> 
> 
> 

-----------------------------------------------------------------------
This message and its attachments are strictly confidenti...{{dropped:8}}



More information about the R-devel mailing list