Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

Visual Studio tbbmalloc_proxy bug?

e4lam
Beginner
399 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-Kukanov
Employee
399 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

0 Kudos
3 Replies
Alexey-Kukanov
Employee
400 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.

0 Kudos
e4lam
Beginner
399 Views

Thanks, Alexey!

0 Kudos
e4lam
Beginner
399 Views

I should note that glibc also has similar behaviour:

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

0 Kudos
Reply