olliemcdonald / siapopr

R wrappers for SIApop
GNU General Public License v3.0
3 stars 2 forks source link

segmentation fault with example data #1

Closed sahilseth closed 6 years ago

sahilseth commented 7 years ago

Hi Ollie,

thanks for this cool, useful package!

I am trying to test it with some example data you have provided in the SIApop repo, and running with the R function as follows:

> lst = siapop(input_file = "~/apps/siapop/SIApop/examples/constant-rate/passenger/inputdata.txt",
+              ancestor_file = "~/apps/siapop/SIApop/examples/constant-rate/passenger/ancestors.txt")
No parameters model
Reading ancestor file...Ancestor File Read...Output Ancestor Population...Ancestor Output Written...

 *** caught segfault ***
address 0x60, cause 'memory not mapped'

Traceback:
 1: .Call("siapopr_siapop", PACKAGE = "siapopr", tot_life, max_pop,     start_time, ancestors, ancestor_clones, num_sims, allow_extinction,     num_samples, sample_size, detection_threshold, observation_frequency,     observation_times, birth_rate, death_rate, mutation_prob,     fitness_distribution, custom_distribution_file, alpha_fitness,     beta_fitness, pass_prob, upper_fitness, lower_fitness, alpha_mutation,     beta_mutation, trace_ancestry, count_alleles, punctuated_prob,     poisson_param, punctuated_multiplier, punctuated_advantageous_prob,     epistatic_mutation_thresh, epistatic_multiplier, seed, custom_model_file,     input_file, output_dir, ancestor_file)
 2: siapop(input_file = "~/apps/siapop/SIApop/examples/constant-rate/passenger/inputdata.txt",     ancestor_file = "~/apps/siapop/SIApop/examples/constant-rate/passenger/ancestors.txt")

Do you have an indication, as to what might be the issue here?

Thanks!

olliemcdonald commented 7 years ago

Can you try using the absolute filepaths instead of "\~"? or path.expand("\~/apps/siapop/SIApop/examples/constant-rate/passenger/inputdata.txt")

Let me know if this solves the problem

WanchuangZhu commented 6 years ago

Hi Ollie, I have encountered the same problem when I use your package to run my own data. Below is my sessioninfo. Can you help to figure out where the issue is?

R version 3.4.2 (2017-09-28) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.1

Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.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] stats graphics grDevices utils datasets methods base

other attached packages: [1] dplyr_0.7.4 siapopr_0.0.1

loaded via a namespace (and not attached): [1] compiler_3.4.2 magrittr_1.5 assertthat_0.2.0 R6_2.2.2 bindrcpp_0.2 glue_1.2.0 tibble_1.3.4 Rcpp_0.12.13 pkgconfig_2.0.1 rlang_0.1.4
[11] bindr_0.1

sahilseth commented 6 years ago

Hi Ollie,

With the full path, it works well.

Thanks! Sahil