Skip to content
Back to formatted view

Raw Message

Message-ID: <CA00066B.435C%sean.mcguffee@gmail.com>
Date: 2011-05-23T16:41:15Z
From: Sean Robert McGuffee
Subject: [Rcpp-devel] [Segfault Reason] Beginner Question: Same code *sometimes* fails due to segfault sometimes
In-Reply-To: <A6C76BEA-DF8E-4083-9467-C7EAE39ACE69@stat.ubc.ca>

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.
> 
> Davor
> 
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel