Skip to content

Fix error code 0 returned by bcftools after error#1504

Merged
daviesrob merged 2 commits intosamtools:developfrom
janinl:patch-1
Sep 5, 2022
Merged

Fix error code 0 returned by bcftools after error#1504
daviesrob merged 2 commits intosamtools:developfrom
janinl:patch-1

Conversation

@janinl
Copy link

@janinl janinl commented Sep 2, 2022

Without this, bcftools returns error code 0 even when interrupted by these errors visible in stderr:
- [E::hts_itr_next] Failed to seek to offset 70116896333: Illegal seek
- [E::bgzf_read_block] Failed to read BGZF block data at offset 29255442 expected 12238 bytes; hread returned -1

This code change is in line with what is written in the next else block

Without this, bcftools returns error code 0 even when interrupted by these errors visible in stderr:
     - [E::hts_itr_next] Failed to seek to offset 70116896333: Illegal seek
     - [E::bgzf_read_block] Failed to read BGZF block data at offset 29255442 expected 12238 bytes; hread returned -1
@janinl
Copy link
Author

janinl commented Sep 2, 2022

The second commit addresses the same problem for issues such as

  • [E::bgzf_read_block] Invalid BGZF header at offset xxx

Test case: Take a valid vcf.gz file and randomly edit the bytes to make it invalid.
These problems were observed when using HTTPS URL as inputs, possibly receiving invalid data due to some network problems.

@daviesrob daviesrob merged commit 76d4618 into samtools:develop Sep 5, 2022
@daviesrob
Copy link
Member

Looks good. Thanks for the patch.

@janinl janinl deleted the patch-1 branch September 9, 2022 09:33
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

Successfully merging this pull request may close these issues.

3 participants

Comments