jean997 / cause

R package for CAUSE
https://jean997.github.io/cause/
52 stars 15 forks source link

illegal operand when estimating parameters #2

Closed jonaszierer closed 4 years ago

jonaszierer commented 5 years ago

I'm trying to get the LDL example (https://jean997.github.io/cause/ldl_cad.html) to work but when i am running est_cause_params i get the following errors:

Estimating CAUSE parameters with  1000000  variants.

 *** caught illegal operation ***

 *** caught illegal operation ***

 *** caught illegal operation ***

 *** caught illegal operation ***
address 0x2aaaaba178f2, cause 'illegal operand'

 *** caught illegal operation ***

 *** caught illegal operation ***

which continues like that for a while and then later on

*** Error in `/usr/prog/R/3.5.0-foss-2018a/lib64/R/bin/exec/R': realloc(): invalid next size: 0x00002aabb80008c0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7ab54)[0x2aaaab3e3b54]
/lib64/libc.so.6(+0x7ec18)[0x2aaaab3e7c18]
/lib64/libc.so.6(realloc+0x1b2)[0x2aaaab3e9752]
/usr/prog/R/3.5.0-foss-2018a/lib64/R/lib/libR.so(R_AllocStringBuffer+0x46)[0x2aaaaae3e486]
/usr/prog/R/3.5.0-foss-2018a/lib64/R/lib/libR.so(+0xe93b3)[0x2aaaaadb83b3]
/usr/prog/R/3.5.0-foss-2018a/lib64/R/lib/libR.so(+0xec5c9)[0x2aaaaadbb5c9]
/usr/prog/R/3.5.0-foss-2018a/lib64/R/lib/libR.so(+0xea405)[0x2aaaaadb9405]
/usr/prog/R/3.5.0-foss-2018a/lib64/R/lib/libR.so(+0xed6f0)[0x2aaaaadbc6f0]
/usr/prog/R/3.5.0-foss-2018a/lib64/R/lib/libR.so(+0xead09)[0x2aaaaadb9d09]
/usr/prog/R/3.5.0-foss-2018a/lib64/R/lib/libR.so(+0xebf56)[0x2aaaaadbaf56]
/usr/prog/R/3.5.0-foss-2018a/lib64/R/lib/libR.so(Rf_deparse1+0x62)[0x2aaaaadbc912]
/usr/prog/R/3.5.0-foss-2018a/lib64/R/lib/libR.so(+0x117115)[0x2aaaaade6115]
/usr/prog/R/3.5.0-foss-2018a/lib64/R/lib/libR.so(+0x16756c)[0x2aaaaae3656c]
/lib64/libpthread.so.0(+0xf5e0)[0x2aaaab15c5e0]
/usr/prog/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas.so.0(+0x2eb8f2)[0x2aaaaba178f2]
/usr/prog/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas.so.0(dgemv_n+0x526)[0x2aaaaba17fa6]
/usr/prog/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas.so.0(+0xdccb2)[0x2aaaab808cb2]
/usr/prog/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas.so.0(+0x2965aa)[0x2aaaab9c25aa]
/usr/prog/GCCcore/6.4.0/lib64/libgomp.so.1(+0x160c6)[0x2aaaaaae60c6]
/lib64/libpthread.so.0(+0x7e25)[0x2aaaab154e25]
/lib64/libc.so.6(clone+0x6d)[0x2aaaab46134d]
======= Memory map: ========
00400000-00401000 r-xp 00000000 00:2d 1296096271                         /usr/prog/R/3.5.0-foss-2018a/lib64/R/bin/exec/R
00401000-00402000 r--p 00000000 00:2d 1296096271                         /usr/prog/R/3.5.0-foss-2018a/lib64/R/bin/exec/R
00402000-00403000 rw-p 00001000 00:2d 1296096271                         /usr/prog/R/3.5.0-foss-2018a/lib64/R/bin/exec/R
00403000-d7f5a000 rw-p 00000000 00:00 0                                  [heap]
2aaaaaaab000-2aaaaaacc000 r-xp 00000000 08:03 69486534                   /usr/lib64/ld-2.17.so
2aaaaaacc000-2aaaaaace000 r-xp 00000000 00:00 0                          [vdso]
2aaaaaace000-2aaaaaad0000 rw-p 00000000 00:00 0 
2aaaaaad0000-2aaaaaafc000 r-xp 00000000 00:2d 1292625595                 /usr/prog/GCCcore/6.4.0/lib64/libgomp.so.1.0.0
2aaaaaafc000-2aaaaaafd000 r--p 0002b000 00:2d 1292625595                 /usr/prog/GCCcore/6.4.0/lib64/libgomp.so.1.0.0
2aaaaaafd000-2aaaaaafe000 rw-p 0002c000 00:2d 1292625595                 /usr/prog/GCCcore/6.4.0/lib64/libgomp.so.1.0.0

Any idea where this is coming from...?

jean997 commented 5 years ago

Thanks for posting! Can you share your sessionInfo()?

jonaszierer commented 5 years ago

sure! sorry for the tardy response

R version 3.5.0 (2018-04-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/prog/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas_haswellp-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] cause_0.2.0.0161 feather_0.3.3    forcats_0.4.0    stringr_1.4.0   
 [5] dplyr_0.8.3      purrr_0.3.2      readr_1.3.1      tidyr_0.8.3     
 [9] tibble_2.1.3     ggplot2_3.2.0    tidyverse_1.2.1  colorout_1.2-1  

loaded via a namespace (and not attached):
 [1] tidyselect_0.2.5    ashr_2.2-32         haven_2.1.1        
 [4] lattice_0.20-38     colorspace_1.4-1    vctrs_0.2.0        
 [7] generics_0.0.2      loo_2.1.0           rlang_0.4.0        
[10] mixsqp_0.1-97       pillar_1.4.2        glue_1.3.1         
[13] withr_2.1.2         modelr_0.1.4        readxl_1.3.1       
[16] matrixStats_0.54.0  foreach_1.4.4       munsell_0.5.0      
[19] gtable_0.3.0        cellranger_1.1.0    rvest_0.3.4        
[22] codetools_0.2-16    doParallel_1.0.14   pscl_1.5.2         
[25] parallel_3.5.0      broom_0.5.2         Rcpp_1.0.1         
[28] scales_1.0.0        backports_1.1.4     RcppParallel_4.4.3 
[31] jsonlite_1.6        truncnorm_1.0-8     gridExtra_2.3      
[34] hms_0.5.0           stringi_1.4.3       numDeriv_2016.8-1.1
[37] grid_3.5.0          cli_1.1.0           tools_3.5.0        
[40] magrittr_1.5        lazyeval_0.2.2      crayon_1.3.4       
[43] pkgconfig_2.0.2     zeallot_0.1.0       MASS_7.3-51.4      
[46] Matrix_1.2-17       SQUAREM_2017.10-1   xml2_1.2.0         
[49] lubridate_1.7.4     assertthat_0.2.1    httr_1.4.0         
[52] rstudioapi_0.10     iterators_1.0.10    R6_2.4.0           
[55] intervals_0.15.1    nlme_3.1-140        compiler_3.5.0     
CreRecombinase commented 5 years ago

is it possible that /usr/prog/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas_haswellp-r0.2.20.so as in:

Matrix products: default
BLAS/LAPACK: /usr/prog/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas_haswellp-r0.2.20.so

and /usr/prog/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas.so.0 (from the backtrace) are not the same? If you run

ls -l /usr/prog/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas_haswellp-r0.2.20.so

and

ls -l /usr/prog/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas.so.0

from the shell, do they point to different files? If that's the case it looks like something might be funny with the way R is linking OpenBLAS. What's the output of R CMD config BLAS_LIBS ?

jonaszierer commented 5 years ago

the libopenblas.so.0 is actually just a symlink to libopenblas_haswellp-r0.2.20.so.

R CMD config BLAS_LIBS gives -lopenblas -lgfortran

However, I noticed that running it in a conda environment solves the problem. So it is probably some funny linking problem with openBlas