SEGV in python-apt with python2.5

Bug #63226 reported by Narayan Desai
2
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Fix Released
High
Michael Vogt

Bug Description

I have some simple apt_pkg code that runs properly with 0.6.19-ubuntu5 and python2.4, but causes invalid free messages from glibc or segmentation faults when run with 2.5. The attached code reliably triggers the problem for me. It is:

import apt_pkg
apt_pkg.init()
cache = apt_pkg.GetCache()
installed = {}
for pkg in cache.Packages:
    if pkg.CurrentVer:
        installed[pkg.Name] = pkg.CurrentVer.VerStr

Here are the output from this script, run on edgy with python2.4 and python2.5, respectively.

[0:40] python2.4 /tmp/apt.py
Reading package lists... Done
Building dependency tree
Reading state information... Done
[0:41] python2.5 /tmp/apt.py
Reading package lists... Done
Building dependency tree
Reading state information... Done
*** glibc detected *** python2.5: free(): invalid pointer: 0xb7d9f308 ***

In the python2.5 run, the program goes into a bad state, and requires a kill -9 to kill it.

Michael Vogt (mvo)
Changed in python-apt:
importance: Undecided → High
status: Unconfirmed → Confirmed
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

this is the result of a python2.5 C-API change. I fixed the code in my local tree and the fix will be part of the next upload.

Cheers,
 Michael

Changed in python-apt:
assignee: nobody → mvo
Michael Vogt (mvo)
Changed in python-apt:
status: Confirmed → Fix Committed
Revision history for this message
Michael Vogt (mvo) wrote :
Changed in python-apt:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.