|
From: Alex <zhi...@gm...> - 2019-05-15 05:42:22
|
is anyone here?
On Tue, May 14, 2019 at 6:55 PM Alex <zhi...@gm...> wrote:
>
> we have have the simple code like this:
>
> #include <stdlib.h>
> int main(int argc, char *argv[])
> {
> malloc(10);
> return 0;
> }
>
> then run `valgrind --leak-check=no --xml=yes --xml-file=x.xml ./main`
>
> check the x.xml file, we see:
>
> <error>
> <unique>0x0</unique>
> <tid>1</tid>
> <kind>Leak_DefinitelyLost</kind>
> <xwhat>
> <text>10 bytes in 1 blocks are definitely lost in loss record 1 of
> 1</text>
> <leakedbytes>10</leakedbytes>
> <leakedblocks>1</leakedblocks>
> </xwhat>
> <stack>
> <frame>
> <ip>0x4C29E4B</ip>
> <obj>/usr/local/lib/valgrind/vgpreload_memcheck-amd64-linux.so</obj>
> <fn>malloc</fn>
> <dir>/home/yizhi.fzh/valgrind-3.15.0/coregrind/m_replacemalloc</dir>
> <file>vg_replace_malloc.c</file>
> <line>309</line>
> </frame>
> <frame>
> <ip>0x4004FF</ip>
> <obj>/home/yizhi.fzh/github/c-quick-test/main</obj>
> <fn>main</fn>
> <dir>/home/yizhi.fzh/github/c-quick-test</dir>
> <file>main.c</file>
> <line>6</line>
> </frame>
> </stack>
> </error>
>
> $uname -a
> Linux e18c07352.et15sqa 3.10.0-327.ali2008.alios7.x86_64 #1 SMP Tue Nov 29
> 17:56:13 CST 2016 x86_64 x86_64 x86_64 GNU/Linux
>
> $valgrind --version
> valgrind-3.15.0
>
> Thanks
>
|