Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frequent signal 11 / sigsegv #19

Open
ptrebert opened this issue Jun 28, 2022 · 5 comments
Open

frequent signal 11 / sigsegv #19

ptrebert opened this issue Jun 28, 2022 · 5 comments

Comments

@ptrebert
Copy link

Hi,
I have executed VerityMap on a number of haploid chromosomes w/o problems, but for the majority, then run fails with a segfault like this

[...]
00:00:38 0.72022-06-28 12:58:44 VerityMap started

*********************************
Read mapping started...
MAPPER_BIN exists
[...Python traceback omitted...]
subprocess.CalledProcessError: Command 
'['[ ...cut... ]/veritymap/build/bin/veritymap', '--target', 'output/subset_wg/20_extract_contigs/NA20509.HIFIRW.ONTUL.na.chrY.fasta',
 '--queries', 'output/subset_wg/45_extract_reads/NA20509.HIFIRW_aln-to_HIFIRW.ONTUL.na.chrY.reads.fasta.gz', 
'-o', '[ ...cut... ]/output/eval/assm_errors/NA20509.HIFIRW.ONTUL.na.chrY.HIFIRW/veritymap', 
'-t', '6', '--config', 'hifi']' died with <Signals.SIGSEGV: 11>.

I get the segfault for both HiFi and ONT reads. I have the info from other users that the mapper sometimes crashes but has already produced all necessary output. If that is the case here as well, can you briefly state which output file(s) are required to move on with the run:

alignments.sam
chains.tsv
kmer_indexes.tsv
norarekmers.bed

All of the above? In that case, I would modify the script to check for the existence of these files and ignore the error in that case.

Best,
Peter

@seryrzu
Copy link
Collaborator

seryrzu commented Jun 28, 2022

Hi Peter,

I would like to figure out what causes the sigfault to fix it. Can you please share input files via email ([email protected]) or via slack?

Technically, alignments.sam is what you are likely looking for, but I'm not sure if the file is complete.

Thanks,
Andrey

@ptrebert
Copy link
Author

Sure, but given the size, I am sharing via Globus (you should have received an email invite).

Thanks for looking into it!

@steven-solar
Copy link

Was this resolved? Running into the same problem. My command:

python /path/to/tools/VerityMap/veritymap/main.py \
    -t $SLURM_CPUS_PER_TASK \
    --reads ../../2-bam-to-fq/siamang.chrY-reads.fq \
    -d ont-haploid-complete \
    -o chrY ../../3-get-chrY-refs/siamang.chrY.fa

Output:

2023-06-14 17:05:10 VerityMap started

*********************************
Read mapping started...
Traceback (most recent call last):
  File "/path/to/tools/VerityMap/veritymap/main.py", line 61, in <module>
    main()
  File "/usr/local/Anaconda/envs/py3.8/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Anaconda/envs/py3.8/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/Anaconda/envs/py3.8/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Anaconda/envs/py3.8/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/path/to/tools/VerityMap/veritymap/main.py", line 54, in main
    do(assemblies, reads_fname, datatype, out_dir, threads, no_reuse, is_careful)
  File "/path/to/tools/VerityMap/veritymap/../veritymap/py_src/mapper.py", line 148, in do
    run_mapper(assembly, reads_fname, out_dir, threads, datatype, is_careful)
  File "/path/to/tools/VerityMap/veritymap/../veritymap/py_src/mapper.py", line 40, in run_mapper
    subprocess.check_call(cmd)
  File "/usr/local/Anaconda/envs/py3.8/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/path/to/tools/VerityMap/veritymap/build/bin/veritymap', '--target', '../../3-get-chrY-refs/siamang.chrY.fa', '--queries', '../../2-bam-to-fq/siamang.chrY-reads.fq', '-o', '/path/to/veritymap', '-t', '56', '--config', 'ont-haploid-complete']' died with <Signals.SIGSEGV: 11>.

@skoren
Copy link

skoren commented Aug 11, 2023

I see similar issues with several assemblies, including HG002. In at least one case, the cause was a very repetitive contig (rDNA model sequence) and removing it ran to completion. I'm still looking into the other cases but my guess is it is related to finding no k-mers in some subset of sequences.

@skoren
Copy link

skoren commented Aug 14, 2023

I think I fixed it by updating the following:

.6d2071a 100644
--- a/veritymap/src/projects/veritymap/kmer_index/index_builders/kmer_window.hpp
+++ b/veritymap/src/projects/veritymap/kmer_index/index_builders/kmer_window.hpp
@@ -61,7 +61,7 @@ class KmerWindow {
   void Reset() {
     next_it = pos_hash_regular.cbegin();
     cur_it = pos_hash_regular.cbegin();
-    IncRight();
+    if (pos_hash_regular.size() > 0) IncRight();
   }
 };

This was the location of the segfault I was seeing consistently where no k-mers are selected and the IncRight step was then dereferencing the empty iterator. Still running tests to make sure it doesn't crash elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants