Bug 489286 - libvir: error: invalid connection pointer in virConnectClose
libvir: error: invalid connection pointer in virConnectClose
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt (Show other bugs)
5.4
All Linux
low Severity medium
: rc
: ---
Assigned To: Daniel Veillard
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-09 06:48 EDT by Nan Zhang
Modified: 2016-04-26 10:26 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 05:23:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
python script to close the connection to the hypervisor (1.09 KB, text/plain)
2009-03-09 06:48 EDT, Nan Zhang
no flags Details
Clear internal reference after closing connection object (489 bytes, patch)
2009-03-31 08:19 EDT, Daniel Berrange
no flags Details | Diff

  None (edit)
Description Nan Zhang 2009-03-09 06:48:43 EDT
Created attachment 334488 [details]
python script to close the connection to the hypervisor

Description of problem:
Got an error message when invoked function virConnect::close() in python script: libvir: error: invalid connection pointer in virConnectClose
Please refer to the attached script.

Version-Release number of selected component (if applicable):
libvirt-0.6.1-1.el5

How reproducible:
Always

Steps to Reproduce:
1. # python conn_close.py xen:/// (Xen)
2. # python conn_close.py qemu:///system (kvm)

Actual results:
There is an error message:
libvir: error: invalid connection pointer in virConnectClose

Expected results:
Should be no error occurred.

Additional info:
Both Xen and KVM have this issue.
Comment 1 Daniel Berrange 2009-03-09 07:13:09 EDT
What's going on here is:

 - You explicitly called 'close()' which calls virConnectClose() which releases the underlying virConnectPtr object

 - Garbage collection later invokes __del__, which tries to call virConnectClose too. 

The 2nd scenario causes the error message you see. We need to fix the __del__ method, so it only calls virConnectClose(), if the user has not already done so.
Comment 2 Perry Myers 2009-03-30 23:19:44 EDT
Moving to RHEL since libvirt is not supported in RHEV1.0 production builds and this problem will need to be addressed in RHEL5.4 release
Comment 3 Daniel Berrange 2009-03-31 08:19:20 EDT
Created attachment 337293 [details]
Clear internal reference after closing connection object

Posted upstream

http://www.redhat.com/archives/libvir-list/2009-March/msg00494.html
Comment 5 Daniel Veillard 2009-06-05 14:51:01 EDT
That patch was actually included as part of the 0.6.3 rebase, so the fix
is in the current build,

Daniel
Comment 8 Nan Zhang 2009-06-06 03:14:43 EDT
This bug has been verified with libvirt 0.6.3-6 on RHEL-5.4. Already fixed.

[root@dhcp-66-70-85 ~]# uname -r
2.6.18-151.el5xen
[root@dhcp-66-70-85 ~]# py conn_close.py xen:///
PASS

[root@dhcp-66-70-85 ~]# uname -r
2.6.18-151.el5
[root@dhcp-66-70-85 ~]# py conn_close.py qemu:///system
PASS
Comment 10 errata-xmlrpc 2009-09-02 05:23:39 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1269.html

Note You need to log in before you can comment on or make changes to this bug.