memory leak(?) in stack command
Masatake YAMATO
yamato at redhat.com
Sat Dec 14 04:34:43 UTC 2013
Hi,
I've tried stack command under valgrind.
valgrind reports some memory leaks. Is it expected behavior or known issue?
$ LD_LIBRARY_PATH=/usr/local/lib valgrind --leak-check=full stack -p 2234
==17863== Memcheck, a memory error detector
==17863== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==17863== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==17863== Command: stack -p 2234
==17863==
TID 2234:
#0 0x0000003aa8ee7600 __read
#1 0x00007fcad2c0a287 getbyte
#2 0x00007fcad2c09556 getkeymapcmd
#3 0x00007fcad2c09768 getkeycmd
#4 0x00007fcad2c0b2f7 zlecore
#5 0x00007fcad2c0beed zleread
#6 0x000000000043f44f zleentry
#7 0x00000000004403f6 ingetc
#8 0x0000000000439c76 ihgetc
#9 0x000000000044a13c zshlex
#10 0x0000000000466b47 parse_event
#11 0x000000000043cc29 loop
#12 0x000000000043fe26 zsh_main
#13 0x0000003aa8e21b45 __libc_start_main
#14 0x000000000040ecd1 _start
==17863==
==17863== HEAP SUMMARY:
==17863== in use at exit: 6,144 bytes in 61 blocks
==17863== total heap usage: 452 allocs, 391 frees, 17,063,018 bytes allocated
==17863==
==17863== 816 (224 direct, 592 indirect) bytes in 1 blocks are definitely lost in loss record 14 of 15
==17863== at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==17863== by 0x4E3C41D: duplicate_frame_state (cfi.c:50)
==17863== by 0x4E3DBBF: __libdw_frame_at_address (cfi.c:478)
==17863== by 0x4E3E23C: dwarf_cfi_addrframe (dwarf_cfi_addrframe.c:49)
==17863== by 0x4E50EC7: handle_cfi (frame_unwind.c:502)
==17863== by 0x4E51197: __libdwfl_frame_unwind (frame_unwind.c:605)
==17863== by 0x4E4FE17: dwfl_thread_getframes (dwfl_frame.c:325)
==17863== by 0x401305: thread_callback (stack.c:90)
==17863== by 0x4E4FBDA: dwfl_getthreads (dwfl_frame.c:264)
==17863== by 0x400F74: main (stack.c:176)
==17863==
==17863== 5,296 (3,136 direct, 2,160 indirect) bytes in 14 blocks are definitely lost in loss record 15 of 15
==17863== at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==17863== by 0x4E3C41D: duplicate_frame_state (cfi.c:50)
==17863== by 0x4E3DBBF: __libdw_frame_at_address (cfi.c:478)
==17863== by 0x4E3E23C: dwarf_cfi_addrframe (dwarf_cfi_addrframe.c:49)
==17863== by 0x4E50EC7: handle_cfi (frame_unwind.c:502)
==17863== by 0x4E51197: __libdwfl_frame_unwind (frame_unwind.c:605)
==17863== by 0x4E51261: dwfl_frame_pc (dwfl_frame_pc.c:53)
==17863== by 0x40116C: frame_callback (stack.c:47)
==17863== by 0x4E4FE40: dwfl_thread_getframes (dwfl_frame.c:317)
==17863== by 0x401305: thread_callback (stack.c:90)
==17863== by 0x4E4FBDA: dwfl_getthreads (dwfl_frame.c:264)
==17863== by 0x400F74: main (stack.c:176)
==17863==
==17863== LEAK SUMMARY:
==17863== definitely lost: 3,360 bytes in 15 blocks
==17863== indirectly lost: 2,752 bytes in 45 blocks
==17863== possibly lost: 0 bytes in 0 blocks
==17863== still reachable: 32 bytes in 1 blocks
==17863== suppressed: 0 bytes in 0 blocks
==17863== Reachable blocks (those to which a pointer was found) are not shown.
==17863== To see them, rerun with: --leak-check=full --show-reachable=yes
==17863==
==17863== For counts of detected and suppressed errors, rerun with: -v
==17863== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 2 from 2)
Masatake YAMATO
More information about the elfutils-devel
mailing list