zhilizheng / SBayesRC

GNU General Public License v3.0
25 stars 4 forks source link

ERROR *** caught segfault *** cause 'memory not mapped' #39

Open teresa-sansan opened 1 week ago

teresa-sansan commented 1 week ago

Hi Zhili,

I got this error when I was running the SNP imputation step. It was running fine until the very end. I am wondering if this is some system libraries for C/C++ that I don't have on my cluster yet.

Imputing... 
Prepare and reading time: 0.462876
LD reconstruct with m = 8446, k = 3471
Numer of SNP typed: 9713, Number of SNP to impute: 1074
Reconstruct LD time: 7.62234

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

Traceback:
 1: impGa(info$template, idxBlk, info$type, ma_exist$z, idxtt, m,     thresh)
 2: impute(mafile = paste(ma_file, "_tidy.ma",     sep = ""), LDdir = ld_folder, output = paste(ma_file,     "_imp.ma", sep = ""), log2file = TRUE)
An irrecoverable exception occurred. R is aborting now ...

Any suggestion on what should I install / how I can resolve this?

Thanks, Teresa

zhilizheng commented 1 week ago

Hi @teresa-sansan,

This seems to be a memory issue instead of the system libraries.

  1. Try to run this command again. It could go through without problem.
  2. if still problem, could you share me more information? (with full log)

Regards, Zhili

teresa-sansan commented 5 days ago

Hi Zhili,

So our group was running this using hg38. We have 2108 blocks and I tried to run this by chromosome. I modified the code a bit to make snp.info only includes the SNPs in that specific chromosome.

For example, chr21 starts from block 2050-2078. But I always get this error when I'm trying to run the imputation stage using SBayesRC::impute()

I tried to increase the memory but doesn't really help. (It failed when I used 40GB, and it still failed when I requested 250GB)

The error message looks like this: (The msg will show from the first block, but will only run in block 2050 to 2078)

Impute the summary data by LD
196133 SNPs in common between GWAS summary and LD
196133 SNPs set from summary data
0 SNPs flipped alleles
196133 SNPs are typed SNPs
Start summary imputation..
==========2047=========
==========2048=========
==========2049=========
==========2050=========
==========2051=========
==========2052=========
Imputing... 
Prepare and reading time: 0.0280063
LD reconstruct with m = 6269, k = 3004
Numer of SNP typed: 6260, Number of SNP to impute: 450
Reconstruct LD time: 0.836383

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

Traceback:
 1: impGa(info$template, idxBlk, info$type, ma_exist$z, idxtt, m,     thresh)
 2: impute(mafile = paste(dirname(ma_file), "/_hg38_chr",     chrom, "_reversed_a1a2_tidy.ma", sep = ""), LDdir = ld_folder,     output = paste(dirname(ma_file), "_hg38_chr",         chrom, "_reversed_a1a2_imp.ma", sep = ""))
An irrecoverable exception occurred. R is aborting now ...

I tried it on all 22 chromosomes and they all got the same error.

Teresa

zhilizheng commented 3 days ago

HI @teresa-sansan ,

Could you share me the full log (and better the blocks)? I will simulate a case that is similar to your case. The error is not informative. Thanks. My email: zhili[dot]zheng[at]broadinstitute[dot]org

It would be very staightforward, if I can have your GWAS statistics, and the LD data. I will delete all the information you shared with me after debugging. However, with the previous information, I can simulate one anyway, but will result in more time to debug.

Thanks for the reporting.

Regards, Zhili

teresa-sansan commented 1 day ago

Hi Zhili,

I just sent everything through the mail.(From tlin@nygenome.org). Lmk if there's anything you need to replicate this!

Best, Teresa