Linux下Valgrind的调试问题,向高手求助
我在开发的过程中,发现有内存泄露(申请没有及时释放)的问题,使用valgrind工具检查发现有很多still reachable的memory,summary如下:
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 0 bytes in 0 blocks
still reachable: 58,576 bytes in 1,958 blocks
suppressed: 0 bytes in 0 blocks
但是没有显示堆栈信息,显示信息如下(部分)
3,552 bytes in 222 blocks are still reachable in loss record 627 of 628
at 0x4A05E1C: malloc (vg_replace_malloc.c:195)
by 0x4579EA: xmalloc (in /bin/bash)
by 0x41FA4F: ??? (in /bin/bash)
by 0x4218DB: yyparse (in /bin/bash)
by 0x41B506: parse_command (in /bin/bash)
by 0x41B5C5: read_command (in /bin/bash)
by 0x41B74D: reader_loop (in /bin/bash)
by 0x41B2A9: main (in /bin/bash)
8,192 bytes in 1 blocks are still reachable in loss record 628 of 628
at 0x4A05E1C: malloc (vg_replace_malloc.c:195)
by 0x4579EA: xmalloc (in /bin/bash)
by 0x446FDF: fd_to_buffered_stream (in /bin/bash)
by 0x447097: with_input_from_buffered_stream (in /bin/bash)
by 0x41B24B: main (in /bin/bash)
命令行参数如下:
valgrind --leak-check=full --show-reachable=yes -v --read-var-info=yes --num-callers=10 --leak-resolution=high
不知道是我的valgrind参数设置问题还是其他什么问题,如何能显示内存泄露调用的堆栈信息?请高手指教。谢谢。
分不够可以再加,这个不是问题。