/var/log/apt/history.log fd leaked on lvs invocation

Bug #636010 reported by Loïc Minier
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: apt

Hi

While removing a kernel of my system, I saw:
File descriptor 46 (/var/log/apt/history.log) leaked on lvs invocation. Parent PID 17966: /bin/sh

Except of the log:
[...]
Suppression de linux-image-2.6.35-19-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.35-19-generic /boot/vmlinuz-2.6.35-19-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 2.6.35-19-generic /boot/vmlinuz-2.6.35-19-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.35-20-generic
Found initrd image: /boot/initrd.img-2.6.35-20-generic
Found linux image: /boot/vmlinuz-2.6.32-21-generic
Found initrd image: /boot/initrd.img-2.6.32-21-generic
Found memtest86+ image: /memtest86+.bin
Found memtest86+ multiboot image: /memtest86+_multiboot.bin
File descriptor 46 (/var/log/apt/history.log) leaked on lvs invocation. Parent PID 17966: /bin/sh
Found Debian GNU/Linux (squeeze/sid) on /dev/mapper/bee--vg0-sid--chroot
done
The link /vmlinuz.old is a damaged link
Removing symbolic link vmlinuz.old
 you may need to re-run your boot loader[grub]
The link /initrd.img.old is a damaged link
Removing symbolic link initrd.img.old
 you may need to re-run your boot loader[grub]
Purge des fichiers de configuration de linux-image-2.6.35-19-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.35-19-generic /boot/vmlinuz-2.6.35-19-generic
[...]

This suggests APT is leaving a file open to a child which it should not?

Cheers,

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: apt 0.8.3ubuntu3
ProcVersionSignature: Ubuntu 2.6.35-20.29-generic 2.6.35.4
Uname: Linux 2.6.35-20-generic x86_64
Architecture: amd64
Date: Sat Sep 11 22:40:02 2010
ProcEnviron:
 LANGUAGE=fr_FR:fr:en_GB:en
 PATH=(custom, user)
 LANG=fr_FR.UTF-8
 SHELL=/bin/zsh
SourcePackage: apt

Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Michael Vogt (mvo) wrote :

It seems this is because OpenLog() is called in the parent process and the fd for it is not closed in the child.

Changed in apt (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
JMFTheVCI (jmfthevci) wrote :
Revision history for this message
Loïc Minier (lool) wrote :

I think lvs is just the reporting tool; it just happens that it's programmed defensively, and reports fds coming from the environment.

bug #591823 discuss this happening both in upgrades and by running lvs from a shell; the former is the same bug as here, the latter is another bug, might be local configuration.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 0.8.16~exp12ubuntu8

---------------
apt (0.8.16~exp12ubuntu8) precise; urgency=low

  * Set FD_CLOEXEC on history.log's FD (Closes: #610069, LP: #636010)
 -- Adam Conrad <email address hidden> Thu, 12 Apr 2012 16:26:20 -0600

Changed in apt (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers