We are using intel inspector XE 2016 on a game made on Unreal Engine 4 to find memory leaks. However it seems to report a lot of false-positive pairs of "missing allocation" and "memory leak". We suppose that all allocations in one thread but free'd in another thread are causing such false positive reports. Is there a solution/option to tell intel inspector that such reports are linked? We can't find our real memory leak as we are flooded in a lot of those reports.
It seems there is no additional (necessary) option to inform Inspector to avoid false-positive report between threads, e.g. memory leaks, if you try to allocate memory in one thread and free it in other thread, Inspector reported there is no problem found. Here is a simplest test case.
define NUM_THREADS 2
void * funcA(void* args)
s20=(char *)malloc(20); // use s20 in this function
if (s20) g_s20=s20;
// printf("g_s20 = %lx\n", g_s20);
void * funcB(void* args)
if (g_s20) free(g_s20);
pthread_create(&h, 0, funcA, NULL);
sleep(3); // ensure that funcA runs first.
pthread_create(&h, 0, funcB, NULL);
for (i = 0; i < NUM_THREADS; ++i)
pthread_join (h, 0);
$icc -g threads_2.cpp -o threads_2 -lpthread
$inspxe-cl -c mi3 ./threads_2
0 new problem(s) found
$ inspxe-cl -version
Intel(R) Inspector XE 2016 (build 423441) Command Line tool
Copyright (C) 2009-2015 Intel Corporation. All rights reserved.