-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
We set alignment attributes for bson_t's, but we set them at 128 byte alignment (theoretically to align them for cache lines on the stack).
The problem is that we malloc and return them that way. While malloc is guaranteed to return something as aligned as the most aligned scalar type, that isn't generally 128 byte alignment.
That makes tools scream constantly about the misalignment. It also shows up in cases where bson_malloc has been shimmed if the memory allocater doesn't go wide enough (specifically showing up in zend_emalloc, only 8 byte alignment), which causes memcpy to screw up (it looked at the types going in and generated aggressive code assuming it could use vectorized intrinsincs, when it could not)
- is duplicated by
-
CDRIVER-2810 misaligned address
- Closed
- related to
-
CDRIVER-997 BSON_EXTRA_ALIGN left unspecified by CMake
- Closed
-
CDRIVER-1042 BSON_EXTRA_ALIGN segfaults in win32
- Closed
-
PHPC-213 Memory alignment issues on FreeBSD
- Closed
-
CDRIVER-2813 Remove BSON_EXTRA_ALIGNMENT option
- Backlog