[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#497049: wrong GetCache() call causes memory corruption

Package: python-apt

| mowsiany@beczulka:~$ cat bug.py 
| #!/usr/bin/python
| import apt_pkg
| import re
| apt_pkg.InitConfig()
| apt_pkg.InitSystem()
| apt_cache = apt_pkg.GetCache()
| apt_depcache = apt_pkg.GetCache(apt_cache)
| re.compile('a')
| mowsiany@beczulka:~$ ./bug.py 
| Reading package lists... Done
| Building dependency tree       
| Reading state information... Done
| Traceback (most recent call last):
|   File "./bug.py", line 8, in <module>
|     re.compile('a')
|   File "/usr/lib/python2.5/re.py", line 180, in compile
|     return _compile(pattern, flags)
|   File "/usr/lib/python2.5/re.py", line 231, in _compile
|     p = sre_compile.compile(pattern, flags)
|   File "/usr/lib/python2.5/sre_compile.py", line 505, in compile
|     import sre_parse
| AttributeError: done
| mowsiany@beczulka:~$

This was pretty puzzling for me until I noticed that the penultimate line in
the script is wrong. It should have been 

| apt_depcache = apt_pkg.GetDepCache(apt_cache)

And everything works if it's corrected.

However the memory corruption is probably still something that should be fixed?

Marcin Owsiany <porridge@debian.org>             http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216

Reply to: