martinus / robin-hood-hashing

Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20
https://gitter.im/martinus/robin-hood-hashing
MIT License
1.5k stars 142 forks source link

crash because alignment of key is not respected #173

Open HSNB opened 1 year ago

HSNB commented 1 year ago

this unordered_map does not respect memory alignment requirements of Key

HSNB commented 1 year ago

Crash on if (WKeyEqual::operator()(key, mKeyVals[idx].getFirst())) {

mKeyVals array does not respect memory alignment of Key, so a Key with a 16 byte requirement will crash on this code

I also believe this unordered_map does not respect memory alignment requirements of Value, but I could not test because it already crashes on Key. Even though the contents of robin_hood.h contains some code with alignment_of and such checks, it is defective and does not cover all memory

Key: m128 Value: m128

32-bit compilation