AgentD / squashfs-tools-ng

A new set of tools and libraries for working with SquashFS images
Other
194 stars 30 forks source link

Incorrect struct alignment assumption in test_abi breaking the i386 build #93

Closed AdrianBunk closed 2 years ago

AdrianBunk commented 2 years ago

Commit d2458bf4 added tests that make non-portable assumptions about struct padding.

https://buildd.debian.org/status/fetch.php?pkg=squashfs-tools-ng&arch=i386&ver=1.1.3-1&stamp=1631388594&raw=0

FAIL: test_abi
==============

38: offsetof(sqfs_compressor_config_t, opt) (12) does not equal (4 * sizeof(sqfs_u32)) (16)!
FAIL test_abi (exit status: 134)

The test assumes 4 byte padding before the union, which is not a portable assumption.

The next error is

69: 'sizeof(stats) >= (8 * sizeof(sqfs_u64))' is false!
FAIL test_abi (exit status: 134)
AgentD commented 2 years ago

Hi,

I recently pushed commit 349a98c2153f6d993c926007cb9eb7cc386c1be0 which fixes the problem at least on my end. I tested the 32 bit x86 build with -m32. The 64 bit test also still passes on my system, as well as the travis-ci machines.

Here is the commit in question as an individual patch file: 0001-Fix-struct-offset-testing-in-ABI-test-case.patch.gz

At this moment, I don't have access to a non-x86 32 bit system to test it on yet, so I will push it to fixes-1.1.0 and publish the signed patch file later on, once I have confirmation that other 32 bit systems still work.

Thanks!