flac icon indicating copy to clipboard operation
flac copied to clipboard

Test failure on 32-bit x86 (`round-trip test (rt-1-12-1.aifc) encode... decode... compare... rt-1-12-1.aifc rt.aifc differ: char 8, line 1`)

Open thesamesam opened this issue 10 months ago • 4 comments

Building 1.5.0 or master (same) for x86 results in a failing test:

$ ./configure --prefix=/usr --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --target=i686-pc-linux-gnu --disable-programs CC="gcc -m32" CXX="g++ -m32" CFLAGS="-O2" CXXFLAGS="-O2" && make && make check
[...]
round-trip test (rt-8-12-1.aiff) encode... decode... compare... OK
round-trip test (rt-8-12-111.aiff) encode... decode... compare... OK
round-trip test (rt-8-12-4777.aiff) encode... decode... compare... OK
round-trip test (rt-8-16-1.aiff) encode... decode... compare... OK
round-trip test (rt-8-16-111.aiff) encode... decode... compare... OK
round-trip test (rt-8-16-4777.aiff) encode... decode... compare... OK
round-trip test (rt-8-20-1.aiff) encode... decode... compare... OK
round-trip test (rt-8-20-111.aiff) encode... decode... compare... OK
round-trip test (rt-8-20-4777.aiff) encode... decode... compare... OK
round-trip test (rt-8-24-1.aiff) encode... decode... compare... OK
round-trip test (rt-8-24-111.aiff) encode... decode... compare... OK
round-trip test (rt-8-24-4777.aiff) encode... decode... compare... OK
round-trip test (rt-8-8-1.aiff) encode... decode... compare... OK
round-trip test (rt-8-8-111.aiff) encode... decode... compare... OK
round-trip test (rt-8-8-4777.aiff) encode... decode... compare... OK
round-trip test (rt-1-12-1.aifc) encode... decode... compare... rt-1-12-1.aifc rt.aifc differ: char 8, line 1
ERROR: file mismatch
make[1]: *** [Makefile:716: check] Error 1
make[1]: Leaving directory '/home/sam/git/flac/test'
make: *** [Makefile:503: check-recursive] Error 1
~/git/flac/test $ diffoscope rt-1-12-1.aifc rt.aifc
--- rt-1-12-1.aifc
+++ rt.aifc
@@ -1,4 +1,4 @@
-00000000: 464f 524d 0000 0036 4149 4643 434f 4d4d  FORM...6AIFCCOMM
+00000000: 464f 524d 0000 0012 4149 4643 434f 4d4d  FORM....AIFCCOMM
 00000010: 0000 0018 0001 0000 0001 000c 400e ac44  [email protected]
 00000020: 0000 0000 0000 4e4f 4e45 0000 5353 4e44  ......NONE..SSND
 00000030: 0000 000a 0000 0000 0000 0000 0050       .............P

Logs above are w/ GCC 15 (unreleased) but I see the same w/ GCC 14 and 13.

The testsuite passes for amd64 (so dropping -m32) or if I drop --disable-programs.

thesamesam avatar Feb 13 '25 03:02 thesamesam

I suppose the actual difference is from write_iff.pl:

if ($format eq 'aiff') {
        die "sample data too big for format\n" if 46 + $datasize + $padding > 4294967295;
        # header
        print "FORM";
        print pack('N', 46 + $datasize + $padding);
        print "AIFF";
        # COMM chunk
        print "COMM";

What I don't yet see is how that relates to --disable-programs at all.

thesamesam avatar Feb 13 '25 03:02 thesamesam

The test is new in 669eae961e407047df04bbedcd75abe70100e2cd

thesamesam avatar Feb 13 '25 03:02 thesamesam

Oh, it's because with --disable-programs, it uses the system flac instead (rather than either always building the program for the tests but not installing it or skipping the tests).

We currently use --disable-programs for the multilib build in our packaging but we still want to test it if possible, while avoiding mutating the image / installed files based on whether tests are enabled.

thesamesam avatar Feb 13 '25 03:02 thesamesam

Thanks for sifting through this. I'll fix this and add a CI entry.

ktmf01 avatar Feb 13 '25 06:02 ktmf01