Re: [Rd] Invalid read of size 8

2015-02-05 Thread Simon Urbanek
As you can see from the stack trace the memory you're trying to use has already been released so it was not protected. Since you only provided part of your code we can't really reproduce it or help you. However, why don't you use just use double *MatCovExtra = REAL(PROTECT(allocMatrix(REALSXP,

Re: [Rd] Invalid read of size 8

2015-02-05 Thread niandra
Few more details: nSamples_save is an integer variable and if nSamples_save>1000 I get the error, while if nSamples_save<1000 everything is fine -- View this message in context: http://r.789695.n4.nabble.com/Invalid-read-of-size-8-tp4702843p4702847.html Sent from the R devel mailing list archi

[Rd] Invalid read of size 8

2015-02-05 Thread niandra
Hi, I have a R program that call a C function. I define a vector of pointer as int nLC=3; int pownLC = nLC*nLC double *MatCovExtra[nT+1]; for(k=0;kK. Then i put some values on the vector associated with the pointer: for(k=0;khttp://r.789695.n4.nabble.com/Invalid-read-of-size-8-tp4702843.html S