RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1329046 - "virsh perf $guest --enable '' " has memory leak.
Summary: "virsh perf $guest --enable '' " has memory leak.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-21 02:49 UTC by Fangge Jin
Modified: 2016-11-03 18:43 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.3.4-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:43:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description Fangge Jin 2016-04-21 02:49:11 UTC
Description of problem:
"virsh perf $guest --enable '' " has memory leak.

Version-Release number of selected component:
libvirt-1.3.3-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
# valgrind --leak-check=full virsh perf rhel7.2-1030 --enable ''
==28057== Memcheck, a memory error detector
==28057== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==28057== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==28057== Command: virsh perf rhel7.2-1030 --enable
==28057==
error: Failed to get option 'enable': Option argument is empty

error: One or more references were leaked after disconnect from the hypervisor
==28057==
==28057== HEAP SUMMARY:
==28057==     in use at exit: 104,702 bytes in 1,088 blocks
==28057==   total heap usage: 2,008 allocs, 920 frees, 824,661 bytes allocated
==28057==
==28057== 69 (56 direct, 13 indirect) bytes in 1 blocks are definitely lost in loss record 129 of 183
==28057==    at 0x4C2B974: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28057==    by 0x54E9214: virAllocVar (viralloc.c:560)
==28057==    by 0x5533005: virObjectNew (virobject.c:193)
==28057==    by 0x55D516A: virGetDomain (datatypes.c:279)
==28057==    by 0x563FC7E: get_nonnull_domain (remote_driver.c:7462)
==28057==    by 0x563FC7E: remoteDomainLookupByName (remote_client_bodies.h:2972)
==28057==    by 0x55DFC3D: virDomainLookupByName (libvirt-domain.c:425)
==28057==    by 0x12EF30: virshLookupDomainInternal (virsh-domain.c:116)
==28057==    by 0x133707: virshCommandOptDomainBy (virsh-domain.c:153)
==28057==    by 0x139FEC: cmdPerf (virsh-domain.c:8619)
==28057==    by 0x16262F: vshCommandRun (vsh.c:1274)
==28057==    by 0x12D997: main (virsh.c:984)
==28057==
==28057== LEAK SUMMARY:
==28057==    definitely lost: 56 bytes in 1 blocks
==28057==    indirectly lost: 13 bytes in 1 blocks
==28057==      possibly lost: 0 bytes in 0 blocks
==28057==    still reachable: 104,633 bytes in 1,086 blocks
==28057==         suppressed: 0 bytes in 0 blocks
==28057== Reachable blocks (those to which a pointer was found) are not shown.
==28057== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==28057==
==28057== For counts of detected and suppressed errors, rerun with: -v
==28057== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 1 from 1)


Expected results:
No memory leak.

Comment 2 Peter Krempa 2016-04-21 08:01:59 UTC
Fixed upstream:

commit f4f916a9e35d50fe423443e95ca02b28fb2d0e0b
Author: Peter Krempa <pkrempa>
Date:   Thu Apr 21 09:51:08 2016 +0200

    virsh: perf: Don't leak domain
    
    After failing to parse the perf event list, the code would return
    failure without freeing the previously acquired object. Rearrange the
    code to avoid the problem.

Comment 4 yafu 2016-05-06 09:00:17 UTC
Verify the bug with libvirt-1.3.4-1.el7.x86_64.

Steps:
1.# valgrind --leak-check=full virsh perf rhel7.1 --enable ''
==25443== Memcheck, a memory error detector
==25443== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==25443== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==25443== Command: virsh perf rhel7.1 --enable 
==25443== 
error: Failed to get option 'enable': Option argument is empty

==25443== 
==25443== HEAP SUMMARY:
==25443==     in use at exit: 102,877 bytes in 1,067 blocks
==25443==   total heap usage: 1,965 allocs, 898 frees, 818,846 bytes allocated
==25443== 
==25443== LEAK SUMMARY:
==25443==    definitely lost: 0 bytes in 0 blocks
==25443==    indirectly lost: 0 bytes in 0 blocks
==25443==      possibly lost: 0 bytes in 0 blocks
==25443==    still reachable: 102,877 bytes in 1,067 blocks
==25443==         suppressed: 0 bytes in 0 blocks
==25443== Reachable blocks (those to which a pointer was found) are not shown.
==25443== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==25443== 
==25443== For counts of detected and suppressed errors, rerun with: -v
==25443== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 1 from 1)


No memory leak. So mark this bug verified.

Comment 6 errata-xmlrpc 2016-11-03 18:43:38 UTC
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.

https://rhn.redhat.com/errata/RHSA-2016-2577.html


Note You need to log in before you can comment on or make changes to this bug.