Nextomics / NextDenovo

Fast and accurate de novo assembler for long reads
GNU General Public License v3.0
352 stars 52 forks source link

Segmentation fault #18

Closed SC-Duan closed 4 years ago

SC-Duan commented 4 years ago

Hi, I run nextDenovo in a local machine, and get an error in final assembly step, ............ [INFO] 2019-10-21 16:05:15,963 cns_align done [INFO] 2019-10-21 16:05:15,968 analysis tasks done [INFO] 2019-10-21 16:05:15,974 total jobs: 11 [INFO] 2019-10-21 16:05:15,976 Throw jobID:[43608] jobCmd:[/01_rundir/03.ctg_graph/01.ctg_graph.sh.work/ctg_graph00/nextDenovo.sh] in the local_cycle. .................. .................. .................. [ERROR] 2019-10-21 16:07:50,953 ctg_graph failed: please check the following logs: [ERROR] 2019-10-21 16:07:50,954./01_rundir/03.ctg_graph/01.ctg_graph.sh.work/ctg_graph00/nextDenovo.sh.e

the content of nextDenovo.sh.e file:

hostname

the size of nextgraph.assembly.contig.fasta is about 32Mb.

This is my run.cfg file: [General] job_type = local # here we use SGE to manage jobs job_prefix = nextDenovo task = all # 'all', 'correct', 'assemble' rewrite = yes # yes/no deltmp = no rerun = 3 parallel_jobs = 30 input_type = raw input_fofn = ./input.fofn # input file workdir = ./01_rundir

cluster_options = -l vf={vf} -q all.q -pe smp {cpu} -S {bash} -w n

[correct_option] read_cuoff = 1k seed_cutoff = 19703 # the recommended minimum seed length blocksize = 10g pa_correction = 50

seed_cutfiles = 5

sort_options = -m 30g -t 5 -k 40 minimap2_options_raw = -x ava-pb -t 8 correction_options = -p 5

[assemble_option] random_round = 100 #same error if commented out minimap2_options_cns = -x ava-pb -t 8 -k17 -w17 nextgraph_options = -a 1

What should I do? Thank you!

moold commented 4 years ago

Could you try to use Valgrind to figure out the error details? After installing Valgrind, you can run valgrind ~/NextDenovo/bin/nextgraph -a 1 -f ./01_rundir/03 .ctg_graph/01.ctg_graph.input.seqs ./01_rundir/03.ctg_graph/01.ctg_graph.input.ovls -o nextgraph.assembly.contig.fasta, and paste the result to here.

SC-Duan commented 4 years ago

These are the output.

==98676== Memcheck, a memory error detector ==98676== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==98676== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info ==98676== Command: ~/NextDenovo/bin/nextgraph -a 1 -f ./01_rundir/03.ctg_graph/01.ctg_graph.input.seqs ./01_rundir/03.ctg_graph/01.ctg_graph.input.ovls -o nextgraph.assembly.contig.fasta ==98676== [INFO] 2019-10-21 17:34:44 Initialize graph and reading... ==98676== Warning: set address range perms: large range [0xef18040, 0x26c90440) (undefined) ==98676== Warning: set address range perms: large range [0xef18028, 0x26c90458) (noaccess) [INFO] 2019-10-21 17:49:21 Initial Node(s): 245385, Edge(s): 2928398 [INFO] 2019-10-21 17:49:27 Depth stat, Ave: 48.591 Max: 97182.656 Repeat: 82.710 Nor:Ext: 435534:58696 [INFO] 2019-10-21 17:49:27 Outdegree stat, Ave: 11.974 Max: 23947.166 Repeat: 18.166 Nor:Ext: 485220:5550 [INFO] 2019-10-21 17:49:33 Chimeric node ratio: 0.150% (candidate: 0.449%) [INFO] 2019-10-21 17:49:57 Assembly done and outputting... ==98676== Use of uninitialised value of size 8 ==98676== at 0x53C487C: fseeko (in /usr/lib64/libc-2.17.so) ==98676== by 0x40F9AE: subfa (bseq.c:113) ==98676== by 0x40EF1A: out_ctg_fasta (out.c:474) ==98676== by 0x40200F: main (main.c:236) ==98676== ==98676== Invalid read of size 4 ==98676== at 0x53C487C: fseeko (in /usr/lib64/libc-2.17.so) ==98676== by 0x40F9AE: subfa (bseq.c:113) ==98676== by 0x40EF1A: out_ctg_fasta (out.c:474) ==98676== by 0x40200F: main (main.c:236) ==98676== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==98676== ==98676== ==98676== Process terminating with default action of signal 11 (SIGSEGV) ==98676== Access not within mapped region at address 0x0 ==98676== at 0x53C487C: fseeko (in /usr/lib64/libc-2.17.so) ==98676== by 0x40F9AE: subfa (bseq.c:113) ==98676== by 0x40EF1A: out_ctg_fasta (out.c:474) ==98676== by 0x40200F: main (main.c:236) ==98676== If you believe this happened as a result of a stack ==98676== overflow in your program's main thread (unlikely but ==98676== possible), you can try to increase the size of the ==98676== main thread stack using the --main-stacksize= flag. ==98676== The main thread stack size used in this run was 16777216. ==98676== ==98676== HEAP SUMMARY: ==98676== in use at exit: 2,455,248,572 bytes in 1,560 blocks ==98676== total heap usage: 2,650,303 allocs, 2,648,743 frees, 14,934,892,232 bytes allocated ==98676== ==98676== LEAK SUMMARY: ==98676== definitely lost: 0 bytes in 0 blocks ==98676== indirectly lost: 0 bytes in 0 blocks ==98676== possibly lost: 0 bytes in 0 blocks ==98676== still reachable: 2,455,248,572 bytes in 1,560 blocks ==98676== suppressed: 0 bytes in 0 blocks ==98676== Rerun with --leak-check=full to see details of leaked memory ==98676== ==98676== Use --track-origins=yes to see where uninitialised values come from ==98676== For lists of detected and suppressed errors, rerun with: -s ==98676== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) debug.sh: line 1: 98676 Segmentation fault (core dumped) ~/valgrind-3.15.0/bin/valgrind ~/NextDenovo/bin/nextgraph -a 1 -f ./01_rundir/03.ctg_graph/01.ctg_graph.input.seqs ./01_rundir/03.ctg_graph/01.ctg_graph.input.ovls -o nextgraph.assembly.contig.fasta

Rachel-pku commented 4 years ago

#cluster_options = -l vf={vf} -q all.q -pe smp {cpu} -S {bash} -w n , I think you should rm # and use this option. Then try it again.

moold commented 4 years ago

Hi, I have checked this error carefully, but I can not reproduce this error. So if you are sure you can repeat this error after re-runnig NextDenovo from beginning, maybe you can send me the input data of nextgraph, and I will fix it as soon as possible.

SC-Duan commented 4 years ago

Hi, it should not be a bug, I test another data and now it works. I will check my data. Thank you.

DaniPaulo commented 2 months ago

Any idea what caused the problem? I'm having the same issue:

[INFO] 2024-04-30 18:24:00 Initialize graph and reading... /90daydata/tephritid_gss/dani/nextDenovo/SMB_Q12L5K_nextDenovo/03.ctg_graph/01.ctg_graph.sh.work/ctg_graph1/nextDenovo.sh: line 5: 267342 Segmentation fault
(core dumped)
/project/tephritid_gss/daniel.paulo/envs/nextDenovo/lib/python3.10/site-packages/nextdenovo/bin/nextgraph -a 1 -f /90daydata/tephritid_gss/d ani/nextDenovo/SMB_Q12L5K_nextDenovo/.//03.ctg_graph/01.ctg_graph.input.seqs /90daydata/tephritid_gss/dani/nextDenovo/SMB_Q12L5K_nextDenovo/.//03.ctg_graph/01 .ctg_graph.input.ovls -o nd.asm.p.fasta