bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #39324] exits without error on OOM


From: Andreas Metzler
Subject: [bug #39324] exits without error on OOM
Date: Sat, 22 Jun 2013 13:55:42 +0000
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:17.0) Gecko/20130515 Firefox/17.0 Iceweasel/17.0.6

URL:
  <http://savannah.gnu.org/bugs/?39324>

                 Summary: exits without error on OOM
                 Project: findutils
            Submitted by: ametzler
            Submitted on: Sa 22 Jun 2013 15:55:41 CEST
                Category: find
                Severity: 3 - Normal
              Item Group: Wrong result
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.2
           Fixed Release: None

    _______________________________________________________

Details:

Hello,

When find encouters a larger directory which causes an out-of-memory-error in
find it exits, without error message and with exitcode 0.

-------------
$ seq -w 0 1914300  | xargs -r touch
$ (ulimit -v 2500 ; exec /usr/bin/find ) ; echo $?
.
0
-------------

This applies to both 4.4.2 and 4.5.11. I have not been able to trigger the
behavior with oldfind.

Original report by Ángel González in <http://bugs.debian.org/712792> is
quoted below.

cu Andreas

Package: findutils
Version: 4.4.2-4

If a folder has enough entries relative to the available memory, find
doesn't return any of them:

cd folder-with-too-many-entries
$ find
.
$ echo $?
0

$ ls -U | wc -l
1914188

$ ls
ls: memory exhausted

$ find --version
find (GNU findutils) 4.4.2
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Built using GNU gnulib version e5573b1bad88bfabcda181b9e0125fb0c52b7d3b
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS()
CBO(level=0)


Other actions are equally oblivious to the contents:
$ find -exec echo '{}' \;
.


Tail of strace find:
...
brk(0x1ad9f000)                         = 0x1ad9f000
getdents(5, /* 846 entries */, 32768)   = 32752
brk(0x1adc0000)                         = 0x1adc0000
brk(0x1ade1000)                         = 0x1ade1000
getdents(5, /* 848 entries */, 32768)   = 32768
brk(0x1ae02000)                         = 0x1ae02000
brk(0x1ae23000)                         = 0x1ae23000
getdents(5, /* 851 entries */, 32768)   = 32760
brk(0x1ae44000)                         = 0x1ae23000
mmap(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = -1 ENOMEM (Cannot allocate memory)
mmap(NULL, 134217728, PROT_NONE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x2b8208005000
munmap(0x2b8208005000, 67088384)        = 0
munmap(0x2b8210000000, 20480)           = 0
mprotect(0x2b820c000000, 135168, PROT_READ|PROT_WRITE) = -1 ENOMEM
(Cannot allocate memory)
munmap(0x2b820c000000, 67108864)        = 0
mmap(NULL, 134217728, PROT_NONE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x2b8208005000
munmap(0x2b8208005000, 67088384)        = 0
munmap(0x2b8210000000, 20480)           = 0
mprotect(0x2b820c000000, 135168, PROT_READ|PROT_WRITE) = -1 ENOMEM
(Cannot allocate memory)
munmap(0x2b820c000000, 67108864)        = 0
brk(0x15285000)                         = 0x15285000
brk(0x1527d000)                         = 0x1527d000
close(5)                                = 0
fchdir(4)                               = 0
close(4)                                = 0
close(1)                                = 0
munmap(0x2b82073d2000, 4096)            = 0
close(2)                                = 0
exit_group(0)                           = ?


Expected:
find should either run completely or fail with an error on stderr and
non-zero exit code.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39324>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]