"File descriptor \d+ (\S+) leaked on lvs invocation."

Bug #591823 reported by Daniel Richard G. on 2010-06-09
226
This bug affects 47 people
Affects Status Importance Assigned to Milestone
aptitude
Fix Released
Unknown
lvm2
Fix Released
Unknown
lvm2 (Ubuntu)
Undecided
Unassigned

Bug Description

If you see messages like these:

File descriptor 40 (/var/lib/dpkg/status) leaked on lvs invocation. Parent PID 1854: /bin/sh
File descriptor 41 (/var/lib/dpkg/status) leaked on lvs invocation. Parent PID 1854: /bin/sh
File descriptor 42 (/var/lib/dpkg/status) leaked on lvs invocation. Parent PID 1854: /bin/sh
File descriptor 43 (/var/lib/dpkg/status) leaked on lvs invocation. Parent PID 1854: /bin/sh

You can set LVM_SUPPRESS_FD_WARNINGS to suppress these warnings.

Reference:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581339
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=432986
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466138

This is a slightly controversial bug and it's not yet fixed either way (aka fix not to leak file descriptors or stop warning by default)

Daniel Richard G. (skunk) wrote :

Just to be complete, I am attaching the full message text from unattended-upgrades, from which the above excerpt was taken.

Zdenek Kabelac (zdenek-kabelac) wrote :

Note - leaked message is basically harmless - it only reports that it was executed from environment which left more opened descriptors than stdin/out/err - this may present security problem - that's why lvm tool report this issue. So effectively it means the problem is in the executing shelll which leaves descriptors opened while calling lvm.

Daniel Richard G. (skunk) wrote :

Should this be considered a bug in dpkg, then?

Peshko R. (peshko-us) wrote :

I got the same message every time I update the grub.cfg.

Sachin Garg (sgarg-bugreporter) wrote :

Looks to be a grub issue:

Setting up grub-common (1.98-1ubuntu7) ...

Setting up grub-pc (1.98-1ubuntu7) ...
Installation finished. No error reported.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-23-generic
Found initrd image: /boot/initrd.img-2.6.32-23-generic
Found linux image: /boot/vmlinuz-2.6.32-22-generic
Found initrd image: /boot/initrd.img-2.6.32-22-generic
Found linux image: /boot/vmlinuz-2.6.31-21-generic
Found initrd image: /boot/initrd.img-2.6.31-21-generic
Found memtest86+ image: /memtest86+.bin
File descriptor 3 (pipe:[920941]) leaked on lvs invocation. Parent PID 29481: /bin/sh
done

Simon Déziel (sdeziel) wrote :

I believe this bug is related to a Debian bug affecting grub-pc (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549976). This Debian bug was reported to be fixed by Colin Watson so maybe the patch could be applied to Lucid too.

JMFTheVCI (jmfthevci) wrote :

Also affects me on Maverick
Linux ubuntuJMF 2.6.35-23-generic #41-Ubuntu SMP Wed Nov 24 10:18:49 UTC 2010 i686 GNU/Linux

Patola (patola) wrote :

If it's from the calling shell this bug is present in zsh, bash and pdksh (Note: ran as nonroot to avoid excess information):

[patola@ubuntola grabber]% lvs
File descriptor 15 (pipe:[15011]) leaked on lvs invocation. Parent PID 3077: /bin/zsh
File descriptor 16 (pipe:[15011]) leaked on lvs invocation. Parent PID 3077: /bin/zsh
  WARNING: Running as a non-root user. Functionality may be unavailable.
[patola@ubuntola grabber]% bash
[patola@ubuntola grabber]% lvs
File descriptor 15 (pipe:[15011]) leaked on lvs invocation. Parent PID 7501: bash
File descriptor 16 (pipe:[15011]) leaked on lvs invocation. Parent PID 7501: bash
  WARNING: Running as a non-root user. Functionality may be unavailable.
[patola@ubuntola grabber]% exit
[patola@ubuntola grabber]% pdksh
$ lvs
File descriptor 15 (pipe:[15011]) leaked on lvs invocation. Parent PID 7576: pdksh
File descriptor 16 (pipe:[15011]) leaked on lvs invocation. Parent PID 7576: pdksh
  WARNING: Running as a non-root user. Functionality may be unavailable.
$
[patola@ubuntola grabber]%

Loïc Minier (lool) wrote :

I certainly don't get this error running lvs alone.

I suspect lvs is reporting these issues coming from various programs as it discovers open fds when called; if you're seeing this with bash, check your startup files or environment (e.g. it could be left open by your display manager, window manager, session manager or whatever is in the tree of processes launching your shell). You can see open files by poking /proc/<pid>/fd/*

Charles Curley (charlescurley) wrote :

I saw this today during two dist-upgrades followed by removing old
kernels. In both instances, this is on 10.10.

--------------------------------------------------
root@dzur:~# aptitude purge linux-image-2.6.35-24-generic
The following packages will be REMOVED:
  linux-headers-2.6.35-27{u} linux-headers-2.6.35-27-generic{u}
  linux-image-2.6.35-24-generic{p}
0 packages upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 229MB will be freed.
Do you want to continue? [Y/n/?] y
(Reading database ... 206796 files and directories currently installed.)
Removing linux-headers-2.6.35-27-generic ...
Removing linux-headers-2.6.35-27 ...
(Reading database ... 187208 files and directories currently installed.)
Removing linux-image-2.6.35-24-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.35-24-generic /boot/vmlinuz-2.6.35-24-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 2.6.35-24-generic /boot/vmlinuz-2.6.35-24-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.35-28-generic
Found initrd image: /boot/initrd.img-2.6.35-28-generic
Found linux image: /boot/vmlinuz-2.6.35-27-generic
Found initrd image: /boot/initrd.img-2.6.35-27-generic
Found linux image: /boot/vmlinuz-2.6.35-25-generic
Found initrd image: /boot/initrd.img-2.6.35-25-generic
Found memtest86+ image: /memtest86+.bin
File descriptor 42 (/var/log/apt/history.log) leaked on lvs invocation. Parent PID 5389: /bin/sh
Found Ubuntu 10.10 (10.10) on /dev/mapper/master09-root09
done
Purging configuration files for linux-image-2.6.35-24-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.35-24-generic /boot/vmlinuz-2.6.35-24-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 2.6.35-24-generic /boot/vmlinuz-2.6.35-24-generic

root@dzur:~#
--------------------------------------------------

On the other machine, the file descriptor is 42.

I see no error message when running lvs, root or non-root.

Changed in lvm2:
status: Unknown → Fix Released
Janne Snabb (snabb) wrote :

I am seeing this on Ubuntu 11.10 beta2 also.

Even though the message can be just ignored, it still looks ugly.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lvm2 (Ubuntu):
status: New → Confirmed
Chris (chrisspelberg) wrote :

The bug still affects me:

I'm using Ubuntu 11.10, upgraded from 10.04 LTS, 10.10, 11.04

Changed in aptitude:
status: Unknown → New

The bug affects my system as well: Ubuntu 11.10 oneiric, headless server, well-patched.

Problem occured while removing the -12 kernel.

Still not fixed in 12.04 or 12.10.

nils (internationils) wrote :

Just saw this bug on upgrading from precise to quantal, so it's still there...

Changed in aptitude:
status: New → Confirmed
DjznBR (djzn-br) wrote :

I made a switch to LVM and I noticed this warning today.
Quantal Quetzal here, clean install.

Jiri Hoogeveen (wica128) wrote :

Hi,

I see this issue also when ussing any lvm2 command.

Ubuntu: 12.10

root@kvm-01n2:/mnt# lvm version
File descriptor 3 (pipe:[17738213]) leaked on lvm invocation. Parent PID 20331: -bash
  LVM version: 2.02.95(2) (2012-03-06)
  Library version: 1.02.74 (2012-03-06)
  Driver version: 4.22.0

This is a bug, because I need to filter it out in some scripts :)

Dimitri John Ledkov (xnox) wrote :

See updated bug description about the reason behind this and how to ignore these if you are affected.

description: updated
Changed in lvm2 (Ubuntu):
status: Confirmed → Opinion
Ville Koskinen (villek) wrote :

For what it's worth, I encountered this warning message in Debian Wheezy. The reason I'm reporting it here is because I only got the warning message after installing memtest86+. Previously, updating the kernel or rerunning the GRUB configuration did not cause the warning to appear. After installing memtest86+, it's as described:

File descriptor 3 (pipe:[200228]) leaked on lvs invocation. Parent PID 4167: /bin/sh

Wheezy does not install memtest86+ by default, while Ubuntu does (at least when I last used it). Could this be part of the problem or the solution?

Joost Ringoot (joost) wrote :

File descriptor 84 (/dev/pts/7) leaked on lvs invocation. Parent PID 13547: /bin/sh
File descriptor 84 (/dev/pts/7) leaked on lvs invocation. Parent PID 11219: /usr/sbin/grub-probe
File descriptor 84 (/dev/pts/7) leaked on vgs invocation. Parent PID 14875: /usr/sbin/grub-probe

I have this on a Ubuntu 14.10 system( multiboot with fedora 20 and windows 7) when executing "apt-get autoremove" the old kernel was not removed, but it was removed after running "apt-get autoremove" a second time.

Aaahh Ahh (woohoomoo2u) wrote :

Same as above, except i tried installing a kernel.

Claes Wallin (clacke) wrote :

Yep, still getting this tty spam multiple times every time update-grub runs from apt. Not when running update-grub, not when running dpkg-reconfigure linux-image-*, only when running apt install. So probably this should be a bug on apt.

Suppressing it by setting LVM_SUPPRESS_FD_WARNINGS works, of course, but I would be happy if someone could suggest a way for setting it implicitly when running sudo apt upgrade. sudo -i apt upgrade works, but I keep forgetting to do it. :-)

I also get 'File descriptor 50 (/dev/pts/6) leaked on vgs invocation. Parent PID 14069: /usr/sbin/grub-probe
' whenever apt-get updates grub's configuration file... which is several times when you're removing multiple old kernels...

I would've thought this would be fixed by now.

Changed in aptitude:
status: Confirmed → Incomplete
Changed in aptitude:
status: Incomplete → Fix Released
Brian Candler (b-candler) wrote :
Download full text (3.8 KiB)

Just doing an "apt-get dist-upgrade" on a 16.04 VM:

...
Setting up grub-common (2.02~beta2-36ubuntu3.11) ...
Installing new version of config file /etc/grub.d/10_linux ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Setting up grub-pc-bin (2.02~beta2-36ubuntu3.11) ...
Setting up grub2-common (2.02~beta2-36ubuntu3.11) ...
Setting up grub-pc (2.02~beta2-36ubuntu3.11) ...
Installing for i386-pc platform.
File descriptor 3 (pipe:[136263]) leaked on vgs invocation. Parent PID 18940: grub-install
File descriptor 3 (pipe:[136263]) leaked on vgs invocation. Parent PID 18940: grub-install
File descriptor 3 (pipe:[136263]) leaked on vgs invocation. Parent PID 18940: grub-install
Installation finished. No error reported.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-83-generic
Found initrd image: /boot/initrd.img-4.4.0-83-generic
Found linux image: /boot/vmlinuz-4.4.0-21-generic
Found initrd image: /boot/initrd.img-4.4.0-21-generic
done
...
Setting up initramfs-tools-core (0.122ubuntu8.8) ...
Setting up initramfs-tools (0.122ubuntu8.8) ...
update-initramfs: deferring update (trigger activated)
Setting up mdadm (3.3-2ubuntu7.2) ...
update-initramfs: deferring update (trigger activated)
Generating grub configuration file ...
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 19859: grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 19859: grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 19899: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 19899: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 19909: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 19909: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 19919: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 19919: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 19929: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 19929: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 19979: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 19979: /usr/sbin/grub-probe
Found linux image: /boot/vmlinuz-4.4.0-83-generic
Found initrd image: /boot/initrd.img-4.4.0-83-generic
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 20061: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 20061: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 20072: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 20072: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 20082: /usr/sbin/grub-probe
File descriptor 3 (pipe:[140340]) leaked on vgs invocation. Parent PID 20082: /usr/sbin/grub-probe
File descriptor 3 ...

Read more...

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.