Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

Visual Studio tbbmalloc_proxy bug?

e4lam
Beginner
78 Views

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?

 

0 Kudos
1 Solution
Alexey_K_Intel3
Employee
78 Views

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.

View solution in original post

3 Replies
Alexey_K_Intel3
Employee
79 Views

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.

View solution in original post

e4lam
Beginner
78 Views

Thanks, Alexey!

e4lam
Beginner
78 Views

I should note that glibc also has similar behaviour:

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

Reply