[Bug 985452] Re: apt-ftparchive fails on scanning large repositories

2012-04-19 Thread Michael Vogt
To reproduce do:
$ mkdir pool; cd pool
$ apt-get download 2vcard
$ for i in $(seq 1200); do cp 2vcard*.deb homer_clone_$i.deb; done
$ apt-ftparchive packages .  /dev/null

E: Failed to create pipes - pipe (24: Too many open files)

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

Title:
  apt-ftparchive fails on scanning large repositories

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 985452] Re: apt-ftparchive fails on scanning large repositories

2012-04-19 Thread Michael Vogt
Strace shows that the pipe is not closed when the compressor child
exists:

$ strace -e trace=open,dup,close,pipe apt-ftparchive package.  /dev/null
open(./homer_clone_444.deb, O_RDONLY) = 5
pipe([261, 262])= 0
close(262)  = 0
--- SIGCHLD (Child exited) @ 0 (0) ---

It seems like AutoClose in FileFd is set to false for compressed images which 
leads to FileFd::Close() not 
closing the internal iFD which then leads to this leak.

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

Title:
  apt-ftparchive fails on scanning large repositories

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 985452] Re: apt-ftparchive fails on scanning large repositories

2012-04-19 Thread Michael Vogt
I think this is the right approach as AFAIK the old code did close Fds
set via FileFd.Fd()

** Patch added: We could fix it this way to ensure that FileFd.Fd(int) always 
sets AutoClose
   
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/985452/+attachment/3092850/+files/fix1.diff

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

Title:
  apt-ftparchive fails on scanning large repositories

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 985452] Re: apt-ftparchive fails on scanning large repositories

2012-04-19 Thread Michael Vogt
** Patch added: more targeted fix
   
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/985452/+attachment/3092853/+files/fix2.diff

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

Title:
  apt-ftparchive fails on scanning large repositories

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 985452] Re: apt-ftparchive fails on scanning large repositories

2012-04-19 Thread Launchpad Bug Tracker
** Branch linked: lp:~mvo/apt/mvo

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

Title:
  apt-ftparchive fails on scanning large repositories

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 985452] Re: apt-ftparchive fails on scanning large repositories

2012-04-19 Thread Michael Vogt
** Changed in: apt (Ubuntu)
   Status: New = In Progress

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

Title:
  apt-ftparchive fails on scanning large repositories

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 985452] Re: apt-ftparchive fails on scanning large repositories

2012-04-19 Thread Michael Vogt
I uploaded a minimal fix to precise-proposed now.

** Changed in: apt (Ubuntu)
Milestone: ubuntu-12.04 = precise-updates

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

Title:
  apt-ftparchive fails on scanning large repositories

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 985452] Re: apt-ftparchive fails on scanning large repositories

2012-04-19 Thread Ubuntu Foundation's Bug Bot
** Tags added: patch

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

Title:
  apt-ftparchive fails on scanning large repositories

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 985452] Re: apt-ftparchive fails on scanning large repositories

2012-04-19 Thread Martin Pitt
Hello Adam, or anyone else affected,

Accepted apt into precise-proposed. The package will build now and be
available in a few hours. Please test and give feedback here. See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to
enable and use -proposed. Thank you in advance!

** Also affects: apt (Ubuntu Precise)
   Importance: Critical
 Assignee: Michael Vogt (mvo)
   Status: In Progress

** Changed in: apt (Ubuntu Precise)
   Status: In Progress = Fix Committed

** Tags added: verification-needed

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

Title:
  apt-ftparchive fails on scanning large repositories

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 985452] Re: apt-ftparchive fails on scanning large repositories

2012-04-19 Thread Martin Pitt
Adam confirmed on IRC that the new apt fixes the bug.

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

Title:
  apt-ftparchive fails on scanning large repositories

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 985452] Re: apt-ftparchive fails on scanning large repositories

2012-04-19 Thread Launchpad Bug Tracker
This bug was fixed in the package apt - 0.8.16~exp12ubuntu9

---
apt (0.8.16~exp12ubuntu9) precise-proposed; urgency=low

  * apt-inst/contrib/extracttar.cc:
- ensure that in StartGzip the InFd is set to AutoClose to ensure
  that the pipe is closed when InFd is closed. This fixes a Fd leak
  (LP: #985452)
 -- Michael Vogt michael.v...@ubuntu.com   Thu, 19 Apr 2012 11:38:43 +0200

** Changed in: apt (Ubuntu Precise)
   Status: Fix Committed = Fix Released

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

Title:
  apt-ftparchive fails on scanning large repositories

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs