Autofs leak file descriptors when reloaded (-HUP) and daemon may stop working on high # of shares/reloads

Bug #1316125 reported by Rafael David Tinoco on 2014-05-05
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
autofs (Ubuntu)
Undecided
Rafael David Tinoco
Saucy
Undecided
Rafael David Tinoco
Trusty
Undecided
Rafael David Tinoco
autofs5 (Ubuntu)
Undecided
Unassigned
Precise
Undecided
Rafael David Tinoco

Bug Description

[Impact]

 * Autofs leak file descriptors when reloaded (-HUP) and daemon may stop working on high # of shares/reloads.

[Test Case]

1. Configure a simple direct mount:

# cat /etc/auto.master
/- /etc/auto.direct

# cat /etc/auto.direct
/nfs server:/nfs

2. Start the automounter and do NOT trigger the mount

3. Replace /etc/auto.direct with:

# cat /etc/auto.direct
/nfs/1 server:/nfs
/nfs/2 server:/nfs

4. Reload:

# kill -HUP $(pidof automount)

>From now on, every reload will leak a file descriptor:

# ls -la /proc/$(pidof automount)/fd | grep /nfs

lr-x------ 1 root root 64 Aug 14 22:08 11 -> /nfs
lr-x------ 1 root root 64 Aug 14 22:08 12 -> /nfs
lr-x------ 1 root root 64 Aug 14 22:08 13 -> /nfs
lr-x------ 1 root root 64 Aug 14 22:08 14 -> /nfs
lr-x------ 1 root root 64 Aug 14 22:08 5 -> /nfs

[Regression Potential]

 * based on upstream commit: autofs - version 5.0.7 - dd66c61a - file descriptor leak when reloading automount daemon. Tested with the same test case fix the error and not changing any other behavior.

[Other Info ]

-

Changed in autofs5 (Ubuntu):
status: New → In Progress
assignee: nobody → Rafael David Tinoco (inaddy)
Rafael David Tinoco (inaddy) wrote :

Attaching patch for affected versions.
This one if for Precise.

Rafael David Tinoco (inaddy) wrote :

Attaching patch for affected versions.
This one is for Saucy.

Chris J Arges (arges) on 2014-05-12
Changed in autofs5 (Ubuntu Precise):
assignee: nobody → Rafael David Tinoco (inaddy)
Changed in autofs5 (Ubuntu Saucy):
assignee: nobody → Rafael David Tinoco (inaddy)
Changed in autofs5 (Ubuntu):
assignee: Rafael David Tinoco (inaddy) → nobody
status: In Progress → Fix Released
Changed in autofs5 (Ubuntu Precise):
status: New → In Progress
Changed in autofs5 (Ubuntu Saucy):
status: New → In Progress
Chris J Arges (arges) wrote :

Sponsored for P/S

Chris J Arges (arges) on 2014-05-15
Changed in autofs5 (Ubuntu):
status: Fix Released → In Progress
Rafael David Tinoco (inaddy) wrote :

It was brought to my attention this fix also applies to trusty and utopic.
I'm attaching the bug fixes for these two versions as well.

Changed in autofs5 (Ubuntu Trusty):
assignee: nobody → Rafael David Tinoco (inaddy)
Changed in autofs (Ubuntu):
assignee: nobody → Rafael David Tinoco (inaddy)
Changed in autofs (Ubuntu Saucy):
assignee: nobody → Rafael David Tinoco (inaddy)
Changed in autofs (Ubuntu Precise):
assignee: nobody → Rafael David Tinoco (inaddy)
Changed in autofs (Ubuntu Trusty):
status: New → In Progress
Rafael David Tinoco (inaddy) wrote :

Utopic fix has no difference from trusty but changelog and dates. Attaching diff.

Changed in autofs (Ubuntu Trusty):
assignee: nobody → Rafael David Tinoco (inaddy)
Changed in autofs5 (Ubuntu Trusty):
status: New → In Progress
Changed in autofs (Ubuntu):
status: New → In Progress
Changed in autofs (Ubuntu Precise):
status: New → In Progress
Changed in autofs (Ubuntu Saucy):
status: New → In Progress

Hello Rafael, or anyone else affected,

