lh3 / minigraph

Sequence-to-graph mapper and graph generator
https://lh3.github.io/minigraph
MIT License
419 stars 38 forks source link

Segmentation fault during graph generation with two genomes #64

Closed cjain7 closed 2 years ago

cjain7 commented 2 years ago

Minigraph version: 0.17-r529-dirty (commit: ed797c1)

Command:

minigraph -t1 --no-kalloc --dbg-qname -cxggs HG002.hifiasm.trio.0.16.1.hap1.fa HG002.hifiasm.trio.0.16.1.hap2.fa

The sequences were pulled from hifiasm-phase FTP link. ftp://ftp.dfci.harvard.edu/pub/hli/hifiasm-phase/v2/

Error log with GDB:

[M::main::6.508*0.98] loaded the graph from "HG002.hifiasm.trio.0.16.1.hap1.fa"
[M::mg_index::150.689*1.00] indexed the graph
[M::mg_opt_update::156.661*1.00] occ_max1=100; lc_max_occ=2
[M::ggen_map::165.348*1.00] loaded file "HG002.hifiasm.trio.0.16.1.hap2.fa"
QR  h2tg000001l 0   89438912
Q1  h2tg000001l 36.011
Q2  h2tg000001l 18.084
Q3  h2tg000001l 0.054
Q4  h2tg000001l 0.403
Program received signal SIGSEGV, Segmentation fault.
kfree (_km=_km@entry=0x29f1acd28, ap=ap@entry=0x0) at kalloc.c:91
91      p->size = *((size_t*)ap - 1);

Please let me know if I should provide more information. Thanks!

lh3 commented 2 years ago

I missed this, but I have observed the same segfault. I believe the 0.18 should have fixed the issue. Please feel free to reopen this issue if you still see the same bug.

cjain7 commented 2 years ago

Unfortunately the segmentation fault still occurs with v0.18

$ gcc --version
gcc (SUSE Linux) 7.5.0
lh3 commented 2 years ago

I see you are using --no-kalloc. Do you see the error without --no-kalloc?

cjain7 commented 2 years ago

Hello Heng. This issue was resolved. I had switched to GCC 11.2.0 compiler from INTEL, and then it worked fine.

lh3 commented 2 years ago

If you are using v0.18, you could try 45d11e4. It seems that some compiler/linux combinations segfault with memcpy(0,0,0).

lh3 commented 2 years ago

If you have time, could you compile the github HEAD and see if it works? If it works on your end, I will release v0.19 just for this fix. Glenn found this issue on Ubuntu 18.04. The fix worked for him.