You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The C++ spec requires the result of operator new to be aligned to alignof(max_align_t), which is 16 on x86_64 Linux. However, lean's operator new returns 8 byte aligned memory under tcmalloc, where malloc_usable_size, malloc_size and _msize are unavailable.
As clang assumes 16-byte-aligned memory and uses movaps for zero-filling, 8-byte-aligned memory causes a segmentation fault.
The 8-byte alignment is from lean::save_alloc_size in src/util/memory.cpp, that stores the size of allocation into a 8 byte leading region of the allocated memory chunk. So, to fix the alignment issue, the leading region should be alignof(max_align_t) instead of a single size_t.
The C++ spec requires the result of
operator newto be aligned toalignof(max_align_t), which is 16 on x86_64 Linux. However, lean'soperator newreturns 8 byte aligned memory under tcmalloc, wheremalloc_usable_size,malloc_sizeand_msizeare unavailable.As clang assumes 16-byte-aligned memory and uses
movapsfor zero-filling, 8-byte-aligned memory causes a segmentation fault.The 8-byte alignment is from
lean::save_alloc_sizein src/util/memory.cpp, that stores the size of allocation into a 8 byte leading region of the allocated memory chunk. So, to fix the alignment issue, the leading region should bealignof(max_align_t)instead of a single size_t.