mirror of
https://github.com/google/brotli.git
synced 2026-09-22 06:35:52 +00:00
UBSAN misaligned address errors #49
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jeroen on GitHub (Oct 4, 2015).
See http://www.stats.ox.ac.uk/pub/bdr/memtests/gcc-UBSAN/brotli-Ex.Rout
@eustas commented on GitHub (Oct 4, 2015):
Try to compile with -DBROTLI_BUILD_PORTABLE option
@jeroen commented on GitHub (Oct 4, 2015):
Thanks. Not sure if that justifies undefined behavior in the default build though.
@eustas commented on GitHub (Oct 4, 2015):
We focused mostly on x64 and ARMv7 where unaligned read doesn't cause undefined behaviour (except for atomicity, but it's not the case).
We will consider to turn this optimisation only when compiler detects compatible CPU architecture.
@jeroen commented on GitHub (Oct 4, 2015):
I think you are mistaken, these UBSAN errors appear on linux on
x86_64.@eustas commented on GitHub (Oct 4, 2015):
Yes, ubsan reports errors on x86_64 and we used it to check "portable" version.
But reporting unaligned reads by ubsan on x86_64 is done intentionally, so developers could verify their product without compiling for / running on specific hardware that can't to unaligned reads.