-
Notifications
You must be signed in to change notification settings - Fork 445
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
BCF code makes no attempt to account for endianness #355
Comments
The particular Has the BCF code been further audited to check whether BCF I/O is now free from endianness bugs? |
We did have functioning big-endian variants of htslib back in 2014 (eg see comments in #99), but I don't know what happened to those PRs. I know I did a SPARC branch, which was subsequently replaced by Rob's complete rewrite, but I'm not sure either ever made it in as a completed work. Realistically it all needs retesting to be sure. |
While the HTSlib code is improved (as previously noted: #355 (comment)), note for example over in BCFtools on current develop bcftools/vcfconcat.c's |
See https://github.com/daviesrob/htslib/tree/SPARC I'm not sure why this work was never put in. I did a lot of work on this, subsequently followed up by Rob, but no PR ever got made. Odd. |
sam/bam/cram reading should be OK, but there are almost certainly issues with vcf/bcf. Unfortunately my big-endian testing platform (a netbsd SPARC VM) lost its ability to talk to Github (maybe endian issues in some of the newer encryption code?) so I haven't been able to do much on this recently. |
Please don't get sidetracked at this time 😄 That comment was just to record that the BCFtools situation is unchanged, with trivial endianness infelicities. |
Shall we add the big endian case |
It looks like a Travis alpha feature, so I'm not sure if we would want to do that at the moment (and it would make all our builds break due to the existing endianness issues). But it might be worth considering in the future. |
What do you think that the feature breaks all the (existing) builds? |
It won't break the amd64 test cases, but it will break the build as a whole. Once the remaining issues have been tracked down and fixed it will be useful to turn this on so that they don't regress, but it would be rather distracting at the moment. |
No, it does not break the build as a whole. I sent a pull-request just in case. |
I verified the Travis multiple CPU architectures feature today, by using following repository. So far, I did not see a big problem. The performance is slow. And I saw a job was rarely not started in Travis community. |
My behavior to suggest the feature was not inclusive but forcible. So I closed the PR. |
I can confirm that the 1.10 release causes a regression for |
We should probably consider having another look at this issue as it is now preventing 1.10 from progressing into Ubuntu Focal Fossa too. This indeed seems to be a regression from 1.9. I'm inclined to agree we should be testing this from time to time as we aren't noticing these breaks. |
The BCF code still doesn't work on big-endian hosts (for example, Samtools 1.10-3 had been stuck on Debian due to something downstream wanting to build on s390x but that has now been walloped and 1.10-3 is now in Debian testing apparently. Perhaps this means it will soon progress in Ubuntu too (I am not familiar with how closely Ubuntu packages track Debian packages these days…). So the choices would be:
|
On Debian, the s390x build of htslib (and all packages that depend on htslib, and so forth) was removed from the testing distribution. We still attempt to build on s390x, but it no longer block migrations. So a version of option 2, though other distributions will have to put in similar work. However, option 1 would be better. |
I've fired up a big-endian machine and will see how far I get. (Currently that's not far - it failed while testing tabix...) |
looks like after git bisect, I found that the first commit introducing the issue is |
Interesting. There's lots of changes to have it does things like |
See #1023 which sorts out all of the remaining issues I've found. |
In case this is of interest, I built from master on s390x today:
|
Thanks for the independent confirmation. We now have s390x in our travis config too. |
The vcf.c
bcf_hdr_read()
andbcf_hdr_write()
functions work only on a little-endian host —hlen
is read/written assuming that the host and on-disk representations are the same.(I have not audited the other BCF code, e.g., record reading/writing.)
See also bcftools/vcfconcat.c's
naive_concat()
which similarly readshlen
without accounting for endianness.The text was updated successfully, but these errors were encountered: