Bug 1001536
| Summary: | some memory leaks in libvirt client | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Hao Liu <hliu> | |
| Component: | libvirt | Assignee: | Ján Tomko <jtomko> | |
| Status: | CLOSED WONTFIX | QA Contact: | Virtualization Bugs <virt-bugs> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | medium | |||
| Version: | 6.5 | CC: | acathrow, dyuan, hliu, jdenemar, jtomko, lsu, mzhan, zhwang | |
| Target Milestone: | rc | Keywords: | Upstream | |
| Target Release: | --- | |||
| Hardware: | x86_64 | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | Bug Fix | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1001957 (view as bug list) | Environment: | ||
| Last Closed: | 2014-04-04 21:27:11 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: | ||||
| Bug Blocks: | 1001957 | |||
| 
        
          Description
        
        
          Hao Liu
        
        
        
        
        
          2013-08-27 09:00:35 UTC
        
       a) should be fixed upstream by
commit 1e3a252974c8e5c650f1d84dc2b167f0ae8cee3c
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-06-25 15:10:27 +0200
    virsh: edit: don't leak XML string on reedit or redefine
The rest needs to be fixed upstream as well.
Upstream patches for leaks b) to e): https://www.redhat.com/archives/libvir-list/2013-August/msg01372.html Leaks b) to e) are now fixed upstream:
commit 14d5328681448267dfc0812948fa2c6ec4dfa7d4
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-08-27 13:47:57 +0200
Commit:     Ján Tomko <jtomko>
CommitDate: 2013-08-28 08:05:56 +0200
    virsh: free the caps list properly if one of them is invalid
    
    VIR_FREE(caps) is not enough to free an array allocated
    by vshStringToArray.
    
    ==17== 4 bytes in 1 blocks are definitely lost in loss record 4 of 728
    ==17==    by 0x4EFFC44: virStrdup (virstring.c:554)
    ==17==    by 0x128B10: _vshStrdup (virsh.c:125)
    ==17==    by 0x129164: vshStringToArray (virsh.c:218)
    ==17==    by 0x157BB3: cmdNodeListDevices (virsh-nodedev.c:409)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1001536
commit 785ff34bf884a721544ea531c000e8a140e485fa
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-08-27 13:34:09 +0200
Commit:     Ján Tomko <jtomko>
CommitDate: 2013-08-28 08:05:56 +0200
    virsh: free the formatting string when listing pool details
    
    ==23== 41 bytes in 1 blocks are definitely lost in loss record 626 of 727
    ==23==    by 0x4F0099F: virAsprintfInternal (virstring.c:358)
    ==23==    by 0x15D2C9: cmdPoolList (virsh-pool.c:1268)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1001536
commit f733eac058b373822708d3ec889dd80e281fa7e1
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-08-27 13:27:50 +0200
Commit:     Ján Tomko <jtomko>
CommitDate: 2013-08-28 08:05:56 +0200
    virsh: free the list from ListAll APIs even for 0 items
    
    virsh secret-list leak when no secrets are defined:
    
    ==27== 8 bytes in 1 blocks are definitely lost in loss record 6 of 726
    ==27==    by 0x4E941DD: virAllocN (viralloc.c:183)
    ==27==    by 0x5037F1A: remoteConnectListAllSecrets (remote_driver.c:3076)
    ==27==    by 0x5004EC6: virConnectListAllSecrets (libvirt.c:16298)
    ==27==    by 0x15F813: vshSecretListCollect (virsh-secret.c:397)
    ==27==    by 0x15F0E1: cmdSecretList (virsh-secret.c:532)
    
    And so do some other *-list commands.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1001536
commit 66d124b45472addc10d286ca291aa5411fcb381f
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-08-27 13:07:27 +0200
Commit:     Ján Tomko <jtomko>
CommitDate: 2013-08-28 08:05:56 +0200
    virsh: free messages after logging them to a file
    
    The messages were only freed on error.
    
    ==12== 1,100 bytes in 1 blocks are definitely lost in loss record 698 of 729
    ==12==    by 0x4E98C22: virBufferAsprintf (virbuffer.c:294)
    ==12==    by 0x12C950: vshOutputLogFile (virsh.c:2440)
    ==12==    by 0x12880B: vshError (virsh.c:2254)
    ==12==    by 0x131957: vshCommandOptDomainBy (virsh-domain.c:109)
    ==12==    by 0x14253E: cmdStart (virsh-domain.c:3333)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1001536
