Bug 690734

Summary: virsh memory leak with failed connection attempts
Product: Red Hat Enterprise Linux 6 Reporter: Alex Jia <ajia>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED UPSTREAM QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.1CC: dallan, dyuan, eblake, jyang, llim, yoyzhang
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-20 19:18:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
memory leak information none

Description Alex Jia 2011-03-25 08:13:41 UTC
Created attachment 487500 [details]
memory leak information

Description of problem:
Running virsh qemu-monitor-command with a incorrect command string will lead to memory leak.


Version-Release number of selected component (if applicable):
# uname -r
2.6.32-120.el6.x86_64
# rpm -q libvirt
libvirt-0.8.7-14.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.152.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. valgrind --leak-check=full virsh qemu-monitor-command vr-rhel6-x86_64-kvm '{"execute":"human-monitor-command","arguments":{"command-line":"info kvm"}'
2.
3.
  
Actual results:
error: out of memory.

Expected results:
fix it

Additional info:
Please see attachment.

Comment 2 Osier Yang 2011-03-25 08:43:10 UTC
it's same problem with https://bugzilla.redhat.com/show_bug.cgi?id=688723, what you see "out of memory" is a misleading error.

*** This bug has been marked as a duplicate of bug 688723 ***

Comment 3 Alex Jia 2011-03-25 14:27:30 UTC
(In reply to comment #2)
> it's same problem with https://bugzilla.redhat.com/show_bug.cgi?id=688723, what
> you see "out of memory" is a misleading error.
> 
> *** This bug has been marked as a duplicate of bug 688723 ***

Osier,
You mean the following missing memory byte is acceptable, right?
==13864== LEAK SUMMARY:
==13864==    definitely lost: 42 bytes in 3 blocks


Alex

Comment 4 Eric Blake 2011-03-25 14:33:58 UTC
(In reply to comment #3)
> You mean the following missing memory byte is acceptable, right?
> ==13864== LEAK SUMMARY:
> ==13864==    definitely lost: 42 bytes in 3 blocks

No, that is not okay.  Reopening this bug.  Meanwhile, can you provide more details: what does valgrind --leak-check=full list as the backtrace that allocated the leaked memory?

Comment 5 Alex Jia 2011-03-25 14:53:37 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > You mean the following missing memory byte is acceptable, right?
> > ==13864== LEAK SUMMARY:
> > ==13864==    definitely lost: 42 bytes in 3 blocks
> 
> No, that is not okay.  Reopening this bug.  Meanwhile, can you provide more
> details: what does valgrind --leak-check=full list as the backtrace that
> allocated the leaked memory?

Hi Eric,
I have provided it in the attachment, please see attachment, if information is not enough, please let me know.


Alex

Comment 6 Eric Blake 2011-03-25 21:01:08 UTC
Upstream patch posted to plug the leak listed in the attachment:
https://www.redhat.com/archives/libvir-list/2011-March/msg01196.html

Comment 7 RHEL Program Management 2011-04-04 01:46:42 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 8 Eric Blake 2011-04-04 16:51:25 UTC
Memory leaks are never good; however, the first round upstream patch in comment 6 was rejected with more work required.  Requesting exception to allow more time to get this fixed in time for 6.1.

Comment 13 Dave Allan 2011-10-20 19:13:39 UTC
(In reply to comment #6)
> Upstream patch posted to plug the leak listed in the attachment:
> https://www.redhat.com/archives/libvir-list/2011-March/msg01196.html

Eric, did we take this patch upstream?  If so, I'm going to close the BZ.

Comment 14 Eric Blake 2011-10-20 19:18:39 UTC
I don't know that the particular patch mentioned in comment 6 was specifically included, but that area of code has been completely rewritten upstream due to the new RPC code.  I think it is safe to mark this as closed, and any new leaks should be new BZ with a stacktrace to the current state of code.