Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Igor_P_
Beginner
54 Views

privatizePublicFreeList crush

Hallo all.

We have crash in MALLOC_ASSERT( allocatedCount < (slabSize-sizeof(Block))/objectSize, ASSERT_TEXT ). With call stack:

tbbmalloc.dll!abort()  Line 88 + 0x5 bytes    C
tbbmalloc.dll!rml::internal::Block::privatizePublicFreeList()  Line 1422 + 0x41 bytes    C++
tbbmalloc.dll!rml::internal::Bin::getPublicFreeListBlock()  Line 1281    C++
tbbmalloc.dll!rml::internal::internalPoolMalloc(rml::internal::MemoryPool * memPool, unsigned __int64 size)  Line 2506 + 0x8 bytes    C++
tbbmalloc.dll!scalable_malloc(unsigned __int64 size)  Line 2833 + 0x5 bytes    C++

This is same as https://software.intel.com/en-us/forums/intel-threading-building-blocks/topic/520693 but we dont have crush in MALLOC_ASSERT in checkFreePrecond. 

We use IntelTBB 4.4.

What should we do to debug the problem?

Thanks in advance for your reply.

 

0 Kudos
2 Replies
54 Views

could you try the tbbmalloc debug library? it contains more diagnostics

--Vladimir

54 Views

I able to reproduce such assertion triggering via code below, i.e. this might be a variation of double free. Intel® Inspector might be tried.

#include <thread>
#include "tbb/scalable_allocator.h"

int main(void)
{
    for ( int i = 0; i < 10000; i++ )
    {
        int *a = (int*)scalable_malloc(7000),
            *b = (int*)scalable_malloc(7000);
        std::thread thread1(
            [&a,&b]{
                for (int i=0; i<1000; i++) {
                    scalable_free(a);
                    scalable_free(b);
                }
                a = b = NULL;
        }
        );
        thread1.join();
    }
    return 0;
}
Reply