scalable_malloc() causes CPU to spin

scalable_malloc() causes CPU to spin

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:

The stack trace looks as follows:

#0 0x00002b6411b861e9 in rml::internal::Block::privatizePublicFreeList() () from ./
#1 0x00002b6411b868e3 in rml::internal::Bin::getPublicFreeListBlock() () from ./
#2 0x00002b6411b87e00 in rml::internal::internalPoolMalloc(rml::internal::MemoryPool*, unsigned long) () from ./
#3 0x00002b6411b880d6 in scalable_malloc () from ./
#4 0x00002b6411da4279 in operator new(unsigned long) () from ./
#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/

Any ideas or suggestions to further debug?


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


What are operation system and TBB versions in your case?


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

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

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

Leave a Comment

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