ktprime / emhash

Fast and memory efficient c++ flat hash map/set
MIT License
511 stars 35 forks source link

Load of misaligned address #10

Closed NAThompson closed 2 years ago

NAThompson commented 2 years ago

Error:

/include/emhash/hash_table6.hpp:1676:28: runtime error: load of misaligned address 0x000109903e31 for type 'size_t' (aka 'unsigned long'), which requires 8 byte alignment
0x000109903e31: note: pointer points here
00 00 00  ff 79 00 00 00 00 00 00  00 00 00 be be be be be  be be be 00 00 00 00 00  00 00 00 00 00
                     ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior include/emhash/hash_table6.hpp:1676:28

Compiler:

$ clang --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.5.0

Flags: -fsanitize=address -fsanitize=undefined.

ktprime commented 2 years ago

It's a issue and it's fixed now.

zhqrbitee commented 2 years ago

The same error exists in 'hash_set4.hpp' I believe.

include/emhash/hash_set4.hpp:1229:28: runtime error: load of misaligned address 0x6120000050e1 for type 'size_t' (aka 'unsigned long'), which requires 8 byte alignment
0x6120000050e1: note: pointer points here
 00 00 00  9b b9 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
ktprime commented 2 years ago

@zhqrbitee fix now.

ktprime commented 2 years ago

fix and close it