samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
649 stars 240 forks source link

Fix bus error in bcftools merge on armhf (32-bit hard-float) #2042

Closed daviesrob closed 9 months ago

daviesrob commented 9 months ago

While 32-bit ARM mostly allows unaligned access, under certain conditions it can produce a bus error on unaligned access to a float. To prevent this from happening in bcftools merge, update code that accesses data via bcf_info_t::vptr and bcf_fmt_t::p to use uint8_t pointers and the le_to_i* macros in htslib/hts_endian.h. As a side-effect, this also makes bcftools merge work on big-endian platforms should anyone attempt to run it on one.

Fixes #2036 (test_vcf_merge failures on arm 32-bit with FPU: Bus error).

pd3 commented 9 months ago

Thank you