jkbonfield / io_lib

Staden Package "io_lib" (sometimes referred to as libstaden-read by distributions). This contains code for reading and writing a variety of Bioinformatics / DNA Sequence formats.
Other
36 stars 15 forks source link

1.14.13 tests fail on 32-bit systems #31

Closed mr-c closed 4 years ago

mr-c commented 4 years ago

Hello, in building the Debian packages for version 1.14.13 we noticed that the test fail on 32-bit systems

=== testing ./data/xx#unsorted.sam ===
 ../progs/scramble -t4 ./data/xx#unsorted.sam test.out/xx#unsorted.bam
 ../progs/scramble -t4 -V4.0 -7 -r ./data/xx.fa test.out/xx#unsorted.bam test.out/xx#unsorted.full.cram

WARNING: this version of CRAM is not a recognised GA4GH standard.
Note this CRAM version is a technology demonstration only.
Future versions of Scramble may not be able to read these files.

 ../progs/scramble -t4 test.out/xx#unsorted.bam > test.out/tmp.sam
 ../progs/scramble -t4 -m test.out/xx#unsorted.full.cram > test.out/xx#unsorted.full.sam
Diff at lines ./data/xx#unsorted.sam:3, test.out/xx#unsorted.full.sam:6
1   b1 147 yy 11 1 10M = 1 -20 TTTTTTTTTT **********
2   b1 147 yy 11 1 10M = 1 4294967276 TTTTTTTTTT **********
    -----------------------^

FAIL: scram_mt40.test
Cannot open file test.out/aux#aux.full.cram

https://buildd.debian.org/status/fetch.php?pkg=staden-io-lib&arch=i386&ver=1.14.13-1&stamp=1594899444&raw=0 and others

jkbonfield commented 4 years ago

Thanks for this.

I see it's a fundamental lacking of my hash table implementation. It has some horrid abuse where we do some hacky casting and send over an integer in place of the char* pointer. This works fine, even on 32-bit systems, provided you don't try to use a 64-bit integer! Obvious with hindsight, and not trivially fixable. I'm experimenting with extending the hash table with some new APIs to compensate.

jkbonfield commented 4 years ago

Validated it with a -m32 build (on a 64-bit system) and it's now passing this test. Thanks for the bug report.