Question

If I run valgrind

valgrind --show-reachable=yes /home/costa/Desktop/zadacha_2_7/main.c

it says that I have Still Reachable, so I understand that it means that there is some memory, which wasn't deallocated.

Here is valgrind's output:

==2841== Memcheck, a memory error detector
==2841== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==2841== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==2841== Command: /home/costa/Desktop/zadacha_2_7/main.c
==2841== /home/costa/Desktop/zadacha_2_7/main.c: 5: 
         /home/costa/Desktop/zadacha_2_7/main.c: Syntax error: "(" unexpected
==2841== 
==2841== HEAP SUMMARY:
==2841==     in use at exit: 1,084 bytes in 68 blocks
==2841==   total heap usage: 70 allocs, 2 frees, 2,100 bytes allocated
==2841== 
==2841== LEAK SUMMARY:
==2841==    definitely lost: 0 bytes in 0 blocks
==2841==    indirectly lost: 0 bytes in 0 blocks
==2841==      possibly lost: 0 bytes in 0 blocks
==2841==    still reachable: 1,084 bytes in 68 blocks
==2841==         suppressed: 0 bytes in 0 blocks
==2841== Rerun with --leak-check=full to see details of leaked memory
==2841== 
==2841== For counts of detected and suppressed errors, rerun with: -v
==2841== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

So, I'd like to see these reachable blocks (that are not shown), how can I do that?

I don't get it, why doesn't valgrind show anything about these blocks with option --show-reachable=yes?

Was it helpful?

Solution

Cf the output of valgrind you copied here:

==2841== Rerun with --leak-check=full to see details of leaked memory
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top