Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UBSAN misaligned address errors #203

Closed
jeroen opened this issue Oct 4, 2015 · 5 comments
Closed

UBSAN misaligned address errors #203

jeroen opened this issue Oct 4, 2015 · 5 comments

Comments

@jeroen
Copy link

jeroen commented Oct 4, 2015

See http://www.stats.ox.ac.uk/pub/bdr/memtests/gcc-UBSAN/brotli-Ex.Rout

@eustas
Copy link
Collaborator

eustas commented Oct 4, 2015

Try to compile with -DBROTLI_BUILD_PORTABLE option

@jeroen
Copy link
Author

jeroen commented Oct 4, 2015

Thanks. Not sure if that justifies undefined behavior in the default build though.

@eustas
Copy link
Collaborator

eustas commented 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.

@eustas eustas closed this as completed Oct 4, 2015
@jeroen
Copy link
Author

jeroen commented Oct 4, 2015

I think you are mistaken, these UBSAN errors appear on linux on x86_64.

@eustas
Copy link
Collaborator

eustas commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants