Skip to content

bcftools merge segfault when REF and ALT are unset. #1361

@malthesr

Description

@malthesr

I have a use-case where I'd like to merge BCF files with the REF/ALT fields unset, which returns a segmentation fault. The following contains two simple BCF files (and their .csi indexes) to illustrate: test.tar.gz

Running bcftools view on either file looks fine, but

> bcftools merge first.bcf second.bcf
[1]    23882 segmentation fault (core dumped)  bcftools merge first.bcf second.bcf

Setting the REF/ALT fields in each BCF fixes the problem. Also, converting to VCF first seems to work, i.e. the following runs fine:

> bcftools view first.bcf | bgzip > first.vcf.gz && tabix first.vcf.gz                                                                                                           
> bcftools view second.bcf | bgzip > second.vcf.gz && tabix second.vcf.gz                                                                                                         
> bcftools merge first.vcf.gz second.vcf.gz

However, for the application I have in mind, converting via VCF is not an option, unfortunately.

At first, I was unsure whether the BCF specs permit unset REF/ALT, but since writing the BCF (using htslib bindings) and other bcftools commands appear to work, I'm thinking this is not the problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions