Bug 786674
Summary: | Plug memory leak on cmdUndefine | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Alex Jia <ajia> |
Component: | libvirt | Assignee: | Alex Jia <ajia> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 6.3 | CC: | acathrow, dyuan, mzhan, pkrempa, rwu, veillard, yupzhang, zpeng |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-0.9.10-1.el6 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-06-20 06:47:46 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Alex Jia
2012-02-02 06:21:01 UTC
Fixed upstream with: commit 6152c74595df3ac0bb4dad083beef842a28d7d0d Author: Alex Jia <ajia> Date: Thu Feb 2 14:25:25 2012 +0800 virsh: Plug memory leak on cmdUndefine Detected by valgrind. Leak is introduced in commit 3bb6bcf. Free 'vol' memory before allocating memory, the codes will miss one time free when 'vol_i = nvolumes' in for loop, so plug memory leak. I can reproduce this issue with: libvirt-0.9.9-2.el6.x86_64 verify with: libvirt-0.9.10-1.el6.x86_64 step: # dd if=/dev/null of=/var/lib/libvirt/images/foo bs=1 count=1 seek=10M # virsh define foo.xml (disk source file points to '/var/lib/libvirt/images/foo') # virsh vol-clone foo foo-clone default (the original guest name is 'foo') # virsh pool-refresh default # virsh vol-list default (make sure 'foo-clone' volume exists) # virsh define foo-clone.xml (disk source file points to '/var/lib/libvirt/images/foo-clone') # valgrind -v --leak-check=full virsh undefine foo-clone --remove-all-storage virsh output: Domain foo-clone has been undefined Volume '/var/lib/libvirt/images/foo-clone' removed. no leak error display valgrind result: ==26328== LEAK SUMMARY: ==26328== definitely lost: 0 bytes in 0 blocks ==26328== indirectly lost: 0 bytes in 0 blocks ==26328== possibly lost: 0 bytes in 0 blocks ==26328== still reachable: 127,873 bytes in 1,360 blocks ==26328== suppressed: 0 bytes in 0 blocks ==26328== Reachable blocks (those to which a pointer was found) are not shown. ==26328== To see them, rerun with: --leak-check=full --show-reachable=yes ==26328== ==26328== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 8 from 6) --26328-- --26328-- used_suppression: 8 dl-hack3-cond-1 ==26328== ==26328== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 8 from 6) verification passed. move to verified. 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/RHSA-2012-0748.html |