amplab/snap

SNAP crashes when it tries to generate a BAM file with > 2GB header

Opened this issue · 0 comments

The BAM spec has the header size as signed 32 bit int, so it's not possible to have one with more than 2GB of header (because you have so many contigs that it takes that much space). Since it's in the spec, there's nothing to be done about it. However, SNAP just shoves the size into the _int32 field, which can result in a negative offset and a crash (or, if it's big enough, with a positive-but-incorrect offset). It should detect this and exit with a helpful error message.