On 2011-05-20, at 12:59 AM, Sunny Srivastava wrote:

> My code sometimes fails with a segmentation fault error, however this 
> behavior cannot be replicated. That is, most of the times it runs fine and 
> gives appropriate results, but once in a while it will fail due to 
> segmentation fault and gives error like -- 
> 
>  *** caught segfault ***
> address 0x18, cause 'memory not mapped'
> 
> I don't think this is normal, but how can it give correct answers when it 
> runs correctly. Any ideas?

It's sheer chance that your code is not segfaulting every time it's running. 
This error means your program is trying to access memory that does not belong 
to it. Something that was allocated was freed, or it was never allocated in the 
first place, but is still being accessed.

As Romain suggested, post the code that causes this. If it's really long, try 
to narrow it down to a small reproducible example. 

Davor

_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to