spotify / annoy

Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk
Apache License 2.0
13.1k stars 1.16k forks source link

UBSAN issue with Hamming due misalignment #456

Open jlmelville opened 4 years ago

jlmelville commented 4 years ago

../inst/include/annoylib.h:662:18: runtime error: load of misaligned address 0x55d2429c5424 for type 'const long unsigned int', which requires 8 byte alignment

Actually this PR won't fix that issue, and I'm not sure how to even fix it. Some thoughts:

None of these are entirely trivial

Originally posted by @erikbern in https://github.com/spotify/annoy/pull/455#issuecomment-590152737

alexey-milovidov commented 2 years ago

It should be trivial to fix, and every reasonable C++ library should be tested with ASan+MSan+TSan+UBSan+Fuzzing.