[Rcpp-devel] [Segfault Reason] Beginner Question: Same code *sometimes* fails due to segfault sometimes
Sean Robert McGuffee
sean.mcguffee at gmail.com
Mon May 23 18:41:15 CEST 2011
Also, I had that type of error when I didn't have all of the proper
libraries linked. That can be an issue that produces this type of error.
On 5/20/11 7:39 PM, "Davor Cubranic" <cubranic at stat.ubc.ca> wrote:
> 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.
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
More information about the Rcpp-devel