| Summary: | [libvirt]memleak when "run virsh console guest". | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | zhpeng | ||||
| Component: | libvirt | Assignee: | Alex Jia <ajia> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 6.3 | CC: | acathrow, ajia, cwei, dallan, eblake, mshao, mzhan, rwu, veillard | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | libvirt-0.9.9-1.el6 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2012-06-20 06:39:05 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
It exists a quite big leaks on virConsoleEventOnStdin and virConsoleEventOnStdout. Created attachment 547113 [details]
valgrind full log
(In reply to comment #2) > It exists a quite big leaks on virConsoleEventOnStdin and > virConsoleEventOnStdout. Do you know where the leak is? (In reply to comment #4) > (In reply to comment #2) > > It exists a quite big leaks on virConsoleEventOnStdin and > > virConsoleEventOnStdout. > > Do you know where the leak is? I tried to avoid memory leaks on functions virConsoleEventOnStdin, virConsoleEventOnStdout and virConsoleEventOnStream, but my change has effect on actual 'virsh console' function, it must be my mistake, so I need to check my modification again. Patch for upstream: http://www.redhat.com/archives/libvir-list/2011-December/msg00872.html commit 2b603dcb6c2b8d07044241c9feaf0dfafecad09d
Author: Alex Jia <ajia>
Date: Tue Dec 20 17:40:13 2011 +0800
console: plug memory leaks
Using 'virReallocN' to allocate memory on virConsoleEventOnStdin,
virConsoleEventOnStdout and virConsoleEventOnStream, however, the
cleanup function virConsoleShutdown hasn't released these memory.
* tools/console.c: fix memory leaks on virConsoleShutdown.
Reproduce it with libvirt-0.9.8-1.el6.x86_64. Verify it with libvirt-0.9.9-1.el6 and it passed. 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 |
Description of problem: Memleak when "run virsh console guest". Version-Release number of selected component (if applicable): libvirt-0.9.8-1.el6.x86_64 How reproducible: always Steps to Reproduce: 1. make sure have a working serial on guest like: <serial type='pty'> <source path='/dev/pts/12'/> <target port='0'/> <alias name='serial0'/> </serial> 2. add "console=tty0 console=ttyS0" to the kernel line of guest. 3. reboot the guest 4. valgrind -v --leak-check=full virsh console kvm1 5. login in the guest on step5 and do some operation. 6. leave the console with "Ctrl + ]" Actual results: ==800== 1,024 bytes in 1 blocks are definitely lost in loss record 26 of 33 ==800== at 0x4A05FDE: malloc (vg_replace_malloc.c:236) ==800== by 0x4A06167: realloc (vg_replace_malloc.c:525) ==800== by 0x4C6A6EB: virReallocN (in /usr/lib64/libvirt.so.0.9.8) ==800== by 0x40A867: ??? (in /usr/bin/virsh) ==800== by 0x4C62EDE: ??? (in /usr/lib64/libvirt.so.0.9.8) ==800== by 0x4C61C86: virEventRunDefaultImpl (in /usr/lib64/libvirt.so.0.9.8) ==800== by 0x41C031: ??? (in /usr/bin/virsh) ==800== by 0x4C73BD1: ??? (in /usr/lib64/libvirt.so.0.9.8) ==800== by 0x32E64077F0: start_thread (in /lib64/libpthread-2.12.so) ==800== by 0x32E5CE570C: clone (in /lib64/libc-2.12.so) ==800== ==800== 1,024 bytes in 1 blocks are definitely lost in loss record 27 of 33 ==800== at 0x4A0610F: realloc (vg_replace_malloc.c:525) ==800== by 0x4C6A6EB: virReallocN (in /usr/lib64/libvirt.so.0.9.8) ==800== by 0x40A729: ??? (in /usr/bin/virsh) ==800== by 0x4C62EDE: ??? (in /usr/lib64/libvirt.so.0.9.8) ==800== by 0x4C61C86: virEventRunDefaultImpl (in /usr/lib64/libvirt.so.0.9.8) ==800== by 0x41C031: ??? (in /usr/bin/virsh) ==800== by 0x4C73BD1: ??? (in /usr/lib64/libvirt.so.0.9.8) ==800== by 0x32E64077F0: start_thread (in /lib64/libpthread-2.12.so) ==800== by 0x32E5CE570C: clone (in /lib64/libc-2.12.so) ==800== ==800== LEAK SUMMARY: ==800== definitely lost: 2,048 bytes in 2 blocks ==800== indirectly lost: 0 bytes in 0 blocks ==800== possibly lost: 0 bytes in 0 blocks ==800== still reachable: 127,073 bytes in 1,344 blocks ==800== suppressed: 0 bytes in 0 blocks ==800== Reachable blocks (those to which a pointer was found) are not shown. Expected results: avoid memory leak.