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

Bug#452858: marked as done (apt: apt-get takes all CPU with /dev/null redirected to stdin)



Your message dated Mon, 07 Jan 2008 21:32:02 +0000
with message-id <E1JBzZi-0002yc-Ie@ries.debian.org>
and subject line Bug#452858: fixed in apt 0.7.10
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: apt
Version: 0.7.7
Severity: important

When /dev/null is redirected to stdin, apt-get uses all CPU during calls
to dpkg. This is due to the use of pselect() on stdin, which always 
returns EOF in that case.

This bug mostly breaks sbuild (or rather render packages installation
very very very very slow), as it redirects /dev/null to stdin.

The patch below fixes the problem.


diff -Nru apt-0.7.9/apt-pkg/deb/dpkgpm.cc apt-0.7.9/apt-pkg/deb/dpkgpm.cc
--- apt-0.7.9/apt-pkg/deb/dpkgpm.cc	2007-10-31 15:30:26 +0000
+++ apt-0.7.9/apt-pkg/deb/dpkgpm.cc	2007-11-25 16:58:01 +0000
@@ -344,7 +344,10 @@
 {
    char input_buf[256] = {0,}; 
    int len = read(0, input_buf, sizeof(input_buf));
-   write(master, input_buf, len);
+   if (len)
+      write(master, input_buf, len);
+   else
+      stdin_is_dev_null = true;
 }
 									/*}}}*/
 // DPkgPM::DoTerminalPty - Read the terminal pty and write log		/*{{{*/
@@ -639,6 +642,8 @@
       }
    }   
 
+   stdin_is_dev_null = false;
+
    // create log
    OpenLog();
 
@@ -868,7 +873,8 @@
 
 	 // wait for input or output here
 	 FD_ZERO(&rfds);
-	 FD_SET(0, &rfds); 
+	 if (!stdin_is_dev_null)
+	    FD_SET(0, &rfds); 
 	 FD_SET(_dpkgin, &rfds);
 	 if(master >= 0)
 	    FD_SET(master, &rfds);
