Visual Studio tbbmalloc_proxy bug?

Visual Studio tbbmalloc_proxy bug?

I just ran into a case where calling scalable_malloc(56) via tbbmalloc_proxy on Visual Studio 2015 (Windows 64-bit) returned a pointer that was NOT 16-byte aligned. Because the calling code (the matrix library Eigen) assumed that malloc() was 16-byte aligned on _WIN64, it proceeded to try using an optimized SSE copy routine that just crashed.

From reading the Visual Studio documentation at https://msdn.microsoft.com/en-us/library/ycsb6wwf.aspx , it seems that for 64-bit platforms it's saying that malloc() is guaranteed to be 16-byte aligned. So this seems to be a tbbmalloc_proxy bug?

 

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

It's rather tbbmalloc compatibility issue, as tbbmalloc_proxy simply redirects the memory allocation routines to tbbmalloc.

Thanks for reporting the bug; we will fix it. The workaround is to request 64 bytes instead, if possible.

Thanks, Alexey!

I should note that glibc also has similar behaviour:

https://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks...

Leave a Comment

Please sign in to add a comment. Not a member? Join today