findutils uses nearly 100% CPU and memory resources

Bug #1364492 reported by Filippos Kolyvas on 2014-09-02
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
findutils (Ubuntu)
Undecided
Unassigned

Bug Description

findutils is using a find command, probably to auto-update indexing database.
While this is normal behaviour, i found out that shortly after the indexing update started, findutils is using 100% of CPU resources (Haswell Pentium G3258), all of my system's memory (8GB RAM) and some of the swap, rendering the system completely unusable.

Issueing the command 'ps ax | grep find' results in:
29729 ? SN 0:00 /bin/sh /usr/bin/updatedb.findutils
29737 ? SN 0:00 /bin/sh /usr/bin/updatedb.findutils
29758 ? SN 0:00 su nobody -s /bin/sh -c /usr/bin/find / -ignore_readdir_race \( -fstype NFS -o -fstype nfs -o -fstype nfs4 -o -fstype afs -o -fstype binfmt_misc -o -fstype proc -o -fstype smbfs -o -fstype autofs -o -fstype iso9660 -o -fstype ncpfs -o -fstype coda -o -fstype devpts -o -fstype ftpfs -o -fstype devfs -o -fstype mfs -o -fstype shfs -o -fstype sysfs -o -fstype cifs -o -fstype lustre_lite -o -fstype tmpfs -o -fstype usbfs -o -fstype udf -o -fstype ocfs2 -o -type d -regex '\(^/tmp$\)\|\(^/usr/tmp$\)\|\(^/var/tmp$\)\|\(^/afs$\)\|\(^/amd$\)\|\(^/alex$\)\|\(^/var/spool$\)\|\(^/sfs$\)\|\(^/media$\)\|\(^/var/lib/schroot/mount$\)' \) -prune -o -print0
29767 ? SNs 0:00 sh -c /usr/bin/find / -ignore_readdir_race \( -fstype NFS -o -fstype nfs -o -fstype nfs4 -o -fstype afs -o -fstype binfmt_misc -o -fstype proc -o -fstype smbfs -o -fstype autofs -o -fstype iso9660 -o -fstype ncpfs -o -fstype coda -o -fstype devpts -o -fstype ftpfs -o -fstype devfs -o -fstype mfs -o -fstype shfs -o -fstype sysfs -o -fstype cifs -o -fstype lustre_lite -o -fstype tmpfs -o -fstype usbfs -o -fstype udf -o -fstype ocfs2 -o -type d -regex '\(^/tmp$\)\|\(^/usr/tmp$\)\|\(^/var/tmp$\)\|\(^/afs$\)\|\(^/amd$\)\|\(^/alex$\)\|\(^/var/spool$\)\|\(^/sfs$\)\|\(^/media$\)\|\(^/var/lib/schroot/mount$\)' \) -prune -o -print0
29768 ? RN 57:29 /usr/bin/find / -ignore_readdir_race ( -fstype NFS -o -fstype nfs -o -fstype nfs4 -o -fstype afs -o -fstype binfmt_misc -o -fstype proc -o -fstype smbfs -o -fstype autofs -o -fstype iso9660 -o -fstype ncpfs -o -fstype coda -o -fstype devpts -o -fstype ftpfs -o -fstype devfs -o -fstype mfs -o -fstype shfs -o -fstype sysfs -o -fstype cifs -o -fstype lustre_lite -o -fstype tmpfs -o -fstype usbfs -o -fstype udf -o -fstype ocfs2 -o -type d -regex \(^/tmp$\)\|\(^/usr/tmp$\)\|\(^/var/tmp$\)\|\(^/afs$\)\|\(^/amd$\)\|\(^/alex$\)\|\(^/var/spool$\)\|\(^/sfs$\)\|\(^/media$\)\|\(^/var/lib/schroot/mount$\) ) -prune -o -print0

Results from 'top':
top - 19:16:00 up 1:40, 3 users, load average: 1,14, 1,20, 1,53
Tasks: 274 total, 2 running, 272 sleeping, 0 stopped, 0 zombie
%Cpu(s): 2,9 us, 22,9 sy, 24,4 ni, 42,4 id, 7,6 wa, 0,0 hi, 0,0 si, 0,0 st
KiB Mem: 8086304 total, 7876904 used, 209400 free, 60 buffers
KiB Swap: 20971516 total, 373796 used, 20597720 free. 4627412 cached Mem

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
29768 nobody 30 10 14968 1556 1116 R 92,2 0,0 70:16.74 find

System installation is Ubuntu Utopic on Unity 7 desktop, using nouveau nvidia drivers.
findutils version is 4.4.2-9

Sorry for posting the commands output in here, if there is another guideline for this i'll be happy to edit that.

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: findutils 4.4.2-9
ProcVersionSignature: Ubuntu 3.16.0-11.16-generic 3.16.1
Uname: Linux 3.16.0-11-generic x86_64
ApportVersion: 2.14.7-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Sep 2 19:03:25 2014
Dependencies:
 gcc-4.9-base 4.9.1-10ubuntu2
 libc6 2.19-10ubuntu1
 libgcc1 1:4.9.1-10ubuntu2
 multiarch-support 2.19-10ubuntu1
InstallationDate: Installed on 2014-08-19 (14 days ago)
InstallationMedia: Ubuntu 14.10 "Utopic Unicorn" - Alpha amd64 (20140815)
SourcePackage: findutils
UpgradeStatus: No upgrade log present (probably fresh install)

Filippos Kolyvas (fkol-k4) wrote :
summary: - findutils uses nearly 100% CPU and memory reources
+ findutils uses nearly 100% CPU and memory resources

I found a similar issue in Ubuntu 16.04.1 LTS.
The included "findutils" package is 4.6.0+git+20160126-2.

I recently developed a fix:
The problem was a memory leak in the "find" program source code. If you apply the attached patch and the solution works for you, please, let me know about it.

The attachment "me_mntroot is not properly deallocated" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Launchpad Janitor (janitor) wrote :

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

Changed in findutils (Ubuntu):
status: New → Confirmed
Diego (diegolago) wrote :

I found the same error in Ubuntu 16.04 (findutils 4.6.0+git+20160126-2).

I've applied the patch sent by Juan Carlos Cordero and it works fine.

This bug was reported to the findutils tracker: https://savannah.gnu.org/bugs/index.php?50326

Fixed in Debian.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package findutils - 4.6.0+git+20161106-2

---------------
findutils (4.6.0+git+20161106-2) unstable; urgency=medium

  * 20_find-fix-memory-leak-in-mount-list-handling.patch from upstream GIT
    master: Fix memory leak in mount list handling. LP: #1364492
    https://savannah.gnu.org/bugs/?50326

 -- Andreas Metzler <email address hidden> Sat, 18 Feb 2017 16:37:32 +0100

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

Other bug subscribers

Bug attachments

Remote bug watches

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