Fails with SystemError when too many files are open
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gdebi (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Precise |
Fix Released
|
Undecided
|
Unassigned | ||
Saucy |
Fix Released
|
Medium
|
Unassigned | ||
oneconf (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Precise |
Fix Released
|
Undecided
|
Unassigned | ||
Saucy |
Fix Released
|
Undecided
|
Unassigned | ||
python-apt (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Precise |
Fix Released
|
High
|
Unassigned | ||
Saucy |
Fix Released
|
Medium
|
Unassigned | ||
ubiquity (Ubuntu) |
Fix Released
|
Undecided
|
Brian Murray | ||
Precise |
Fix Released
|
High
|
Brian Murray | ||
Saucy |
Won't Fix
|
Undecided
|
Dimitri John Ledkov |
Bug Description
[Impact]
* Failure to complete installation.
[Test Case]
* At times, apt cache can run out of file descriptors as seen in this bug and its duplicates.
* There is no clear-cut way to reproduce it in ubiquity, but there is a significant amount of crash reports submit, which dropped off after the proposed fix has been applied.
[Regression Potential]
* The proposed fix has been well tested in trusty both automated & manual testing and does not regress on any configuration.
[Other Info]
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
ProcVersionSign
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/
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha amd64 (20120914)
InterpreterPath: /usr/bin/python2.7
PackageArchitec
ProcCmdline: /usr/bin/python /usr/bin/gdebi-gtk --non-interactive /home/andrei/
ProcEnviron:
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
TERM=unknown
PythonArgs: ['/usr/
SourcePackage: gdebi
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:
Related branches
- Ubuntu Installer Team: Pending requested
-
Diff: 158 lines (+68/-62)2 files modifieddebian/changelog (+5/-0)
ubiquity/install_misc.py (+63/-62)
- Dimitri John Ledkov: Approve
-
Diff: 158 lines (+67/-61)2 files modifieddebian/changelog (+5/-0)
ubiquity/install_misc.py (+62/-61)
tags: | removed: need-duplicate-check |
Changed in gdebi (Ubuntu): | |
importance: | Undecided → Medium |
summary: |
- gdebi-gtk crashed with SystemError in open(): E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal- - updates_main_binary-amd64_Packages - open (24: Too many open files), - E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_universe_i18n_Translation- - en - open (24: Too many open files), E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_restricted_i18n_Translation- - en - open (24: Too many open files), E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_multiverse_i18n_Translation- - en - open (24: Too many open files), E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_main_i18n_Translation- - en - open (24: Too many open files), E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_multiverse_binary-i386_Packages - - open (24: Too many open files), E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_universe_binary-i386_Packages - - open (24: Too many open files), E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_restricted_binary-i386_Packages - - open (24: Too many open files), E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_main_binary-i386_Packages - - open (24: Too many open files), E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_multiverse_binary- - amd64_Packages - open (24: Too many open files), E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_universe_binary- - amd64_Packages - open (24: Too many open files), E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_restricted_binary- - amd64_Packages - open (24: Too many open files), E:Could not open file - /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_quantal_main_binary- - amd64_Packages - open (24: Too many open files) + Fails with SystemError when too many files are open |
affects: | gdebi (Ubuntu) → python-apt (Ubuntu) |
Changed in python-apt (Ubuntu): | |
status: | Confirmed → Triaged |
tags: | added: raring |
tags: | added: rls-s-tracking |
Changed in ubiquity (Ubuntu Saucy): | |
assignee: | nobody → Dmitrijs Ledkovs (xnox) |
Changed in ubiquity (Ubuntu): | |
assignee: | Dmitrijs Ledkovs (xnox) → Brian Murray (brian-murray) |
Changed in ubiquity (Ubuntu Saucy): | |
status: | Confirmed → Won't Fix |
Changed in ubiquity (Ubuntu): | |
status: | Confirmed → Fix Committed |
Changed in ubiquity (Ubuntu Precise): | |
importance: | Undecided → High |
milestone: | none → ubuntu-12.04.4 |
status: | New → Triaged |
description: | updated |
Changed in ubiquity (Ubuntu Precise): | |
status: | Triaged → In Progress |
Changed in ubiquity (Ubuntu Precise): | |
assignee: | nobody → Brian Murray (brian-murray) |
Changed in python-apt (Ubuntu Precise): | |
importance: | Undecided → High |
status: | Confirmed → In Progress |
Changed in oneconf (Ubuntu Precise): | |
status: | Confirmed → Fix Released |
Changed in gdebi (Ubuntu Precise): | |
status: | Confirmed → Fix Released |
no longer affects: | python-apt |
tags: | added: vivid |
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.