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

Bug #591823 reported by Daniel Richard G.
234
This bug affects 48 people
Affects Status Importance Assigned to Milestone
aptitude
Fix Released
Unknown
lvm2
Fix Released
Unknown
lvm2 (Ubuntu)
Opinion
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)

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Daniel Richard G. (skunk) wrote :

Should this be considered a bug in dpkg, then?

Revision history for this message
Peshko R. (peshko-us) wrote :

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

Revision history for this message
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

Revision history for this message
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.

Revision history for this message
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

Revision history for this message
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]%

Revision history for this message
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/*

Revision history for this message
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
Revision history for this message
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.

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

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

Changed in lvm2 (Ubuntu):
status: New → Confirmed
Revision history for this message
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
Revision history for this message
Martin Eisenhardt (martin-eisenhardt) wrote :

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

Problem occured while removing the -12 kernel.

Revision history for this message
Rebecca Menessec (aloishammer-deactivatedaccount) wrote :

Still not fixed in 12.04 or 12.10.

Revision history for this message
nils (internationils) wrote :

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

Changed in aptitude:
status: New → Confirmed
Revision history for this message
DjznBR (djzn-br) wrote :

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

Revision history for this message
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 :)

Revision history for this message
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
Revision history for this message
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?

Revision history for this message
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.

Revision history for this message
Aaahh Ahh (woohoomoo2u) wrote :

Same as above, except i tried installing a kernel.

Revision history for this message
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. :-)

Revision history for this message
Hitechcomputergeek (hitechcomputergeek) wrote :

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
Revision history for this message
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...

Revision history for this message
Mikko Rantalainen (mira) wrote :

I got this same warning:

$ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
  linux-headers-5.4.0-66-lowlatency linux-headers-5.4.0-73-lowlatency linux-hwe-5.4-headers-5.4.0-66
  linux-hwe-5.4-headers-5.4.0-73 linux-image-5.4.0-66-lowlatency linux-image-5.4.0-73-lowlatency
  linux-modules-5.4.0-66-lowlatency linux-modules-5.4.0-73-lowlatency
0 to upgrade, 0 to newly install, 8 to remove and 0 not to upgrade.
After this operation, 714 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 492639 files and directories currently installed.)
Removing linux-headers-5.4.0-66-lowlatency (5.4.0-66.74~18.04.2) ...
Removing linux-headers-5.4.0-73-lowlatency (5.4.0-73.82~18.04.1) ...
Removing linux-hwe-5.4-headers-5.4.0-66 (5.4.0-66.74~18.04.2) ...
Removing linux-hwe-5.4-headers-5.4.0-73 (5.4.0-73.82~18.04.1) ...
Removing linux-image-5.4.0-66-lowlatency (5.4.0-66.74~18.04.2) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.4.0-66-lowlatency
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-77-lowlatency
Found initrd image: /boot/initrd.img-5.4.0-77-lowlatency
Found linux image: /boot/vmlinuz-5.4.0-74-lowlatency
Found initrd image: /boot/initrd.img-5.4.0-74-lowlatency
Found linux image: /boot/vmlinuz-5.4.0-73-lowlatency
Found initrd image: /boot/initrd.img-5.4.0-73-lowlatency
done
Removing linux-image-5.4.0-73-lowlatency (5.4.0-73.82~18.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.4.0-73-lowlatency
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-77-lowlatency
Found initrd image: /boot/initrd.img-5.4.0-77-lowlatency
Found linux image: /boot/vmlinuz-5.4.0-74-lowlatency
Found initrd image: /boot/initrd.img-5.4.0-74-lowlatency
File descriptor 10 (/var/lib/dpkg/triggers/linux-update-5.4.0-66-lowlatency (deleted)) leaked on lvs invocation. Parent PID 12476: /bin/sh
done
Removing linux-modules-5.4.0-66-lowlatency (5.4.0-66.74~18.04.2) ...
Removing linux-modules-5.4.0-73-lowlatency (5.4.0-73.82~18.04.1) ...

$ lsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

I would guess this is actually a bug in grub-probe.

Revision history for this message
Mikko Rantalainen (mira) wrote :

I would guess some files are left open when grub_util_pull_lvm_by_command() calls grub_util_exec_pipe() in grub2/grub-core/osdep/unix/getroot.c

Revision history for this message
Bartłomiej Żogała (nusch) wrote :

Shouldn't the bug be assigned to grub(/usr/sbin/grub-probe) instead of lvm2 as the comment here explains ? https://unix.stackexchange.com/questions/433313/strange-problem-lvs-invocation-with-grub-on-debian-stretch#comment1232731_433407

The fact that lvm did extra work towards security and detected something shouldn't mean that we should now blame them and supress the warning instead fixing real issue

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

Other bug subscribers

Related questions

Remote bug watches

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