diff -Nru apt-0.7.9/apt-pkg/deb/dpkgpm.h apt-0.7.9/apt-pkg/deb/dpkgpm.h
--- apt-0.7.9/apt-pkg/deb/dpkgpm.h	2007-10-06 21:16:27 +0000
+++ apt-0.7.9/apt-pkg/deb/dpkgpm.h	2007-11-25 16:51:41 +0000
@@ -23,6 +23,8 @@
 {
    private:
 
+   bool stdin_is_dev_null;
+
    // the buffer we use for the dpkg status-fd reading
    char dpkgbuf[1024];
    int dpkgbuf_pos;



-- System Information:
Debian Release: lenny/sid
Architecture: kfreebsd-i386 (i686)

Kernel: kFreeBSD 6.2-1-686
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages apt depends on:
ii  debian-archive-keyring        2007.07.31 GnuPG archive keys of the Debian a
ii  libc0.1                       2.7-1      GNU C Library: Shared libraries
ii  libgcc1                       1:4.2.2-3  GCC support library
ii  libstdc++6                    4.2.2-3    The GNU Standard C++ Library v3

apt recommends no packages.

-- no debconf information



--- End Message ---
--- Begin Message ---
Source: apt
Source-Version: 0.7.10

We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive:

apt-doc_0.7.10_all.deb
  to pool/main/a/apt/apt-doc_0.7.10_all.deb
apt-transport-https_0.7.10_i386.deb
  to pool/main/a/apt/apt-transport-https_0.7.10_i386.deb
apt-utils_0.7.10_i386.deb
  to pool/main/a/apt/apt-utils_0.7.10_i386.deb
apt_0.7.10.dsc
  to pool/main/a/apt/apt_0.7.10.dsc
apt_0.7.10.tar.gz
  to pool/main/a/apt/apt_0.7.10.tar.gz
apt_0.7.10_i386.deb
  to pool/main/a/apt/apt_0.7.10_i386.deb
libapt-pkg-dev_0.7.10_i386.deb
  to pool/main/a/apt/libapt-pkg-dev_0.7.10_i386.deb
libapt-pkg-doc_0.7.10_all.deb
  to pool/main/a/apt/libapt-pkg-doc_0.7.10_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 452858@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Vogt <mvo@debian.org> (supplier of updated apt package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Mon, 07 Jan 2008 21:40:47 +0100
Source: apt
Binary: apt-utils libapt-pkg-doc libapt-pkg-dev apt-transport-https apt-doc apt
Architecture: source all i386
Version: 0.7.10
Distribution: unstable
Urgency: low
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Michael Vogt <mvo@debian.org>
Description: 
 apt        - Advanced front-end for dpkg
 apt-doc    - Documentation for APT
 apt-transport-https - APT https transport
 apt-utils  - APT utility programs
 libapt-pkg-dev - Development files for APT's libapt-pkg and libapt-inst
 libapt-pkg-doc - Documentation for APT development
Closes: 219034 260825 430207 438136 438545 443286 448316 451328 452858 452862 453088 453774 454561 456457 456909 457917 458039 458966 459013
Changes: 
 apt (0.7.10) unstable; urgency=low
 .
   [ Otavio Salvador ]
   * Applied patch from Mike O'Connor <stew@vireo.org> to add a manpage to
     apt-mark, closes: #430207.
   * Applied patch from Andrei Popescu <andreimpopescu@gmail.com> to add a
     note about some frontends in apt.8 manpage, closes: #438545.
   * Applied patch from Aurelien Jarno <aurel32@debian.org> to avoid CPU
     getting crazy when /dev/null is redirected to stdin (which breaks
     buildds), closes: #452858.
   * Applied patch from Aurelien Jarno <aurel32@debian.org> to fix building
     with newest dpkg-shlibdeps changing the packaging building order and a
     patch from Robert Millan <rmh@aybabtu.com> to fix parallel building,
     closes: #452862.
   * Applied patch from Alexander Winston <alexander.winston@comcast.net>
     to use 'min' as symbol for minute, closes: #219034.
   * Applied patch from Amos Waterland <apw@us.ibm.com> to allow apt to
     work properly in initramfs, closes: #448316.
   * Applied patch from Robert Millan <rmh@aybabtu.com> to make apt-key and
     apt-get to ignore time conflicts, closes: #451328.
   * Applied patch from Peter Eisentraut <peter_e@gmx.net> to fix a
     grammatical error ("manual installed" -> "manually installed"),
     closes: #438136.
   * Fix cron.daily job to not call fail if apt isn't installed, closes:
     #443286.
   * Fix compilation warnings in apt-pkg/cdrom.cc and
     apt-pkg/contrib/configuration.cc.
   * Fix typo in debian/copyright file ("licened" instead of "licensed"),
     closes: #458966.
 .
   [ Program translations ]
     - Basque updated. Closes: #453088
     - Vietnamese updated. Closes: #453774, #459013
     - Japanese updated. Closes: #456909
     - Simplified Chinese updated. Closes: #458039
     - French updated.
     - Norwegian Bokmål updated. Closes: #457917
 .
   [ Michael Vogt ]
   * debian/rules
     - fix https install location
   * debian/apt.conf.daily:
     - print warning if the cache can not be locked (closes: #454561),
       thanks to Bastian Kleineidam
   * methods/gpgv.cc:
     - remove cruft code that caused timestamp/I-M-S issues
   * ftparchive/contents.cc:
     - fix error output
   * apt-pkg/acquire-item.{cc,h}:
     - make the authentication download code more robust against
       servers/proxies with broken If-Range implementations
   * apt-pkg/packagemanager.{cc,h}:
     - propergate the Immediate flag to make hitting the
       "E: Internal Error, Could not perform immediate configuration (2)"
       harder
   * debian/control:
     - build against libdb-dev (instead of libdb4.4-dev)
   * merged the apt--DoListUpdate branch, this provides a common interface
     for "apt-get update" like operations for the frontends and also provides
     hooks to run stuff in APT::Update::{Pre,Post}-Invoke
 .
   [ Chris Cheney ]
   * ftparchive/contents.cc:
     - support lzma data members
   * ftparchive/multicompress.cc:
     - support lzma output
 .
   [ Daniel Burrows ]
   * apt-pkg/contrib/configuration.cc:
     - if RootDir is set, then FindFile and FindDir will return paths
       relative to the directory stored in RootDir, closes: #456457.
 .
   [ Christian Perrier ]
   * Fix wording for "After unpacking...". Thanks to Michael Gilbert
     for the patch. Closes: #260825
Files: 
 6d914947720089a1d41b5a429de6849a 941 admin important apt_0.7.10.dsc
 c998cb87cd47d91dfb14a7633e8d0239 1935991 admin important apt_0.7.10.tar.gz
 bdbc3b729f28d21816c6ca1ed54fcb8e 94058 doc optional apt-doc_0.7.10_all.deb
 47ce48f900f1780b5bc42ceb05542398 118496 doc optional libapt-pkg-doc_0.7.10_all.deb
 f3de5d981a4f928daf7860f406d1e7b7 1598306 admin important apt_0.7.10_i386.deb
 ae366c06435d1981e46a9d125d4e16e7 103080 libdevel optional libapt-pkg-dev_0.7.10_i386.deb
 3a2b0fbb597f55e6ebc2bd99a12ce927 190032 admin important apt-utils_0.7.10_i386.deb
 054c186bad0b5a0e29d42c659df7f139 53188 admin optional apt-transport-https_0.7.10_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHgpp2liSD4VZixzQRAmRCAJ9BtF1MmtCJoTW4xSDQDKUbwQTfRACdGxYa
m7wQlkgjwiGiTeYOd38QT2Q=
=bjSD
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: