Ubuntu armhf build test failure #217

Closed
opened 2026-01-29 20:40:02 +00:00 by claunia · 11 comments
Owner

Originally created by @jbicha on GitHub (Mar 14, 2018).

The build tests for brotli 1.0.3 fail on armhf on Ubuntu 18.04 but they passed with 1.0.2.

It does build on Debian's armhf, but I'm told that Ubuntu's builder is a bit different. If I understand correctly, Ubuntu's armhf builder is actually an arm64 machine that emulates armhf. It was suggested that this might be an alignment bug.

Full build log at
https://launchpad.net/ubuntu/+source/brotli/1.0.3-1/+build/14449807

The Debian build logs are at
https://buildd.debian.org/status/package.php?p=brotli
(Just click Installed)

Build log excerpt

test__test_decompress__xyzzy (tests.decompressor_test.TestDecompressor) ... ok
test__test_decompress__zeros (tests.decompressor_test.TestDecompressor) ... ok
test__test_compress_lgwin_10_quality_11_10x10y (tests.compress_test.TestCompress) 
     ... Bus error (core dumped)
Originally created by @jbicha on GitHub (Mar 14, 2018). The build tests for brotli 1.0.3 fail on armhf on Ubuntu 18.04 but they passed with 1.0.2. It does build on Debian's armhf, but I'm told that Ubuntu's builder is a bit different. If I understand correctly, Ubuntu's armhf builder is actually an arm64 machine that emulates armhf. It was suggested that this might be an alignment bug. Full build log at https://launchpad.net/ubuntu/+source/brotli/1.0.3-1/+build/14449807 The Debian build logs are at https://buildd.debian.org/status/package.php?p=brotli (Just click `Installed`) Build log excerpt ----------------------- ``` test__test_decompress__xyzzy (tests.decompressor_test.TestDecompressor) ... ok test__test_decompress__zeros (tests.decompressor_test.TestDecompressor) ... ok test__test_compress_lgwin_10_quality_11_10x10y (tests.compress_test.TestCompress) ... Bus error (core dumped) ```
Author
Owner

@eustas commented on GitHub (Mar 14, 2018):

Going to investigate ASAP (on Thursday)

@eustas commented on GitHub (Mar 14, 2018): Going to investigate ASAP (on Thursday)
Author
Owner

@thinred commented on GitHub (Mar 15, 2018):

I suspect it's the same as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892895.
EDIT: ofc it is, it points to the same launchpad link :). I was fooled by two different submitters.

@thinred commented on GitHub (Mar 15, 2018): I suspect it's the same as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892895. EDIT: ofc it is, it points to the same launchpad link :). I was fooled by two different submitters.
Author
Owner

@eustas commented on GitHub (Mar 15, 2018):

Plain clang sanitizer does not catch the problem. Trying QEMU + chroot for emulating armhf...

@eustas commented on GitHub (Mar 15, 2018): Plain clang sanitizer does not catch the problem. Trying `QEMU` + `chroot` for emulating armhf...
Author
Owner

@eustas commented on GitHub (Mar 19, 2018):

Failed to emulate with QEMU + chroot, but managed to do it with docker.
Still, emulation seems to be weak - wasn't able to reproduce the bug.

Attached the binary I got by cross-compiling to arm32v7 under aarch64. I would appreciate if you test it in your environment, e.g. brotli -Zfkw 10 some-compressible-file. Also it would be nice if you share the executable which fails, so I would be able to play with it. Thanks.

brotli.gz

@eustas commented on GitHub (Mar 19, 2018): Failed to emulate with `QEMU` + `chroot`, but managed to do it with docker. Still, emulation seems to be weak - wasn't able to reproduce the bug. Attached the binary I got by cross-compiling to `arm32v7` under `aarch64`. I would appreciate if you test it in your environment, e.g. `brotli -Zfkw 10 some-compressible-file`. Also it would be nice if you share the executable which fails, so I would be able to play with it. Thanks. [brotli.gz](https://github.com/google/brotli/files/1825168/brotli.gz)
Author
Owner

@eustas commented on GitHub (Mar 21, 2018):

Got RPi3 into my hands. Unfortunately, it thinks that it is BCM2709 (armv7) instead of BCM2837 (armv8 / aarch64). Is there an easy way to fix it?

@eustas commented on GitHub (Mar 21, 2018): Got RPi3 into my hands. Unfortunately, it thinks that it is `BCM2709` (`armv7`) instead of `BCM2837` (`armv8` / `aarch64`). Is there an easy way to fix it?
Author
Owner

@eustas commented on GitHub (Mar 22, 2018):

Running openSUSE (aarch64) on RPi3. Looking for the ways to simulate what sbuild does, i.e. cross-compile and run (32-bit) armhf binary.

@eustas commented on GitHub (Mar 22, 2018): Running openSUSE (`aarch64`) on RPi3. Looking for the ways to simulate what `sbuild` does, i.e. cross-compile and run (32-bit) `armhf` binary.
Author
Owner

@eustas commented on GitHub (Mar 23, 2018):

Was able to reproduce. Fails in platform.h:200. BrotliUnalignedWrite64. Going to dig why it is triggered in armhf under aarch64 build.

@eustas commented on GitHub (Mar 23, 2018): Was able to reproduce. Fails in `platform.h:200`. `BrotliUnalignedWrite64`. Going to dig why it is triggered in `armhf` under `aarch64` build.
Author
Owner

@eustas commented on GitHub (Mar 23, 2018):

It seems that problem is not with any unaligned memory access, but specific to 64-bit read/write in 32-bit mode. Going to see if there is elegant workaround for this.

@eustas commented on GitHub (Mar 23, 2018): It seems that problem is not with any unaligned memory access, but specific to 64-bit read/write in 32-bit mode. Going to see if there is elegant workaround for this.
Author
Owner

@eustas commented on GitHub (Mar 26, 2018):

According to How does the ARM Compiler support unaligned accesses?:

Instructions which do NOT support unaligned accesses include:

LDM/STM
LDRD/STRD

Actually, LDRD / STRD are emitted for BrotliUnalignedXxx64.

@eustas commented on GitHub (Mar 26, 2018): According to [How does the ARM Compiler support unaligned accesses?](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15414.html): ``` Instructions which do NOT support unaligned accesses include: LDM/STM LDRD/STRD ``` Actually, `LDRD` / `STRD` are emitted for `BrotliUnalignedXxx64`.
Author
Owner

@eustas commented on GitHub (Mar 28, 2018):

Should be fixed with #656. Going to release v1.0.4 soon

@eustas commented on GitHub (Mar 28, 2018): Should be fixed with #656. Going to release v1.0.4 soon
Author
Owner

@eustas commented on GitHub (Apr 10, 2018):

Changes released in v1.0.4

@eustas commented on GitHub (Apr 10, 2018): Changes released in v1.0.4
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#217