Bug 706966 - python bindings free invalid pointers
Summary: python bindings free invalid pointers
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-23 15:50 UTC by Michal Privoznik
Modified: 2011-12-06 11:09 UTC (History)
4 users (show)

Fixed In Version: libvirt-0.9.2-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 11:09:37 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1513 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-12-06 01:23:30 UTC

Description Michal Privoznik 2011-05-23 15:50:56 UTC
Description of problem:
python bindings free some poninters which are marked by appropiate python documentation as 'must not free', because they point to some internal python/c-api layer structs.

Version-Release number of selected component (if applicable):
libvirt-0.9.1-1.el6

How reproducible:
100% (via vdsClient)

Steps to Reproduce:
1. vdsClient -s 0 getVdsCaps
2. observe glibc error message
3.
  
Actual results:
client crashes

Expected results:
client prints useful information about capabilities

Additional info:

Comment 2 Michal Privoznik 2011-05-24 07:27:28 UTC
Solution send to review:

https://www.redhat.com/archives/libvir-list/2011-May/msg01416.html

Comment 3 Michal Privoznik 2011-05-24 08:45:01 UTC
Moving to POST:

commit ef54d045c34caab7f17b2f6b46fc978d9baf81e2
Author: Michal Privoznik <mprivozn>
Date:   Mon May 23 14:41:00 2011 +0200

    python: Don't free must-not-free variables
    
    py_str() function call PyString_AsString(). As written in documentation,
    the caller must not free the returned value, because it points to some
    internal structures.


v0.9.1-229-gef54d04

Comment 5 Daniel Veillard 2011-06-23 03:20:24 UTC
This should be fixed by the libvirt-0.9.2-1.el6 rebase

Comment 6 Gunannan Ren 2011-06-28 08:44:54 UTC
The bug has been verified on libvirt-0.9.2-1.el6 
vdsClient -s 0 getVdsCaps outputs as follows

        HBAInventory = {'iSCSI': [{'InitiatorName': 'iqn.1994-05.com.redhat:465962c66f36'}], 'FC': []}
        ISCSIInitiatorName = iqn.1994-05.com.redhat:465962c66f36
        bondings = {'bond4': {'hwaddr': '00:00:00:00:00:00', 'cfg': {}, 'netmask': '', 'addr': '', 'slaves': []}, 'bond0': {'hwaddr': '00:00:00:00:00:00', 'cfg': {}, 'netmask': '', 'addr': '', 'slaves': []}, 'bond1': {'hwaddr': '00:00:00:00:00:00', 'cfg': {}, 'netmask': '', 'addr': '', 'slaves': []}, 'bond2': {'hwaddr': '00:00:00:00:00:00', 'cfg': {}, 'netmask': '', 'addr': '', 'slaves': []}, 'bond3': {'hwaddr': '00:00:00:00:00:00', 'cfg': {}, 'netmask': '', 'addr': '', 'slaves': []}}
        clusterLevels = ['2.3', '3.0']
        cpuCores = 2
        cpuFlags = fpu,vme,de,pse,tsc,msr,pae,mce,cx8,apic,mtrr,pge,mca,cmov,pat,pse36,clflush,dts,acpi,mmx,fxsr,sse,sse2,ss,ht,tm,pbe,syscall,nx,lm,constant_tsc,arch_perfmon,pebs,bts,rep_good,aperfmperf,pni,dtes64,monitor,ds_cpl,vmx,smx,est,tm2,ssse3,cx16,xtpr,pdcm,sse4_1,xsave,lahf_lm,tpr_shadow,vnmi,flexpriority,model_486,model_pentium,model_pentium2,model_pentium3,model_pentiumpro,model_qemu32,model_coreduo,model_core2duo,model_n270,model_Conroe,model_Penryn,model_Opteron_G1
        cpuModel = Intel(R) Core(TM)2 Duo CPU     E8500  @ 3.16GHz
        cpuSockets = 1
        cpuSpeed = 3158.954
        emulatedMachines = ['rhel6.1.0', 'pc', 'rhel6.0.0', 'rhel5.5.0', 'rhel5.4.4', 'rhel5.4.0']
        guestOverhead = 65
        hooks = {}
        kvmEnabled = true
        lastClient = 10.66.4.224
        lastClientIface = eth0
        management_ip = 
        memSize = 3668
        networks = {'virbr0': {'cfg': {}, 'netmask': '255.255.255.0', 'stp': 'on', 'ports': ['virbr0-nic', 'vnet0'], 'addr': '192.168.122.1'}}
        nics = {'eth0': {'hwaddr': '00:23:AE:77:07:BE', 'netmask': '255.255.252.0', 'speed': 1000, 'addr': '10.66.4.224'}}
        operatingSystem = {'release': '6.1.0.2.el6', 'version': '6Server', 'name': 'RHEL'}
        packages2 = {'kernel': {'release': '131.0.15.el6.x86_64', 'buildtime': '0', 'version': '2.6.32'}, 'spice-server': {'release': '1.el6', 'buildtime': '1299536258', 'version': '0.8.0'}, 'vdsm': {'release': '77.el6', 'buildtime': '1309164535', 'version': '4.9'}, 'qemu-kvm': {'release': '2.165.el6', 'buildtime': '1308076995', 'version': '0.12.1.2'}, 'libvirt': {'release': '1.el6', 'buildtime': '1308575600', 'version': '0.9.2'}, 'qemu-img': {'release': '2.165.el6', 'buildtime': '1308076995', 'version': '0.12.1.2'}}
        reservedMem = 256
        software_revision = 77
        software_version = 4.9
        supportedProtocols = ['2.2', '2.3']
        supportedRHEVMs = ['2.3', '3.0']
        uuid = 44454C4C-5000-1039-8051-B9C04F4C3258_00:23:AE:77:07:BE
        version_name = Snow Man
        vlans = {}
        vmTypes = ['kvm']

Comment 8 Rita Wu 2011-07-06 10:57:19 UTC
Set it as VERIFIED per comment 6

Comment 9 errata-xmlrpc 2011-12-06 11:09:37 UTC
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/RHBA-2011-1513.html


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