Bug#569488: apt: apt-get takes all CPU with /dev/null redirected to stdin
Package: apt
Version: 0.7.25.1
Severity: important
Tags: patch
This bug is actually the same as bug#452858, it has been reintroduced
due to a code change. Basically, in apt-pkg/deb/dpkgpm.cc, when master
is 0, stdin is never read, so it is never tested if it corresponds to
/dev/null, while it is always included in the select().
The patch below fixes the problem by not watching for stdin if it will
be ignored later.
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1005,7 +1005,7 @@
// wait for input or output here
FD_ZERO(&rfds);
- if (!stdin_is_dev_null)
+ if (master >= 0 && !stdin_is_dev_null)
FD_SET(0, &rfds);
FD_SET(_dpkgin, &rfds);
if(master >= 0)
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: kfreebsd-i386 (i686)
Kernel: kFreeBSD 8.0-1-686
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages apt depends on:
ii debian-archive-keyring 2009.01.31 GnuPG archive keys of the Debian a
ii libc0.1 2.10.2-2 GNU C Library: Shared libraries
ii libgcc1 1:4.4.3-1 GCC support library
ii libstdc++6 4.4.3-1 The GNU Standard C++ Library v3
apt recommends no packages.
Versions of packages apt suggests:
ii apt-doc 0.7.25.1 Documentation for APT
pn aptitude | synaptic | wajig <none> (no description available)
ii bzip2 1.0.5-4 high-quality block-sorting file co
ii dpkg-dev 1.15.5.6 Debian package development tools
ii lzma 4.43-14 Compression method of 7z format in
pn python-apt <none> (no description available)
-- no debconf information
Reply to: