Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tabix on truncated file returns successfully with exit status 0 #1528

Closed
bir3 opened this issue Nov 23, 2022 · 3 comments
Closed

tabix on truncated file returns successfully with exit status 0 #1528

bir3 opened this issue Nov 23, 2022 · 3 comments

Comments

@bir3
Copy link
Contributor

bir3 commented Nov 23, 2022

How to reproduce:

# on branch develop, latest commit 8e43fb0650
curl -r 0-12000 -LO https://ftp.ncbi.nlm.nih.gov/snp/latest_release/VCF/GCF_000001405.25.gz
# or wget -c --header="Range: bytes=0-12000" https://ftp.ncbi.nlm.nih.gov/snp/latest_release/VCF/GCF_000001405.25.gz

htslib-develop/tabix GCF_000001405.25.gz ; echo $?
[E::bgzf_read_block] Failed to read BGZF block data at offset 9832 expected 8913 bytes; hread returned 2151
[W::bgzf_read_block] EOF marker is absent. The input may be truncated
0

ls -ltr
-rw-r--r--. 1 root root 12001 Nov 23 19:49 GCF_000001405.25.gz
-rw-r--r--. 1 root root   113 Nov 23 19:49 GCF_000001405.25.gz.tbi


# also, same result on htslib-1.9
../htslib-1.9/tabix GCF_000001405.25.gz ; echo $?
[W::bgzf_read_block] EOF marker is absent. The input is probably truncated
0
@bir3
Copy link
Contributor Author

bir3 commented Nov 24, 2022

draft PR #1529

  • memory leak in test_bgzf, don't see where it is

@daviesrob
Copy link
Member

Yes, that shouldn't be happening. The error, as you've noticed, is in bgzf_getline() which isn't returning the error result correctly if it's already got some data.

Thanks for the PR, we'll check it out.

@daviesrob
Copy link
Member

Closed by #1529

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

No branches or pull requests

2 participants