Found any

Even when I compile and run the program like this:

int main() {
    return 0;
}

      

I am getting the following valgrind errors when I run valgrind --leak-check=yes ./a.out

==26391== LEAK SUMMARY:
==26391==    definitely lost: 0 bytes in 0 blocks
==26391==    indirectly lost: 0 bytes in 0 blocks
==26391==      possibly lost: 72 bytes in 3 blocks
==26391==    still reachable: 200 bytes in 6 blocks
==26391==         suppressed: 18,528 bytes in 153 blocks
==26391== Reachable blocks (those to which a pointer was found) are not shown.
==26391== To see them, rerun with: --leak-check=full --show-leak-kinds=all

      

I am compiling with clang++ test.cpp

. I am fixing this.

Thank!

+3


source to share


1 answer


The Valgrind manual has the following information on Potentially Lost

This means that a chain of one or more pointers to the block was, but at least one of the pointers is a pointer to the interior. This could just be a random value in memory that appears to be pointing to a block, and therefore you shouldn't consider this ok unless you know you have interior pointers.



This means that all reported events possibly lost

are not leaked. This needs to be confirmed by reading the leak check code.

In your particular case, we know there is no leak in your code. You might want to run again valgrind

with--leak-check=full --show-leak-kinds=all

+1


source







All Articles