git describe: v1.1.1-245-g14d5328
hi Jan I met the following mem leak while i start the guest under the valgrind, will these mem leak be fixed in this bug ? please help check it. thanks pkg info libvirt-0.10.2-29.el6.x86_64 qemu-kvm-rhev-0.12.1.2-2.415.el6.x86_64 kernel-2.6.32-425.el6.x86_64 steps 1.In terminal 1 run the following command: #service libvirtd stop # valgrind --leak-check=full libvirtd 2.In termianl2 start a guest #virsh start rhelguest1 Domain rhelguest1 started 3.Check the mem leak in terminal 1 valgrind output: ==17370== 968 bytes in 1 blocks are definitely lost in loss record 1,419 of 1,580 ==17370== at 0x4A069EE: malloc (vg_replace_malloc.c:270) ==17370== by 0x389F6A4254: xmlGetGlobalState (in /usr/lib64/libxml2.so.2.7.6) ==17370== by 0x389F6A3394: __xmlGenericError (in /usr/lib64/libxml2.so.2.7.6) ==17370== by 0x389F6E7956: xmlRelaxNGNewParserCtxt (in /usr/lib64/libxml2.so.2.7.6) ==17370== by 0x3897607C8C: ??? (in /usr/lib64/libnetcf.so.1.4.0) ==17370== by 0x38976049E5: ncf_init (in /usr/lib64/libnetcf.so.1.4.0) ==17370== by 0x4F4F48: interfaceOpenInterface (interface_backend_netcf.c:141) ==17370== by 0x4F11ECC: do_open (libvirt.c:1212) ==17370== by 0x4F12B5A: virConnectOpen (libvirt.c:1333) ==17370== by 0x440C77: remoteDispatchOpenHelper (remote.c:758) ==17370== by 0x4F614A1: virNetServerProgramDispatch (virnetserverprogram.c:431) ==17370== by 0x4F633AD: virNetServerProcessMsg (virnetserver.c:170) ==17370== 80 bytes in 1 blocks are definitely lost in loss record 932 of 1,580 ==17370== at 0x4A0577B: calloc (vg_replace_malloc.c:593) ==17370== by 0x4E791ED: virAlloc (memory.c:100) ==17370== by 0x4E90A87: virLastErrorObject (virterror.c:204) ==17370== by 0x4E913C8: virResetLastError (virterror.c:355) ==17370== by 0x4F12B4E: virConnectOpen (libvirt.c:1332) ==17370== by 0x440C77: remoteDispatchOpenHelper (remote.c:758) ==17370== by 0x4F614A1: virNetServerProgramDispatch (virnetserverprogram.c:431) ==17370== by 0x4F633AD: virNetServerProcessMsg (virnetserver.c:170) ==17370== by 0x4F63A4B: virNetServerHandleJob (virnetserver.c:191) ==17370== by 0x4E83DEB: virThreadPoolWorker (threadpool.c:144) ==17370== by 0x4E836D8: virThreadHelper (threads-pthread.c:161) ==17370== by 0x38952079D0: start_thread (in /lib64/libpthread-2.12.so) ==17370== ==17370== 80 bytes in 1 blocks are definitely lost in loss record 933 of 1,580 ==17370== at 0x4A0577B: calloc (vg_replace_malloc.c:593) ==17370== by 0x4E791ED: virAlloc (memory.c:100) ==17370== by 0x4E90A87: virLastErrorObject (virterror.c:204) ==17370== by 0x4E913C8: virResetLastError (virterror.c:355) ==17370== by 0x4F11759: virConnectGetURI (libvirt.c:1702) ==17370== by 0x437372: remoteDispatchGetURIHelper (remote_dispatch.h:7317) ==17370== by 0x4F614A1: virNetServerProgramDispatch (virnetserverprogram.c:431) ==17370== by 0x4F633AD: virNetServerProcessMsg (virnetserver.c:170) ==17370== by 0x4F63A4B: virNetServerHandleJob (virnetserver.c:191) ==17370== by 0x4E83DEB: virThreadPoolWorker (threadpool.c:144) ==17370== by 0x4E836D8: virThreadHelper (threads-pthread.c:161) ==17370== by 0x38952079D0: start_thread (in /lib64/libpthread-2.12.so) ==17370== ==17370== 80 bytes in 1 blocks are definitely lost in loss record 934 of 1,580 ==17370== at 0x4A0577B: calloc (vg_replace_malloc.c:593) ==17370== by 0x4E791ED: virAlloc (memory.c:100) ==17370== by 0x4E90A87: virLastErrorObject (virterror.c:204) ==17370== by 0x4E913C8: virResetLastError (virterror.c:355) ==17370== by 0x4F0CB92: virDomainLookupByName (libvirt.c:2119) ==17370== by 0x43EF9D: remoteDispatchDomainLookupByNameHelper (remote_dispatch.h:3105) ==17370== by 0x4F614A1: virNetServerProgramDispatch (virnetserverprogram.c:431) ==17370== by 0x4F633AD: virNetServerProcessMsg (virnetserver.c:170) ==17370== by 0x4F63A4B: virNetServerHandleJob (virnetserver.c:191) ==17370== by 0x4E83DEB: virThreadPoolWorker (threadpool.c:144) ==17370== by 0x4E836D8: virThreadHelper (threads-pthread.c:161) ==17370== by 0x38952079D0: start_thread (in /lib64/libpthread-2.12.so) ==17370== LEAK SUMMARY: ==17370== definitely lost: 1,208 bytes in 4 blocks For more details ,you can check this Hi, this bug is about leaks in virsh. None of the daemon leaks you show will be fixed, as they seem to be false positives. Development Management has reviewed and declined this request. You may appeal this decision by reopening this request. |