torognes / vsearch

Versatile open-source tool for microbiome analysis
Other
643 stars 123 forks source link

segmentation fault when printing out alignments #508

Closed frederic-mahe closed 1 year ago

frederic-mahe commented 1 year ago

before commit 3ab323616159ea39598d7ddd1dc9fa38864ee3a1:

printf ">s1;size=1\nAT\n>s2;size=9\nAA\n>s3;size=1\nAT\n" | \
    vsearch --cluster_size - --minseqlength 1 --sizein --id 0.5 --consout -
Reading file - 100%
6 nt in 3 seqs, min 2, max 2, avg 2
Masking 100% 
Sorting by abundance 100%
Counting k-mers 100% 
Clustering 100%  
Sorting clusters 100%
Writing clusters 100% 
Clusters: 1 Size min 11, max 11, avg 3.0
Singletons: 0, 0.0% of seqs, 0.0% of clusters
Multiple alignments 66%>centroid=s2;size=9;seqs=3
AA
Multiple alignments 100%

after commit 3ab323616159ea39598d7ddd1dc9fa38864ee3a1:

printf ">s1;size=1\nAT\n>s2;size=9\nAA\n>s3;size=1\nAT\n" | \
    ./vsearch --cluster_size - --minseqlength 1 --sizein --id 0.5 --consout -
Reading file - 100%
6 nt in 3 seqs, min 2, max 2, avg 2
Masking 100% 
Sorting by abundance 100%
Counting k-mers 100% 
Clustering 100%  
Sorting clusters 100%
Writing clusters 0%Segmentation fault

The bug is visible when running vsearch-tests fixed_bugs.sh (some tests fail).

torognes commented 1 year ago

Sorry. Fixed in commit e36b21c.

frederic-mahe commented 1 year ago

I've added tests focusing on that specific issue (https://github.com/frederic-mahe/vsearch-tests/commit/bb0391dc76529b44fd1393e3890806c08301b2ad)