Bug 1012075

Summary: diff -Z hangs
Product: [Fedora] Fedora Reporter: Eric Blake <eblake>
Component: diffutilsAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: eblake, lnie, pholica, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: diffutils-3.3-4.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1022417 (view as bug list) Environment:
Last Closed: 2013-10-29 03:34:00 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 Eric Blake 2013-09-25 16:23:30 UTC
Description of problem:
I was trying to compare two files with mixed-mode line endings, and assumed that 'diff -Z' would ignore the trailing carriage returns and thus give me a sane diff.

Version-Release number of selected component (if applicable):
diffutils-3.3-1.fc19.x86_64

How reproducible:
100%

Steps to Reproduce:
1. $ diff -Z <(printf 'a\nb\n') <(printf 'a\nb\n'); echo $?
2. $ timeout 10s diff -Z <(printf 'a\r\nb\n') <(printf 'a\nb\r\n'); echo $?

Actual results:
step 1 completes almost instantly, printing 0.  Step 2 runs 10 seconds, then prints 124 because it timed out.

Expected results:
both steps should complete almost instantly, with status 0.

Additional info:

Comment 1 Eric Blake 2013-09-25 17:22:17 UTC
A self-compiled build from upstream's 3.3 tarball does NOT suffer this problem, so it appears that it may be a bug in a downstream-only patch.  But I didn't investigate further than that.

Comment 2 Pavel Holica 2013-10-22 14:03:22 UTC
I've just hit this too, simpler reproducer is:
diff -Z <(echo "a") <(echo -n "a")

Comment 3 Fedora Update System 2013-10-23 11:26:43 UTC
diffutils-3.3-4.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/diffutils-3.3-4.fc20

Comment 4 Fedora Update System 2013-10-23 11:27:26 UTC
diffutils-3.3-4.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/diffutils-3.3-4.fc19

Comment 5 Fedora Update System 2013-10-24 00:54:51 UTC
Package diffutils-3.3-4.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing diffutils-3.3-4.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-19806/diffutils-3.3-4.fc19
then log in and leave karma (feedback).

Comment 6 lnie 2013-10-24 07:49:17 UTC
fixed with diffutils-3.3-4.f20

Comment 7 Fedora Update System 2013-10-29 03:34:00 UTC
diffutils-3.3-4.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2013-11-10 07:49:26 UTC
diffutils-3.3-4.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.