On 24/09/10 18:33, Steven Chamberlain wrote:
python/acquire.cc: In function 'PyObject* PkgAcquireNew(PyTypeObject*,
PyObject*, PyObject*)':
python/acquire.cc:331: warning:
'pkgAcquire::pkgAcquire(pkgAcquireStatus*)' is deprecated (declared at
/usr/include/apt-pkg/acquire.h:352)

Actually, here's our culprint:

python/acquire-item.cc: In function 'PyObject* acquireitem_repr(PyObject*)':
python/acquire-item.cc:170: warning: format '%lu' expects type 'long unsigned 
int', but argument 7 has type 'long long unsigned int'

A 'long unsigned int' became a 'long long unsigned int', but on amd64 those data types are the same, which is why we only saw an issue on i386.


Please try rebuilding python-apt with my patch to fix this, attached.

$ apt-get source python-apt
$ sudo apt-get build-dep python-apt
$ cd python-apt-0.7.97.1
$ patch -p1 < ~/python-apt-bug596408.patch
$ dpkg-buildpackage
$ sudo dpkg -i ../python-apt_0.7.97.1_amd64.deb

You may wish to remove python-apt-dbg if you had that installed.

If you immediately run unattended-upgrades, it should successfully upgrade any packages without segfaulting. It may 'upgrade' the python-apt back to the broken version, too, unless you put that package on hold. But that fact that it succeeds in performing an upgrade without segfaulting means that the patch worked.

It's working for me on the same 32-bit squeeze OpenVZ VE that I reproduced the bug on, and I've also tested this on a native amd64 system to ensure the patched version still works on that architecture too.

Thank you everyone for your help to reproduce and debug this.

Regards,
--
Steven Chamberlain
ste...@pyro.eu.org
--- python-apt-0.7.97.1~orig/python/acquire-item.cc	2010-05-19 11:48:44.000000000 +0100
+++ python-apt-0.7.97.1/python/acquire-item.cc	2010-09-24 19:07:39.000000000 +0100
@@ -162,7 +162,7 @@
         return 0;
     return PyString_FromFormat("<%s object: "
                                "Status: %i Complete: %i Local: %i IsTrusted: %i "
-                               "FileSize: %lu DestFile:'%s' "
+                               "FileSize: %llu DestFile:'%s' "
                                "DescURI: '%s' ID:%lu ErrorText: '%s'>",
                                Self->ob_type->tp_name,
                                Itm->Status, Itm->Complete, Itm->Local, Itm->IsTrusted(),

Reply via email to