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

scalable_malloc() causes CPU to spin

pgp78
Beginner
891 Views

I am seeing code that allocates an std::string on the stack result in the CPU spinning at 100% within TBB's scalable_malloc().  The same issue was described in this post from last year:

http://software.intel.com/en-us/forums/topic/278331

The stack trace looks as follows:

#0 0x00002b6411b861e9 in rml::internal::Block::privatizePublicFreeList() () from ./libtbbmalloc.so.2
#1 0x00002b6411b868e3 in rml::internal::Bin::getPublicFreeListBlock() () from ./libtbbmalloc.so.2
#2 0x00002b6411b87e00 in rml::internal::internalPoolMalloc(rml::internal::MemoryPool*, unsigned long) () from ./libtbbmalloc.so.2
#3 0x00002b6411b880d6 in scalable_malloc () from ./libtbbmalloc.so.2
#4 0x00002b6411da4279 in operator new(unsigned long) () from ./libtbbmalloc_proxy.so.2
#5 0x00002b641500b8f9 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) () from /opt/spotdev/3rdParty/cpp/gnu/gcc/gcc-4.6.2/lib64/libstdc++.so.6

Any ideas or suggestions to further debug?

Thanks

0 Kudos
5 Replies
Vladimir_P_1234567890
891 Views

Hello,

What are operation system and TBB versions in your case?

Thanks,
--Vladimir 

0 Kudos
pgp78
Beginner
891 Views

This is on CentOS 5.6 64 bit (kernel 2.6.18-238.9.1.el5) and TBB 4.0.5.1

0 Kudos
Alexandr_K_Intel1
891 Views

How often the hang occurs? Can it be reproduced with debug version of allocator?

0 Kudos
pgp78
Beginner
891 Views

The 100% CPU and the crash are two different issues (I should've clarified).  I just reproduced the crash with the debug version.  Here is the stack trace:

#0 0x00002b26bca4045f in rml::internal::Block::allocateFromFreeList (this=0x2aaafc2ec000) at ../../src/tbbmalloc/frontend.cpp:1774
result = 0x1
#1 0x00002b26bca4080a in rml::internal::Block::allocate (this=0x2aaafc2ec000) at ../../src/tbbmalloc/frontend.cpp:1802
result = 0x2b26c19e9980
#2 0x00002b26bca3ece3 in rml::internal::internalPoolMalloc (memPool=0x2b26bcc4b940 <rml::internal::defaultMemPool_space>, size=32) at ../../src/tbbmalloc/frontend.cpp:2075
result = 0x2aaaf251d018
bin = 0x2b26c19e99d0
mallocBlock = 0x2aaafc2ec000
#3 0x00002b26bca3f603 in rml::internal::internalMalloc (size=32) at ../../src/tbbmalloc/frontend.cpp:2156
No locals.
#4 0x00002b26bca3f7b9 in scalable_malloc (size=32) at ../../src/tbbmalloc/frontend.cpp:2394
ptr = 0x2aaaf251d038
#5 0x00002b26bcc601e6 in operator new (sz=32) at ../../src/tbbmalloc/proxy.cpp:166
res = 0x2aaaf251d018

0 Kudos
Vladimir_P_1234567890
891 Views
0 Kudos
Reply