dipetkov / eems

Estimating Effective Migration Surfaces
GNU General Public License v2.0
102 stars 28 forks source link

Segfault error in rEEMSplots using example data #13

Closed jbemmels closed 7 years ago

jbemmels commented 7 years ago

Hi, I have successfully installed, but have not been able to run the R package rEEMSplots. Whether I use data files generated myself by running runeems_snps, or if I use the example files that come with the rEEMSplots package, I always encounter a segmentation fault.

I do not understand what the error message means or how to fix it. Searching online said this type of error might indicate a problem with the code. I am using R version 3.4.0 on Mac OS X 10.11.6 El Capitan.

Here is an example of the error output to the R console using the example scripts and example files provided with the rEEMSplots documentation. Any help or suggestions would be greatly appreciated. Thank you very much! - Jordan

The error message:

library(rEEMSplots) eems.results.to.plot = paste(path.package("rEEMSplots"),"/extdata/EEMS-example",sep="") name.figures.to.save = "EEMS-example-rEEMSplots"

eems.plots(mcmcpath = eems.results.to.plot, plotpath = paste(name.figures.to.save,"-default",sep=""), longlat = TRUE)

Input projection: Output projection:

Using the default DarkOrange to Blue color scheme, with 'white' as the midpoint color. It combines two color schemes from the 'dichromat' package, which itself is based on a collection of color schemes for scientific data graphics: Light A and Bartlein PJ (2004). The End of the Rainbow? Color Schemes for Improved Data Graphics. EOS Transactions of the American Geophysical Union, 85(40), 385. See also http://geog.uoregon.edu/datagraphics/color_scales.htm

Using 'euclidean' distance to assign interpolation points to Voronoi tiles.

Processing the following EEMS output directories : /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rEEMSplots/extdata/EEMS-example Plotting effective migration surface (posterior mean of m rates) /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rEEMSplots/extdata/EEMS-example

caught segfault address 0x18, cause 'memory not mapped'

Traceback: 1: .Call("rEEMSplots_tiles2contours_standardize", PACKAGE = "rEEMSplots", tiles, rates, seeds, marks, distm) 2: tiles2contours_standardize(tiles, rates, cbind(xseed, yseed), marks, dimns$dist.metric) 3: transform.rates(dimns, tiles, rates, xseed, yseed, zero_mean) 4: average.eems.contours(mcmcpath, dimns, longlat, plot.params, is.mrates = TRUE, plot.xy = m.plot.xy) 5: eems.plots(mcmcpath = eems.results.to.plot, plotpath = paste(name.figures.to.save, "-default", sep = ""), longlat = TRUE)

Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace Selection:

dipetkov commented 7 years ago

I updated to R 3.4.0 and fixed code to pass R CMD check without warnings. (Previous version resulted in the warning described here: https://github.com/RcppCore/Rcpp/issues/636.)

That was a warning, not an error, so I am not sure whether it will solve your problem (which occurs in the cpp code not in the native R code).

Here is my session info:

R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] grDevices graphics  stats     utils     methods   base     

other attached packages:
[1] rEEMSplots_0.0.0.9000

loaded via a namespace (and not attached):
 [1] compiler_3.4.0      RcppEigen_0.3.3.3.0 Matrix_1.2-10      
 [4] tools_3.4.0         sp_1.2-4            Rcpp_0.12.10       
 [7] raster_2.5-8        grid_3.4.0          rgeos_0.3-23       
[10] lattice_0.20-35   
jbemmels commented 7 years ago

This worked! I downloaded and installed the new version you updated, and now the plotting function runs with the example files just fine, without any segfault (or other errors or warnings). Thank you so much for the prompt reply.

-Jordan