samtools / htslib

C library for high-throughput sequencing data formats
Other
785 stars 447 forks source link

Segfault when writing uncompressed BAM #1617

Closed tijyojwad closed 1 year ago

tijyojwad commented 1 year ago

Hi,

I am running into a segfault when I attempt to write a header into an uncompressed BAM. I'm opening the file using hts_open(fname, "wbu"). I tried with the commit 6143086502567c5c4bb5cacb2951f664ba28ed6e (release 1.17) but still see that issue.

The same code runs if I just change the mode to "wb".

Could that be looked into? Thanks!

tijyojwad commented 1 year ago

thanks to a tip from @cjw85 I learnt that wb0 did the trick for generating uncompressed BAMs. Could the API documentation be updated for that?

daviesrob commented 1 year ago

u should work, and certainly shouldn't segfault. We'll look into it.