fuser forks and never reaps its children

Bug #877894 reported by Volodymyr Kolesnykov
230
This bug affects 47 people
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Confirmed
High
Unassigned
psmisc (Ubuntu)
Confirmed
High
Unassigned

Bug Description

$ lsb_release -rd
Description: Ubuntu 11.10
Release: 11.10

# cat /etc/cron.d/php5
# /etc/cron.d/php5: crontab fragment for php5
# This purges session files older than X, where X is defined in seconds
# as the largest value of session.gc_maxlifetime from all your php.ini
# files, or 24 minutes if not defined. See /usr/lib/php5/maxlifetime

# Look for and purge old sessions every 30 minutes
09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete

When

find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete

is run either from cron or manually, fuser forks itself until the system is unable to fork any new processes (which affects the whole system).

# ps -C fuser | wc -l
22634

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: psmisc 22.14-1
ProcVersionSignature: Ubuntu 3.0.0-12.20-server 3.0.4
Uname: Linux 3.0.0-12-server x86_64
ApportVersion: 1.23-0ubuntu3
Architecture: amd64
Date: Wed Oct 19 04:36:08 2011
ExecutablePath: /bin/fuser
InstallationMedia: Ubuntu-Server 10.04.2 LTS "Lucid Lynx" - Release amd64 (20110211.1)
ProcEnviron:
 SHELL=/bin/bash
 LANG=en_US.UTF-8
SourcePackage: psmisc
UpgradeStatus: Upgraded to oneiric on 2011-10-19 (0 days ago)

Revision history for this message
Volodymyr Kolesnykov (sjinks) wrote :
Revision history for this message
Volodymyr Kolesnykov (sjinks) wrote :

Output of ps -faux when the problem occurs

Revision history for this message
Volodymyr Kolesnykov (sjinks) wrote :

ls -la /var/lib/php5

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

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

Changed in psmisc (Ubuntu):
status: New → Confirmed
Revision history for this message
Graham Poulter (grahampo) wrote :

We also found this problem: the PHP cron launches one fuser for each PHP session file, and the process is never reaped (remains in <defunct> state)

Workaround for PHP is to remove the fuser check, which was only added 11.10 anyway.

This is the 11.10 cron job:

09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete

And this is the 11.04 cron job:

09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete

Dave Walker (davewalker)
Changed in php5 (Ubuntu):
importance: Undecided → High
Changed in psmisc (Ubuntu):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in php5 (Ubuntu):
status: New → Confirmed
Revision history for this message
klemens_u (klemens) wrote :

I've got the same problem. Reverted to the Ubuntu 10.04 setting as suggested above.

Revision history for this message
Simon Hirscher (codethief) wrote :

I can confirm the bug on Ubuntu 11.10 with php5-fpm.
Found this Debian bug via Google: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=633100 . Maybe it provides anybody with more information on how to hunt this bug down.

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

Other bug subscribers

Remote bug watches

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