Networking Reference
In-Depth Information
Once we run the previous command, Valgrind will check for memory errors using
the memcheck tool. You could specify it using tool=memcheck , but this would
be pointless in this case since memcheck is the default tool. The output would be
something similar to the following:
==98190== Conditional jump or move depends on uninitialised value(s)
==98190== at 0x2D923: __vfprintf
==98190== by 0x4AC5A: vfprintf_l
==98190== by 0x952BE: printf
==98190== by 0x1F5E: main (test.c:8)
==98190== 4 bytes in 1 blocks are definitely lost in loss record 1 of 5
==98190== at 0xF656: malloc (vg_replace_malloc.c:195)
==98190== by 0x1F46: main (test.c:6)
==98190== LEAK SUMMARY:
==98190== definitely lost: 4 bytes in 1 blocks
==98190== indirectly lost: 0 bytes in 0 blocks
==98190== possibly lost: 0 bytes in 0 blocks
Let's now describe the preceding output:
• We could ignore 98190 since it is the process ID
Conditional jump or move depends on uninitialised value(s)
means we have uninitialized variables in our code
definitely lost means there is a memory leak and we need to ix it
indirectly lost means the blocks that point to another block are lost
possibly lost means there is a memory leak, unless you really know
what you are doing
By default, Valgrind uses $PREFIX/lib/valgrind/default.supp . However,
we need to create our own suppression file to use with ZeroMQ, which would
be something like the following:
{
<socketcall_sendto>
Memcheck:Param
 
Search MirCeyron ::




Custom Search