[R] What is the meaning of "segfault 'memory not mapped' " ?

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sat Oct 4 10:00:09 CEST 2008


Ben Bolker wrote:
> Ubuntu.Diego <ubuntu.diego <at> gmail.com> writes:
>
>   
>> I'm trying to get some "easy coding" to reproduce the error. In the
>> meantime I have R code that run for 20 or more hours and suddenly i got
>> a "segfault 'memory not mapped'" error. I have to clarify that the error
>> not alway occurs and sometimes the process end satisfactorily. The
>> process is basically a search using an MCMC strategy, sometimes the
>> algorithm converge and stops others I got the error message. I was
>> wondering if it could be meaning that I run out of RAM.
>> Thanks
>>
>> PS: I don't want to submit code that maybe after 48 hours of running
>> still don't generate the error.
>>
>>     
>
>   that makes sense ...
>
>   We need more information about what you are trying to do,
> what packages you're using, etc..  In general a segfault means
> a bug -- in R if the functions you're using are base R, but
> more likely in C code that you wrote or that comes from
> a contributed package (since the C code in R has been
> pretty thoroughly hammered on, it's much less likely -- although
> not impossible -- that it contains a memory bug like this).
> If you're using C code you wrote yourself, it's almost
> certainly in there.
>
>   Can you tell us what functions you were using,
> results of sessionInfo, etc. ?
>
>   If it's your own code or if you're feeling adventurous
> you can try to use valgrind to locate the problem --
> see
>
> http://finzi.psych.upenn.edu/R/Rhelp02a/archive/124215.html
>
> for a start, or the R Extensions manual ...
>
>   Ben Bolker
>   
Also, some information on the system in question would be in order. I 
hazard a guess at Ubuntu, but if so, he hid it quite well...

In general, "memory not mapped" means that you are trying to access a 
memory address which isn't in your process. Typically by failing to 
allocate memory and trying to use it anyway, but it could also happen by 
accidentally overwriting a pointer.

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



More information about the R-help mailing list