Bug 1544392

Summary: du crashes on live directory
Product: [Fedora] Fedora Reporter: Miroslav Lichvar <mlichvar>
Component: coreutilsAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: admiller, jamartis, jarodwilson, kdudka, kzak, mlichvar, ooprala, ovasik, p, skisela, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: coreutils-8.27-20.fc27 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1544429 (view as bug list) Environment:
Last Closed: 2018-02-20 17:14:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miroslav Lichvar 2018-02-12 11:11:51 UTC
Description of problem:
I have a directory with about 40000 subdirectories, each containing several small files and symlinks outside that directory. When copying the directory with cp -r and running du on the new directory to see how much data was already copied, du sometimes crashes.

I have seen this with coreutils-8.27-17.fc27.x86_64 and coreutils-8.27-19.fc27.x86_64, but not coreutils-8.29-3.fc28.x86_64.

Backtrace:
#0  0x00007ffff6dc666b in raise () from /lib64/libc.so.6
#1  0x00007ffff6dc8381 in abort () from /lib64/libc.so.6
#2  0x000055555562762b in leave_dir (ent=ent@entry=0x5555558ef5f0, fts=<optimized out>, fts=<optimized out>)
    at ../lib/fts-cycle.c:136
#3  0x0000555555627b71 in fts_build (sp=sp@entry=0x55555589d510, type=type@entry=3) at ../lib/fts.c:1355
#4  0x000055555562899d in fts_read (sp=sp@entry=0x55555589d510) at ../lib/fts.c:931
#5  0x0000555555594017 in du_files (files=0x5555558867d0 <temp_argv>, bit_flags=280) at ../src/du.c:691
#6  single_binary_main_du (argc=<optimized out>, argv=<optimized out>) at ../src/du.c:1123
#7  0x0000555555564752 in launch_program (prog_name=<optimized out>, prog_argc=1, prog_argv=0x7fffffffd688)
    at ../src/coreutils.c:127
#8  0x0000555555564542 in launch_program (prog_argv=<optimized out>, prog_argc=1, prog_name=0x7fffffffda3b "du")
    at ../src/coreutils.c:195
#9  main (argc=<optimized out>, argv=0x7fffffffd678) at ../src/coreutils.c:177

Comment 1 Kamil Dudka 2018-02-12 12:02:44 UTC
There are not many relevant changes in FTS between those releases of coreutils.  Anyway, I have submitted a scratch build of f27 coreutils with f29 version of FTS:

https://koji.fedoraproject.org/koji/taskinfo?taskID=24965509

Could you please give it a try in case it is something easy to test for you?

Comment 2 Miroslav Lichvar 2018-02-12 12:21:12 UTC
It doesn't seem to crash with du from the scratch build.

Comment 3 Kamil Dudka 2018-02-12 12:37:46 UTC
Not that I understand why, but I will submit it as an update anyway.  Hopefully it will not come back again.  Thank you for testing the scratch build!

Comment 4 Kamil Dudka 2018-02-12 12:47:17 UTC
Note that findutils shares the code in question with coreutils.  If you were by any chance able to reproduce the crash in your environment with find(1), please create a separate bug for it and I will update the FTS code in findutils, too.

Comment 5 Miroslav Lichvar 2018-02-12 12:57:04 UTC
Thanks!

It is crashing with find too. I'll clone the bug.

Comment 6 Fedora Update System 2018-02-12 18:34:15 UTC
findutils-4.6.0-16.fc27 coreutils-8.27-20.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-89733ea3d9

Comment 7 Fedora Update System 2018-02-13 16:40:59 UTC
coreutils-8.27-20.fc27, findutils-4.6.0-16.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-89733ea3d9

Comment 8 Fedora Update System 2018-02-20 17:14:50 UTC
coreutils-8.27-20.fc27, findutils-4.6.0-16.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.