-
Notifications
You must be signed in to change notification settings - Fork 1.2k
UBSAN issue with Hamming due misalignment #456
Copy link
Copy link
Open
Description
../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:
- Make sure that the memory is always aligned to 8 byte offsets, possibly using something like http://man7.org/linux/man-pages/man3/posix_memalign.3.html
- Rewrite the hamming code to use 4 byte ints instead of 8 byte ints
- Change the few places where we access
v[i]to not use an array dereference
None of these are entirely trivial
Originally posted by @erikbern in #455 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels