libyal / libesedb

Library and tools to access the Extensible Storage Engine (ESE) Database File (EDB) format.
GNU Lesser General Public License v3.0
338 stars 91 forks source link

esedb_test_checksum tests fail on s390x (64-bit big-endian) #45

Closed hillu closed 4 years ago

hillu commented 5 years ago

While trying to build libesedb, the Debian/s390x autobuilder failed in the libesedb_checksum_calculate_little_endian_xor32 test:

esedb_test_checksum.c:1237 checksum_value (1617174027) != 669295665
Unable to run test: libesedb_checksum_calculate_little_endian_xor32
Testing: checksum  (FAIL)

I have found some spots in libesedb_checksum_calculate_little_endian_xor32 that look like they could use some le32toh or be32toh, but I haven't figured out what exactly is going wrong.

joachimmetz commented 5 years ago

I'll have a look when time permits, but there should be no need for using le32toh or be32toh

hillu commented 5 years ago

Looks like my first guess was incomplete: The tests run fine on mips, powerpc (32bit big-endian), but not on s390x, ppc64, sparc64 (64bit, big-endian), see https://buildd.debian.org/status/logs.php?pkg=libesedb&ver=20181229-1&suite=sid. Might this have something to do with shifting around of value_aligned in line 74ff of libesedb_checksum.c?

joachimmetz commented 5 years ago

Is a possibility, I have a look.

hillu commented 5 years ago

Just tried something simple and stupid, I changed the libesedb_aligned_t definition:

typedef uint32_t libesedb_aligned_t;

Now the tests run fine on the s390x I used earlier.

joachimmetz commented 5 years ago

Ack, so maybe an issue handing the byte ordering of successive 32-bit works on 64-bit big-endian platforms. I'll have a look when time permits.

joachimmetz commented 4 years ago

updated function to support 64-bit big-endian, CI tests now pass, closing issue