Hide Forgot
Description of problem: Memory leak on cmdNetworkInfo function, allocate memory to 'bridge'(char *bridge = NULL), but without free it. Version-Release number of selected component (if applicable): # uname -r 2.6.32-160.el6.x86_64 # rpm -q libvirt libvirt-0.9.3-5.el6.x86_64 # rpm -q qemu-kvm qemu-kvm-0.12.1.2-2.169.el6.x86_64 How reproducible: always Steps to Reproduce: 1. valgrind -v --leak-check=full virsh net-info default 2. check 'LEAK SUMMARY' Actual results: --15089-- REDIR: 0x386a282440 (__GI_memset) redirected to 0x4a08e30 (memset) Name default UUID f19f2e66-9401-4e6f-b105-5a00b5490d62 Active: yes Persistent: yes Autostart: yes Bridge: virbr0 ==15089== ==15089== HEAP SUMMARY: ==15089== in use at exit: 68,480 bytes in 47 blocks ==15089== total heap usage: 1,071 allocs, 1,024 frees, 2,887,246 bytes allocated ==15089== ==15089== Searching for pointers to 47 not-freed blocks ==15089== Checked 1,230,840 bytes ==15089== ==15089== 7 bytes in 1 blocks are definitely lost in loss record 1 of 15 ==15089== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) ==15089== by 0x386A314B3D: xdr_string (in /lib64/libc-2.12.so) ==15089== by 0x4CFC5AD: xdr_remote_nonnull_string (remote_protocol.c:30) ==15089== by 0x4CFD108: xdr_remote_network_get_bridge_name_ret (remote_protocol.c:1999) ==15089== by 0x4D062D1: virNetMessageDecodePayload (virnetmessage.c:286) ==15089== by 0x4D03735: virNetClientProgramCall (virnetclientprogram.c:318) ==15089== by 0x4CE7752: call (remote_driver.c:3927) ==15089== by 0x4CEDDD2: remoteNetworkGetBridgeName (remote_client_bodies.h:3384) ==15089== by 0x4CC4E3E: virNetworkGetBridgeName (libvirt.c:8503) ==15089== by 0x40F614: cmdNetworkInfo (virsh.c:5019) ==15089== by 0x410CC2: vshCommandRun (virsh.c:12758) ==15089== by 0x41F286: main (virsh.c:14110) ==15089== ==15089== LEAK SUMMARY: ==15089== definitely lost: 7 bytes in 1 blocks Expected results: Avoid memory leak. Additional info: Has fix this issue: https://www.redhat.com/archives/libvir-list/2011-July/msg00917.html https://www.redhat.com/archives/libvir-list/2011-July/msg00921.html
https://www.redhat.com/archives/libvir-list/2011-August/msg00067.html
commit 22da8c941cc806a40cee69955ecb105f9b8e5a40 Author: Alex Jia <ajia> Date: Tue Aug 2 16:31:36 2011 +0800 virsh: fix memory leak in cmdNetworkInfo * tools/virsh.c: avoid memory leak in cmdNetworkInfo. * how to reproduce? % valgrind -v --leak-check=yes virsh net-info default https://bugzilla.redhat.com/show_bug.cgi?id=722806 Move to POST.
Reproduced this bug with libvirt-0.9.4-0rc2.el6. Verified PASS with libvirt-0.9.4-1.el6 pkgs: qemu-kvm-0.12.1.2-2.176.el6 kernel-2.6.32-176.el6 ==12064== ==12064== HEAP SUMMARY: ==12064== in use at exit: 331,377 bytes in 53 blocks ==12064== total heap usage: 1,113 allocs, 1,060 frees, 2,892,195 bytes allocated ==12064== ==12064== Searching for pointers to 53 not-freed blocks ==12064== Checked 1,519,304 bytes ==12064== ==12064== LEAK SUMMARY: ==12064== definitely lost: 0 bytes in 0 blocks ==12064== indirectly lost: 0 bytes in 0 blocks ==12064== possibly lost: 0 bytes in 0 blocks ==12064== still reachable: 331,377 bytes in 53 blocks ==12064== suppressed: 0 bytes in 0 blocks ==12064== Reachable blocks (those to which a pointer was found) are not shown. ==12064== To see them, rerun with: --leak-check=full --show-reachable=yes ==12064== ==12064== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 8 from 6) --12064-- --12064-- used_suppression: 8 dl-hack3-cond-1 ==12064== ==12064== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 8 from 6)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1513.html