Red Hat Bugzilla – Bug 1144303
memory leak when starting a domain with cpu mode='host-model'
Last modified: 2015-03-05 02:44:52 EST
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@redhat.com> 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
Reproduce this bug with libvirt-1.2.8-2.el7 1.steps follow the comment 0, see the mem leak in x86UpdateHostModel =12932== 7 bytes in 1 blocks are definitely lost in loss record 69 of 860 ==12932== at 0x4C28BBD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==12932== by 0x82D18B9: strdup (strdup.c:42) ==12932== by 0x52EC014: virStrdup (virstring.c:676) ==12932== by 0x5354123: virCPUDefCopyModel (cpu_conf.c:121) ==12932== by 0x535AA7C: x86UpdateHostModel (cpu_x86.c:2089) ==12932== by 0x535AA7C: x86Update (cpu_x86.c:2126) ==12932== by 0x1C3EC0EB: qemuBuildCpuArgStr (qemu_command.c:6110) ==12932== by 0x1C3EC0EB: qemuBuildCommandLine (qemu_command.c:7603) ==12932== by 0x1C41741B: qemuProcessStart (qemu_process.c:4215) ==12932== by 0x1C467930: qemuDomainObjStart (qemu_driver.c:6227) ==12932== by 0x1C467F31: qemuDomainCreateWithFlags (qemu_driver.c:6282) ==12932== by 0x5386D7B: virDomainCreate (libvirt.c:9001) ==12932== by 0x1426AB: remoteDispatchDomainCreate (remote_dispatch.h:3129) ==12932== by 0x1426AB: remoteDispatchDomainCreateHelper (remote_dispatch.h:3107) ==12932== by 0x53E9571: virNetServerProgramDispatchCall (virnetserverprogram.c:437) ==12932== by 0x53E9571: virNetServerProgramDispatch (virnetserverprogram.c:307) 2.update the libvirt to libvirt-1.2.8-4.el7, re-do the steps in comment 0 , didn't see the mem leak info in x86UpdateHostModel, so mark this bug verifed
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-2015-0323.html