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

Bug#439029: marked as done (libapt leaks file descriptors)



Your message dated Sun, 13 Jul 2008 16:30:06 +0200
with message-id <200807131630.06243.thijs@debian.org>
and subject line fixed in 0.7.7
has caused the Debian Bug report #439029,
regarding libapt leaks file descriptors
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 this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
439029: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439029
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libapt
Severity: important
Tags: patch


repeated calls to libapt results in leaking file descriptors, this
only causes a serious problem if you are doing an entire mirrors
worth.  It does NOT leak one FD per .deb file processed.  

I discovered this when I collected all the checksums from a mirror
for tripwire like usage, for example after processing a few
hundred files I get the following:
etch:~# ls -al /proc/2348/fd
total 15
dr-x------ 2 root root  0 Aug 21 18:24 .
dr-xr-xr-x 5 root root  0 Aug 21 18:24 ..
lrwx------ 1 root root 64 Aug 21 18:24 0 -> /dev/ttyp3
lrwx------ 1 root root 64 Aug 21 18:24 1 -> /dev/ttyp3
l-wx------ 1 root root 64 Aug 21 18:25 10 -> /tmp/cdr/gDrBVM.cdr/usr/lib/perl/5.8.8/auto/Fcntl/Fcntl.bs (deleted)
l-wx------ 1 root root 64 Aug 21 18:25 11 -> /tmp/cdr/gDrBVM.cdr/usr/lib/perl/5.8.8/auto/File/Glob/Glob.bs (deleted)
l-wx------ 1 root root 64 Aug 21 18:25 12 -> /tmp/cdr/gDrBVM.cdr/usr/lib/perl/5.8.8/auto/IO/IO.bs (deleted)
l-wx------ 1 root root 64 Aug 21 18:25 13 -> /tmp/cdr/gDrBVM.cdr/usr/lib/perl/5.8.8/auto/List/Util/Util.bs (deleted)
l-wx------ 1 root root 64 Aug 21 18:25 14 -> /tmp/cdr/gDrBVM.cdr/usr/lib/perl/5.8.8/auto/POSIX/POSIX.bs (deleted)
l-wx------ 1 root root 64 Aug 21 18:25 15 -> /tmp/cdr/gDrBVM.cdr/usr/lib/perl/5.8.8/auto/Socket/Socket.bs (deleted)
lrwx------ 1 root root 64 Aug 21 18:24 2 -> /dev/ttyp3
....

Michael Vogt wrote the following patch which I tested and it works:
=== modified file 'apt-inst/contrib/extracttar.cc'
--- apt-inst/contrib/extracttar.cc	2007-06-08 23:44:03 +0000
+++ apt-inst/contrib/extracttar.cc	2007-08-02 09:53:25 +0000
@@ -332,7 +332,7 @@
       }
       
       // And finish up
-      if (Itm.Size != 0 && BadRecord == false)
+      if (Itm.Size >= 0 && BadRecord == false)
 	 if (Stream.FinishedFile(Itm,Fd) == false)
 	    return false;
       

=== modified file 'debian/changelog'
--- debian/changelog	2007-08-01 22:51:20 +0000
+++ debian/changelog	2007-08-02 09:56:27 +0000
@@ -1,3 +1,10 @@
+apt (0.7.7) UNRELEASED; urgency=low
+
+  * apt-inst/contrib/extracttar.cc:
+    - fix fd leak for zero size files 
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 02 Aug 2007 11:55:54 +0200
+
 apt (0.7.6) unstable; urgency=low
 
   * Applied patch from Aurelien Jarno <aurel32@debian.org> to fix wrong


-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16.33-xen
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
ANSI_X3.4-1968)
=== modified file 'apt-inst/contrib/extracttar.cc'
--- apt-inst/contrib/extracttar.cc	2007-06-08 23:44:03 +0000
+++ apt-inst/contrib/extracttar.cc	2007-08-02 09:53:25 +0000
@@ -332,7 +332,7 @@
       }
       
       // And finish up
-      if (Itm.Size != 0 && BadRecord == false)
+      if (Itm.Size >= 0 && BadRecord == false)
 	 if (Stream.FinishedFile(Itm,Fd) == false)
 	    return false;
       

=== modified file 'debian/changelog'
--- debian/changelog	2007-08-01 22:51:20 +0000
+++ debian/changelog	2007-08-02 09:56:27 +0000
@@ -1,3 +1,10 @@
+apt (0.7.7) UNRELEASED; urgency=low
+
+  * apt-inst/contrib/extracttar.cc:
+    - fix fd leak for zero size files 
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 02 Aug 2007 11:55:54 +0200
+
 apt (0.7.6) unstable; urgency=low
 
   * Applied patch from Aurelien Jarno <aurel32@debian.org> to fix wrong


--- End Message ---
--- Begin Message ---
Version: 0.7.7

Confirmed fixed in 0.7.7


--- End Message ---

Reply to: