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

Plugin allele-length causes segmentation fault for alleles larger than 500 #1837

Closed
pontushojer opened this issue Dec 13, 2022 · 1 comment
Closed

Comments

@pontushojer
Copy link

This is the output I got when running bcftools +allele-length.

bcftools +allele-length Peregrine_HiFi_asm3bc.vcf.gz
Segmentation fault: 11

After some digging I finally narrowed it down to this entry in the VCF causing the issue

chr1	729578	.	AGTTCAGGGCCTGGAGAGAAGGCTGGGAGGCAGGAGCTGGGTCTAAAGAGGCCATTGTAACGATGGAGCTGTGCCTGTGGAGGCTGTTGTGAGGCAGTAGCCTCATCTGCGGAGGCTGCCGTGACATAGGGTATGGGCCTAAATAGGCCATTGTGAGTCATGAGCTTGGTCTGTAGAGGCTGACTGGAGAAAGTTCTGGGCCTGGAGAGGCTGCCGGGAGGTAGGAGCTGGGCCAAAAGATGTAAGCACATTTGCATTTATTAGGCACTTTATTTCCATTATTACACTGTAATATATAATAAAATAATTATAGAACTCACCATAATGTAGAATTAGTGGGCGTGTTAAGCTTGTTTTCCTGCAACTGAATGGTCCCACCTGAGCGTGATGGGAGAAAGTGACAGATCAATAGGTATTAGATTCTCATAAGGACAGCGCAACCTCGATCCCTCACATGCACGGTTCACAACAGGGTGCGTTCTCCTATGAGCATCTAATGCTGCTGCTCATCTGAGAAGGTGGAGCTCAGGTGGGAATGTGAGCAAAGGGGAGTGGCTCTAAATACAGACGAAGCTTCCCTCACTCCCTCACTCGACACCGCTCACCTCCTGCTGTGTGGCTCCTTGCGGCTCCATGGCTCAGGGGTTGGGGACCCCTGCTCAAGTGCATCCAAAGCGACCCTTCCCACACCAGTCTTCACAGTGGTCAAGGGCAGCAACCACTTAGCTCCCAAGGCATGTGCCTCAGCTGGCATTTCGTCACAATCAACAGTAAGTGGTAGCTTGAGTCACTGTGAGGTCACCTACTGGAAATCACCAGCACCCCATTTCCCACTGGCAAAGAGCTCAGCACTGCCCCCTGGGAAACCAAACCTATGCCCAAATCCCATCTGTGTGGGTCTACCTCCTGGGACCCTTCCTAACATATTAGTCAGAGTCCAATCAGGAAGCATAAACCACTCAAAAGTTTAAAGTGGTAAAATTTAATACAGAGAATTATTCATTATAACAGGTGAACAGCATAATGAGAGATTGGCTAGCACAGAGTAAAGAGAACTCTAGAGAATATGGGACTAGCCCAGGCCAGGCATGGTGGCTCATGCCTGAAATTCCAGCCATTACAGAAGCTAATGCAGGAGGATTGCTTAAGGCCAGGAGCTAGAGACCGGTCTGGACGACACAGTGAGACCCTGTCTCTATCCAAAAGAAGAAAAAAGTTAGCTGGGGGTGGTGGTGCACACTTGTAGTCCCAGCTACTCAGAATGCTGAAGTTTGAGCCTGGGAGGTCAAGGCTGCAGTGAGGCATGATTATGCCACTACAGTCCAGCCGGATGACAGAGCAAGACCCTGTCTCAAAGAACAAAACCACAACAACCATTTACAGACAGAAAAGAAATAGAGCTAATAAGCTGAGGAAAGATGTTGAAATGTGACAAGTAAAGTAATATGAGGTCTTTTGTCTATTTAAAATAATCAAACAAAAAATGGCTTACGAAATTATAATACCCTGTGCTGGCAAAGGTGCAGTGAAATGGGCACTTTCTTATACTATGAGGGGTGGTTAAATTGTGTATAAGCCTTCCAGGGTAAAGCCTGTCAATTTTTTAAAATAATGGAGACAGGGTCTCACCATACTGCCATACTGCCTCCTCCAACTCTTGGCCTCAAGCAATCCTCCTCTCTTAGCCTCCCAAAGTGCTAAGATTATAGCTGGGAGGCACCCAAAACCCTGTCAATTTACATCAAGGGTAAGGAGAATGTCCATTCACCATGACTCACAGTAATCTTACTTCTGGGGAGACAATTCAATCTAAGCAAAAGGTCATCTGTACACACACAGTAAAAATCTGGGAGTAACTGAAGACAGAGTTGGTAAGTGAAATAAGAAACAGTTATAAGAAATTAAACTATGGTATCAATAGGCACCTGGTAAAAGGTCAGTTGATGTTAGCTGCTACTTTTTTGTTGTTTTGAGACAGGGTCTCACTCTGTCACCCAGGCTGGAGTGCAGAGGCCTGATCATGACTCACTGCAGTCTCAGCCTCCCTGGGCTCAAGTGATCCTCCCACCTCAGCCTCCCAAGTAGCTGGGACTACAGGAACATGCCACCACACTAGGCTAATTCATGTATTTTTCTGTAGGGATGGTGACTCCCCCTTTGTTTCCAAGGCCTATCGCAAACTCTTGGCCTCGAGCCATCCTCCTGCCTCAGCCTCCCAAAGTGTTGTGATTACCAGTGTGAGCCACCACACCTGGCCAGCTGCTACTTTTATCAATATTATTCTTATTCCACTCAATTAAAAATTATTATTTTCAAGGCTATGCAACAGTATGTATCCTACAGCGTAATTGTAAAAACATACACAGTCGTCATCCCTCAGTATACAGAATTAGTTCCAGCCCCCCATCTCTGCATATACCAAAATCCATGCTTACTCACGTTTCGCTGTCACCCCTCTAGAATCCACGTATACGAAAATTCCAAATGTTAGTTGGGCATAGTGGCAAGCACCTGTAGTCTCAGCCACGTGGGAGGTTGAGGTGGGAGGATCGCTTCAGCCTGGAAGGTTGAGGCTGCAGTCAGCTGCGATAGCACTACTACACTCCAGCCTTGGACAACAGAGGGAGACCCTGTCTCAGAAAAAAAAACAAAATAAAACAGGTTAGAAATTGTAATGAGGTCTGCTGGGCAAAATTCCATATAAGCAATGTATAAATTAATAAAGCAAATCGTGATAAATTAGTACGATTGACTTTCTGGAGTTTCTGACAATAAAAGTAAGGAAAATGCAGAACACAAAGACAGAGAGTAAAAAGAGAAATTAGGAAAGCATTCTACATGTTGAATAGGAAGACACTGGCCATGTTCGTGCAGCGGCAGTATGTCGTGACATGACATACCTTGGAGAGAAGTTAACAGATGAGGAAGTTGATAAAAATCATCAGAGAAGCAAAATACTGGTAGCGACACTCAAGTAAACCATGAAATTTCCATAACTTATGTCAGCAAAGTGGGAATATTGTACAGTGTGTGTTGAAGTTCCTATACAACATTGTTTATCTGCCTTTTGTTTGTTTGTAAGGAATGTACATACTAAAAGTTCTTCTTGCTGTCAAAAGAATATGCGTGAATAAGTCATTTTAACTTATTCTTCTGTTTTTCTTTTATCTTCCTGCCATCATCCCACAGCCTTACTTTAGAAATTTCTTTTTTAGAAAATTGAACAAGTGCTCCCTGTGGTGGCACATACCTCGAGGATGGGAGGCAGGGGTGGAAGGGTCACTTGAGGCCATTAGTTTGACACCAGCCTGGCCAACAAAGTGAGACCCCGTGTCTACAAAACAATTTAAAAATTAGCCAAGTATCGTCATGTATACCTACAGTCCCAGCTATCTGAACTTACTGAGAAT	A	30	.	.	GT:AD	0|1:1,1

This is quite long at 3410 bp. Looking at the source code I then found that the length is currently capped at 512.

#define MAXLEN 512

Its not so helpful to only get a seg-fault here. Two solutions would be:

  • Raise some kind of warning that there are alleles longer than 512 bp.
  • Aggregate alleles larger than 512 bp as final line in the output.
@pd3 pd3 closed this as completed in c380ab0 Jan 4, 2023
@pd3
Copy link
Member

pd3 commented Jan 4, 2023

Fixed according to your second suggestion. Thanks for the bug report

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

2 participants