[R] Seg. faults in mapthin (in package maps!)

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jul 1 19:06:56 CEST 2004


You are on a 64-bit architecture and the C interface is declared as

void mapthin(x, y, n, delta, symmetric)
     double *x, *y, *delta;
     long *n, *symmetric;

R's integer type is int, not long, but they are the same on a 32-bit 
platform.

I am pretty sure that changing long to int will fix this.

There are a few other quirks, and I would check some of the other uses of 
`long' in the C sources.

On Thu, 1 Jul 2004, Kevin Bartz wrote:

> Hi everyone! I know segmentation faults are awfully hard to diagnose, but
> I'm experiencing a fairly regular pattern of seg. faults when plotting using
> map in the maps package. Starting R fresh, I run:
> 
> require(maps)
> for (i in 1:50) {
>   cat(i, "\n")
>   map("state")
> }
> 
> I always get the same result:
> 
> 1 
> 2 
> 3 
> 4 
> 5 
> 
> Process R segmentation fault at Thu Jul  1 09:07:39 2004
> 
> With some browsering, I've zeroed in on the source of the segmentation
> fault: map's call to mapthin. Funny thing is, when I comment out the call to
> mapthin, everything works consistently, without a hitch, and with no
> apparent difference in the map.
> 
> Still, I'd rather work with the package the way it was built. I must be
> losing something by cutting out the call to mapthin. 
> 
> I was wondering if anyone has any ideas. I've never had a segmentation fault
> before on this particular machine, but these few lines always produce the
> same unfortunate result. Has anyone else experienced segmentation faults
> plotting using map in the maps package? Is there any way I might rectify it?
> I'm on SuSE Linux, by the way, with:
> 
> > version
>          _                       
> platform x86_64-unknown-linux-gnu
> arch     x86_64                  
> os       linux-gnu               
> system   x86_64, linux-gnu       
> status   alpha                   
> major    1                       
> minor    9.1                     
> year     2004                    
> month    06                      
> day      13                      
> language R                       
> 
> Thanks for any help you can provide,
> 
> Kevin
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 
> 

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list