Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1144304

Summary: memory leak when starting a domain with cpu mode='host-model'
Product: Red Hat Enterprise Linux 6 Reporter: Ján Tomko <jtomko>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.6CC: dyuan, honzhang, mzhan, rbalakri, virt-bugs
Target Milestone: rcKeywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.10.2-48.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1144303 Environment:
Last Closed: 2015-07-22 05:47:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1144303    
Bug Blocks:    

Description Ján Tomko 2014-09-19 08:09:14 UTC
+++ This bug was initially created as a clone of Bug #1144303 +++

Description of problem:


Version-Release number of selected component (if applicable):
libvirt-1.2.8-2.el7

How reproducible:
100%

Steps to Reproduce:
1. Run libvirtd under valgrind:
valgrind --leak-check=full libvirtd
on a host supporting invtsc 
2. Start a domain with <cpu mode='host-model'>

Actual results:
==4403== 7 bytes in 1 blocks are definitely lost in loss record 93 of 1,783
==4403==    at 0x4C2A820: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==4403==    by 0x84ABC19: strdup (in /lib64/libc-2.19.so)
==4403==    by 0x52F0C94: virStrdup (virstring.c:679)
==4403==    by 0x5358CD2: virCPUDefCopyModel (cpu_conf.c:126)
==4403==    by 0x535F594: x86UpdateHostModel (cpu_x86.c:2089)
==4403==    by 0x535F594: x86Update (cpu_x86.c:2126)
==4403==    by 0x20342A: qemuBuildCpuArgStr (qemu_command.c:6159)
==4403==    by 0x20342A: qemuBuildCommandLine (qemu_command.c:7705)
==4403==    by 0x1E734D: qemuProcessStart (qemu_process.c:4306)
==4403==    by 0x1A62C0: qemuDomainObjStart (qemu_driver.c:6235)
==4403==    by 0x1A6882: qemuDomainCreateWithFlags (qemu_driver.c:6290)
==4403==    by 0x5380E31: virDomainCreate (libvirt.c:9001)
==4403==    by 0x172845: remoteDispatchDomainCreate (remote_dispatch.h:3190)
==4403==    by 0x172845: remoteDispatchDomainCreateHelper (remote_dispatch.h:3168)
==4403==    by 0x53DCA98: virNetServerProgramDispatchCall (virnetserverprogram.c:437)
==4403==    by 0x53DCA98: virNetServerProgramDispatch (virnetserverprogram.c:307)


Expected results:
No leak shown in x86UpdateHostModel

Additional information:
Fixed upstream by:
commit 5b5631dedf59e540661bfeac774e543d8d38531b
Author:     Ján Tomko <jtomko>
CommitDate: 2014-09-18 14:49:01 +0200

    Fix leak in x86UpdateHostModel
    
    Commit de0aeaf introduced a memory leak.

git describe: v1.2.8-198-g5b5631d

Comment 3 Jincheng Miao 2015-02-02 08:51:57 UTC
In latest libvirt-0.10.2-48.el6, there is no memory leak:

==9836== LEAK SUMMARY:
==9836==    definitely lost: 0 bytes in 0 blocks
==9836==    indirectly lost: 0 bytes in 0 blocks
==9836==      possibly lost: 7,120 bytes in 41 blocks
==9836==    still reachable: 1,417,072 bytes in 11,395 blocks
==9836==         suppressed: 0 bytes in 0 blocks
==9836== Reachable blocks (those to which a pointer was found) are not shown.
==9836== To see them, rerun with: --leak-check=full --show-reachable=yes
==9836== 
==9836== For counts of detected and suppressed errors, rerun with: -v
==9836== ERROR SUMMARY: 10 errors from 10 contexts (suppressed: 29 from 9)

So set the status to VERIFIED.

Comment 5 errata-xmlrpc 2015-07-22 05:47:33 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/RHBA-2015-1252.html