Bug#419669: apt-cache enters infinite loop on SIGPIPE/EPIPE
Package: apt
Version: 0.6.46.4-0.1
Severity: normal
reportbug starts "apt-cache dumpavail" with its standard out to a
pipe, but apparently closes its side of the pipe before apt-cache is
finished.
This in itself is a bug in reportbug, but the problem with apt-cache
is that instead of failing gracefully (e.g. exit with a non-zero
return code), it enters an infinite loop.
Open fds of reportbug (parent of apt-cache):
reportbug 10131 master 0u CHR 136,3 5 /dev/pts/3
reportbug 10131 master 1u CHR 136,3 5 /dev/pts/3
reportbug 10131 master 2u CHR 136,3 5 /dev/pts/3
Open fds of apt-cache:
apt-cache 10138 master 0u CHR 136,3 5 /dev/pts/3
apt-cache 10138 master 1w FIFO 0,6 223003182 pipe
apt-cache 10138 master 2u CHR 136,3 5 /dev/pts/3
Here's an strace of apt-cache:
--- SIGPIPE (Broken pipe) @ 0 (0) ---
close(3) = 0
stat("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_sid_main_binary-amd64_Packages", {st_mode=S_IFREG|0644, st_size=20747682, ...}) = 0
open("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_sid_main_binary-amd64_Packages", O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
lseek(3, 15675021, SEEK_SET) = 15675021
read(3, "Package: postgresql-contrib-7.4\n"..., 5047) = 5047
write(1, "Package: postgresql-contrib-7.4\n"..., 4096) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
close(3) = 0
stat("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_sid_main_binary-amd64_Packages", {st_mode=S_IFREG|0644, st_size=20747682, ...}) = 0
open("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_sid_main_binary-amd64_Packages", O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
lseek(3, 15675021, SEEK_SET) = 15675021
read(3, "Package: postgresql-contrib-7.4\n"..., 5047) = 5047
write(1, "Package: postgresql-contrib-7.4\n"..., 4096) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
close(3) = 0
stat("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_sid_main_binary-amd64_Packages", {st_mode=S_IFREG|0644, st_size=20747682, ...}) = 0
open("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_sid_main_binary-amd64_Packages", O_RDONLY) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
lseek(3, 15675021, SEEK_SET) = 15675021
read(3, "Package: postgresql-contrib-7.4\n"..., 5047) = 5047
write(1, "Package: postgresql-contrib-7.4\n"..., 4096) = -1 EPIPE (Broken pipe)
-- Package-specific info:
-- apt-config dump --
APT "";
APT::Architecture "amd64";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
Dir "/";
Dir::State "var/lib/apt/";
Dir::State::lists "lists/";
Dir::State::cdroms "cdroms.list";
Dir::State::userstatus "status.user";
Dir::State::status "/var/lib/dpkg/status";
Dir::Cache "var/cache/apt/";
Dir::Cache::archives "archives/";
Dir::Cache::srcpkgcache "srcpkgcache.bin";
Dir::Cache::pkgcache "pkgcache.bin";
Dir::Etc "etc/apt/";
Dir::Etc::sourcelist "sources.list";
Dir::Etc::sourceparts "sources.list.d";
Dir::Etc::vendorlist "vendors.list";
Dir::Etc::vendorparts "vendors.list.d";
Dir::Etc::main "apt.conf";
Dir::Etc::parts "apt.conf.d";
Dir::Etc::preferences "preferences";
Dir::Bin "";
Dir::Bin::methods "/usr/lib/apt/methods";
Dir::Bin::dpkg "/usr/bin/dpkg";
DPkg "";
DPkg::Pre-Install-Pkgs "";
DPkg::Pre-Install-Pkgs:: "/usr/sbin/dpkg-preconfigure --apt || true";
-- (no /etc/apt/preferences present) --
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.18-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_LU.UTF-8, LC_CTYPE=fr_LU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages apt depends on:
ii debian-archive-keyring 2007.02.19 GnuPG archive keys of the Debian a
ii libc6 2.5-2 GNU C Library: Shared libraries
ii libgcc1 1:4.1.1-21 GCC support library
ii libstdc++6 4.1.1-21 The GNU Standard C++ Library v3
apt recommends no packages.
-- no debconf information
Reply to: