bits-and-blooms / bloom

Go package implementing Bloom filters, used by Milvus and Beego.
BSD 2-Clause "Simplified" License
2.44k stars 232 forks source link

Backward compatibillity break test failures on s390x #68

Closed davide125 closed 2 years ago

davide125 commented 3 years ago

With version 3.0.1 I'm seeing TestHashBasic and TestHashRandom fail on s390x:

--- FAIL: TestHashBasic (0.00s)
    murmur_test.go:29: Backward compatibillity break.
    murmur_test.go:29: Backward compatibillity break.
[...]
--- FAIL: TestHashRandom (0.02s)
    murmur_test.go:60: Backward compatibillity break.
    murmur_test.go:60: Backward compatibillity break.
[...]
FAIL
exit status 1
FAIL    github.com/willf/bloom  0.217s

You can see the full output in https://koji.fedoraproject.org/koji/taskinfo?taskID=73367600 (look at build.log).

eclipseo commented 3 years ago

It seems bloom doesn't support BigEndian systems like s390x:

https://github.com/bits-and-blooms/bloom/blob/451a8e4fb4f4e2a0399320e431acb073e8211b4c/murmur.go#L269-L272

lemire commented 2 years ago

I don't have access to a big endian system and we don't have a test harness with big endian encoding. However, I will attempt to apply your patch. Thanks.

lemire commented 2 years ago

Fixed as of 3.3.0.

Note that we do not test on big endian systems. If you can help with that, it would be much appreciated.