[Bug 1051935] Re: Fails with SystemError when too many files are open

Jason Conti 1051935 at bugs.launchpad.net
Wed Oct 3 23:56:00 UTC 2012


I ran into this bug today while cleaning up my system for an upgrade to
quantal (it actually dup'd me on bug #894314 since it was oneconf
crashing). I was running: apt-get purge package_name; relatively
quickly.

This seems like a minimal reproducer in python:

import apt

while True:
  apt_cache = apt.Cache()

It will eventually consume all of the file descriptors and crash with
the above SystemError. I was not really successful in reproducing with
straight apt_pkg, though apt_pkg.PackageRecords(self._cache) seems to be
the line opening the files. It seems like the issue is that the objects
are not being garbage collected fast enough. If,

gc.collect()

is run each loop it seems oscillate between 59 and 114 fds, instead of
increasing rapidly until python runs out. Even better is:

del apt_cache._records

which oscillates between 3 and 59 fds. So a fix might be to add an
explicit close() method to apt.Cache which deletes at least the _records
object, and perhaps other objects.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python-apt in Ubuntu.
https://bugs.launchpad.net/bugs/1051935

Title:
  Fails with SystemError when too many files are open

Status in “python-apt” package in Ubuntu:
  New

Bug description:
  This error occurs each time I try to install a .deb file with Gdebi in
  Ubuntu 12.10, after the deb installation finishes.

  ProblemType: Crash
  DistroRelease: Ubuntu 12.10
  Package: gdebi 0.8.5build1
  ProcVersionSignature: Ubuntu 3.5.0-14.19-generic 3.5.3
  Uname: Linux 3.5.0-14-generic x86_64
  ApportVersion: 2.5.1-0ubuntu7
  Architecture: amd64
  CrashCounter: 1
  Date: Mon Sep 17 15:33:34 2012
  ExecutablePath: /usr/share/gdebi/gdebi-gtk
  InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha amd64 (20120914)
  InterpreterPath: /usr/bin/python2.7
  PackageArchitecture: all
  ProcCmdline: /usr/bin/python /usr/bin/gdebi-gtk --non-interactive /home/andrei/Downloads/gnomishdark-theme_201208014-1~webupd8_all.deb
  ProcEnviron:
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
   TERM=unknown
  PythonArgs: ['/usr/bin/gdebi-gtk', '--non-interactive', '/home/andrei/Downloads/gnomishdark-theme_201208014-1~webupd8_all.deb']
  SourcePackage: gdebi
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups:

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/1051935/+subscriptions




More information about the foundations-bugs mailing list