Accepted autofs5 into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/autofs5/5.0.6-0ubuntu5.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in autofs5 (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in autofs (Ubuntu Saucy):
status: In Progress → Fix Committed
Stéphane Graber (stgraber) wrote :

Hello Rafael, or anyone else affected,

Accepted autofs into saucy-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/autofs/5.0.7-3ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Martin Pitt (pitti) wrote :

Utopic fix uploaded with adding missing bug ref in changelog. Thanks!

no longer affects: autofs5 (Ubuntu Saucy)
no longer affects: autofs5 (Ubuntu Trusty)
no longer affects: autofs (Ubuntu Precise)
Changed in autofs (Ubuntu):
status: In Progress → Fix Committed
Changed in autofs5 (Ubuntu):
status: In Progress → Invalid
Martin Pitt (pitti) wrote :

Trusty fix uploaded with adding missing bug ref in changelog. Thanks!

Unsubscribing sponsors, everything has been uploaded. ubuntu-sru team will take it from here, or subscribe ubuntu-sponsors again if there's updated things to upload.

Stéphane Graber (stgraber) wrote :

Hello Rafael, or anyone else affected,

Accepted autofs into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/autofs/5.0.7-3ubuntu3.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in autofs (Ubuntu Trusty):
status: In Progress → Fix Committed
Leonardo Borda (lborda) wrote :

Thanks guys!!!

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package autofs - 5.0.7-3ubuntu5

---------------
autofs (5.0.7-3ubuntu5) utopic; urgency=medium

  * Fix file descriptor leak when reloading daemon. (LP: #1316125)
 -- Rafael David Tinoco <email address hidden> Thu, 15 May 2014 18:05:40 -0300

Changed in autofs (Ubuntu):
status: Fix Committed → Fix Released

The fix for this bug has been awaiting testing feedback in the -proposed repository for trusty for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Rafael David Tinoco (inaddy) wrote :

I confirm this fixes the issue for me.

tags: added: verification-done
removed: verification-needed
tags: removed: removal-candidate
tags: added: verification-done-precise verification-needed
removed: verification-done
Rafael David Tinoco (inaddy) wrote :

# verification-trusty

<email address hidden>:~$ cat /etc/auto.master
/- /etc/auto.direct

<email address hidden>:~$ cat /etc/auto.direct
# cat /etc/auto.direct
# /nfs.client localhost:/nfs.server
/nfs.client/dir01 localhost:/nfs.server
/nfs.client/dir02 localhost:/nfs.server

# after changing auto.direct
<email address hidden>:~$ sudo kill -HUP $(pidof automount)

<email address hidden>:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:23 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:23 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:23 9 -> /nfs.client/dir01
<email address hidden>:~$ sudo kill -HUP $(pidof automount)
<email address hidden>:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:23 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:23 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:23 9 -> /nfs.client/dir01
<email address hidden>:~$ sudo kill -HUP $(pidof automount)
<email address hidden>:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:23 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:23 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:23 9 -> /nfs.client/dir01
<email address hidden>:~$ sudo kill -HUP $(pidof automount)
<email address hidden>:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:23 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:23 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:23 9 -> /nfs.client/dir01

# verification-done-trusty

Rafael David Tinoco (inaddy) wrote :

# verification-precise

<email address hidden>:~$ sudo mkdir /nfs.server
<email address hidden>:~$ sudo mkdir /nfs.client

<email address hidden>:~$ sudo vi /etc/exports
<email address hidden>:~$ sudo service nfs-kernel-server restart

<email address hidden>:~$ sudo vi /etc/auto.master
<email address hidden>:~$ sudo vi /etc/auto.direct

<email address hidden>:~$ sudo service autofs restart
autofs stop/waiting
autofs start/running, process 2234

<email address hidden>:~$ cat /etc/auto.direct
/nfs.client localhost:/nfs.server
#/nfs.client/dir01 localhost:/nfs.server
#/nfs.client/dir02 localhost:/nfs.server

<email address hidden>:~$ sudo mkdir /nfs.server/dir01
<email address hidden>:~$ sudo mkdir /nfs.server/dir02

<email address hidden>:~$ ls /nfs.client/
dir01 dir02
<email address hidden>:~$ sudo vi /etc/auto.direct

# change auto.direct

<email address hidden>:~$ sudo kill -HUP $(pidof automount)
<email address hidden>:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:29 4 -> /nfs.client
<email address hidden>:~$ sudo vi /etc/auto.direct
<email address hidden>:~$ ls /nfs.client/dir01
dir01 dir02
<email address hidden>:~$ ls /nfs.client/dir02
dir01 dir02
<email address hidden>:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:29 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:29 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:29 9 -> /nfs.client/dir01

# final test

<email address hidden>:~$ sudo kill -HUP $(pidof automount)
<email address hidden>:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:29 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:29 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:29 9 -> /nfs.client/dir01
<email address hidden>:~$ sudo kill -HUP $(pidof automount)
<email address hidden>:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:29 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:29 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:29 9 -> /nfs.client/dir01

# verification-done-precise

Rafael David Tinoco (inaddy) wrote :

# verification-saucy

<email address hidden>:~$ sudo mkdir /nfs.server/
mkdir: cannot create directory ‘/nfs.server/’: File exists
<email address hidden>:~$ sudo mkdir /nfs.client
<email address hidden>:~$ sudo vi /etc/exports
<email address hidden>:~$ sudo vi /etc/exports
<email address hidden>:~$ sudo service nfs-kernel-server restart
 * Stopping NFS kernel daemon [ OK ]
 * Unexporting directories for NFS kernel daemon... [ OK ]
 * Exporting directories for NFS kernel daemon... [ OK ]
 * Starting NFS kernel daemon [ OK ]
<email address hidden>:~$ sudo vi /etc/auto.master
<email address hidden>:~$ cat /etc/auto.master
/- /etc/auto.direct
<email address hidden>:~$ sudo vi /etc/auto.direct
<email address hidden>:~$ cat /etc/auto.direct
# cat /etc/auto.direct
/nfs.client localhost:/nfs.server
#/nfs.client/dir01 localhost:/nfs.server
#/nfs.client/dir02 localhost:/nfs.server
<email address hidden>:~$ sudo service autofs restart
autofs stop/waiting
autofs start/running, process 2351
<email address hidden>:~$ mkdir /nfs.server/dir01
mkdir: cannot create directory ‘/nfs.server/dir01’: Permission denied
<email address hidden>:~$ sudo mkdir /nfs.server/dir01
<email address hidden>:~$ sudo mkdir /nfs.server/dir02
<email address hidden>:~$ ls /nfs.client/
dir01 dir02
<email address hidden>:~$ sudo vi /etc/auto.direct
<email address hidden>:~$ cat /etc/auto.direct
# cat /etc/auto.direct
#/nfs.client localhost:/nfs.server
/nfs.client/dir01 localhost:/nfs.server
/nfs.client/dir02 localhost:/nfs.server
<email address hidden>:~$ ls /nfs.client/dir01/
<email address hidden>:~$ ls /nfs.client/dir02
<email address hidden>:~$ ls /nfs.client/
dir01 dir02
<email address hidden>:~$ sudo kill -HUP $(pidof automount)
<email address hidden>:~$ ls /nfs.client/
dir01 dir02
<email address hidden>:~$ ls /nfs.client/dir01
dir01 dir02
<email address hidden>:~$ ls /nfs.client/dir02
dir01 dir02
<email address hidden>:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:36 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:36 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:36 9 -> /nfs.client/dir01
<email address hidden>:~$ sudo kill -HUP $(pidof automount)
<email address hidden>:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:36 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:36 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:36 9 -> /nfs.client/dir01
<email address hidden>:~$ sudo kill -HUP $(pidof automount)
<email address hidden>:~$ sudo ls -la /proc/$(pidof automount)/fd | grep /nfs
lr-x------ 1 root root 64 Sep 29 15:36 10 -> /nfs.client/dir02
lr-x------ 1 root root 64 Sep 29 15:36 4 -> /nfs.client
lr-x------ 1 root root 64 Sep 29 15:36 9 -> /nfs.client/dir01

# verification-done-saucy

tags: added: verification-done verification-done-saucy verification-done-trusty
removed: precise verification-needed
tags: added: precise
removed: verification-done verification-done-saucy
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package autofs5 - 5.0.6-0ubuntu5.2

---------------
autofs5 (5.0.6-0ubuntu5.2) precise; urgency=low

  * Fix file descriptor leak when reloading daemon. (LP: #1316125)
 -- Rafael David Tinoco <email address hidden> Mon, 12 May 2014 10:46:04 -0500

Changed in autofs5 (Ubuntu Precise):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for autofs5 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package autofs - 5.0.7-3ubuntu3.1

---------------
autofs (5.0.7-3ubuntu3.1) trusty-proposed; urgency=low

  * Fix file descriptor leak when reloading daemon. (LP: #1316125)
 -- Rafael David Tinoco <email address hidden> Thu, 15 May 2014 17:47:51 -0300

Changed in autofs (Ubuntu Trusty):
status: Fix Committed → Fix Released
Changed in autofs (Ubuntu Saucy):
status: Fix Committed → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers