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!

privatizePublicFreeList crush

Igor_P_
Beginner
128 Views

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
Vladimir_P_Intel2
128 Views

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

--Vladimir

Alexandr_K_Intel1
128 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