Bug 1305063 - find command crashes on assertion failure after stat() failure
find command crashes on assertion failure after stat() failure
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: findutils (Show other bugs)
6.8
x86_64 Unspecified
high Severity high
: rc
: ---
Assigned To: Kamil Dudka
Branislav Náter
: Patch, Regression
: 1306313 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-05 08:54 EST by Jaroslav Kortus
Modified: 2016-08-11 03:49 EDT (History)
8 users (show)

See Also:
Fixed In Version: findutils-4.4.2-9.el6
Doc Type: Bug Fix
Doc Text:
Cause: A backported upstream patch optimizing directory tree traversal did not properly handle failure of stat() calls. Consequence: If a stat() call failed, the find utility terminated abnormally due to assertion failure. Fix: An upstream patch has been applied on findutils source code to print a non-fatal error message in that case and continue the traversal. Result: find no longer terminates abnormally if stat() fails.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-02-25 12:49:55 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
abrt report (1.48 MB, application/x-gzip)
2016-02-05 08:54 EST, Jaroslav Kortus
no flags Details

  None (edit)
Description Jaroslav Kortus 2016-02-05 08:54:11 EST
Description of problem:
Abrt caught find util crashing

Version-Release number of selected component (if applicable):
findutils-4.4.2-8.el6.x86_64

How reproducible:
unknown

Steps to Reproduce:
1. unknown, got caught as part of our test suite, repeating the command does not fail
2.
3.

Actual results:
abrt caught find crashing

Expected results:
no crashing

Additional info:
abrt report attached
Comment 1 Jaroslav Kortus 2016-02-05 08:54 EST
Created attachment 1121387 [details]
abrt report
Comment 3 Kamil Dudka 2016-02-05 10:41:31 EST
Where is "our" test suite?  How can one run it?
Comment 4 Jaroslav Kortus 2016-02-05 12:24:15 EST
that is cluster test suite (so completely unrelated to find testing as such). find was just one of the commands we routinely use to locate our bits.

To run it you must have working cluster environment. I can provide you with one if you find it a necessity to reproduce.
Comment 5 Kamil Dudka 2016-02-08 07:58:30 EST
(gdb) bt full
#0  0x00007fd98e26a5e5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
        resultvar = 0
        pid = <value optimized out>
        selftid = <value optimized out>
#1  0x00007fd98e26bdc5 in abort () at abort.c:92
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x429330 <__dso_handle+616>, sa_sigaction = 0x429330 <__dso_handle+616>}, sa_mask = {__val = {
              140572370728028, 140720995885280, 25477408, 140720995885520, 140572369740246, 206158430232, 140720995885536, 140720995885312, 
              140572369646344, 206158430256, 140720995885568, 25483488, 327680, 0, 8295767386174337312, 140720995888238}}, sa_flags = -1908875956, 
          sa_restorer = 0x4290d0 <__dso_handle+8>}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00007fd98e26370e in __assert_fail_base (fmt=<value optimized out>, assertion=0x429330 "ent->fts_info == 11 || state.type != 0", 
    file=0x4290d0 "ftsfind.c", line=<value optimized out>, function=<value optimized out>) at assert.c:96
        str = 0x184d8e0 ""
        total = 4096
#3  0x00007fd98e2637d0 in __assert_fail (assertion=0x429330 "ent->fts_info == 11 || state.type != 0", file=0x4290d0 "ftsfind.c", line=447, 
    function=0x429420 "consider_visiting") at assert.c:105
No locals.
#4  0x0000000000403751 in consider_visiting (arg=<value optimized out>) at ftsfind.c:447
        statbuf = {st_dev = 3, st_ino = 43818, st_nlink = 8, st_mode = 16749, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 0, 
          st_blksize = 1024, st_blocks = 0, st_atim = {tv_sec = 1454679024, tv_nsec = 716004049}, st_mtim = {tv_sec = 1454679024, tv_nsec = 716004049}, 
          st_ctim = {tv_sec = 1454679024, tv_nsec = 716004049}, __unused = {0, 0, 0}}
        ignore = <value optimized out>
        isdir = <value optimized out>
        mode = <value optimized out>
#5  find (arg=<value optimized out>) at ftsfind.c:603
        level = 2
        arglist = {0x7ffc28f8ec73 "/", 0x0}
        p = 0x184c120
        ent = 0x1892310
#6  0x0000000000403cae in process_all_startpoints (argc=<value optimized out>, argv=<value optimized out>) at ftsfind.c:620
        i = <value optimized out>
#7  main (argc=<value optimized out>, argv=<value optimized out>) at ftsfind.c:701
        end_of_leading_options = 1
        eval_tree = 0x184aa40
Comment 6 Kamil Dudka 2016-02-08 08:56:41 EST
Local reproducer (needs to be run as a non-root user):

$ mkdir dir
$ ln -s /root/xxx dir
$ find -L dir
dir
find: ftsfind.c:447: consider_visiting: Assertion `ent->fts_info == 11 || state.type != 0' failed.
Aborted (core dumped)

Downgrading to findutils-4.4.2-6.el6 seems to fix the bug.
Comment 8 Kamil Dudka 2016-02-08 09:14:12 EST
The following upstream commit fixes the bug:

http://git.savannah.gnu.org/cgit/findutils.git/commit/?id=20171feb
Comment 16 Kamil Dudka 2016-02-11 15:35:31 EST
*** Bug 1306313 has been marked as a duplicate of this bug. ***
Comment 19 errata-xmlrpc 2016-02-25 12:49:55 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0298.html

Note You need to log in before you can comment on or make changes to this bug.