Bug 869442 - uniq -c crashes while "uniq -c" from GNU Coreutils OK.
uniq -c crashes while "uniq -c" from GNU Coreutils OK.
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
rawhide
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Ondrej Vasik
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-23 18:21 EDT by Shlomi Fish
Modified: 2013-03-12 04:51 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-23 04:08:07 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)
Input Causing uniq -c to crash after compressed with xz. (354.56 KB, application/octet-stream)
2012-10-23 18:21 EDT, Shlomi Fish
no flags Details

  None (edit)
Description Shlomi Fish 2012-10-23 18:21:59 EDT
Created attachment 632427 [details]
Input Causing uniq -c to crash after compressed with xz.

Description of problem:

With the attachment, doing:

unxz < uniq-c.crash.txt.xz | uniq -c

generates an indication of a Segmentation fault on both Mageia 2 x86-64 and
Mageia Cauldron x86-64. This does not happen with unxz < uniq-c.crash.txt.xz |
~/apps/temp-coreutils/bin/uniq -c (where this uniq was installed using
"./configure --prefix="$HOME/apps/temp-coreutils" ; "make" ; "make install"
from the GNU coreutils sources).

The file contains a long line of items separated by CRs, due to a
mis-generation (which was since fixed) but uniq still should not crash.

How reproducible:

Always

Steps to Reproduce:
1. unxz < uniq-c.crash.txt.xz | uniq -c
  
Actual results:

Segfault.

Expected results:

Correct output returned.

Additional info:

See https://bugs.mageia.org/show_bug.cgi?id=7592

After some amount of investigation (thanks to Luigi12_work from IRC for
some insights), we found out that the problem was with
coreutils-8.19-new-i18n.patch patch. If we remove it, do "bm -l -p" and run
"./configure --prefix ; make ; make install", then the unxz < ... |
~/apps/temp-coreutils-rpm/uniq -c works fine. With all patches applied it
segfaults.

This patch is identical to this Fedora patch:

http://pkgs.fedoraproject.org/cgit/coreutils.git/plain/coreutils-i18n.patch
Comment 1 Ondrej Vasik 2012-10-24 03:33:09 EDT
Thanks for report, confirmed. You can just use 'LC_ALL=C uniq -c' to disable the multibyte path for this case.
Comment 2 yu.valery+bugzilla 2013-01-22 09:28:46 EST
It also affects sort and join
http://permalink.gmane.org/gmane.comp.security.oss.general/9215
Comment 3 Ondrej Vasik 2013-01-22 15:20:20 EST
SUSE fix is to use xmalloc and free instead of alloca ... makes sense - https://build.opensuse.org/package/rdiff?linkrev=base&package=coreutils&project=Base%3ASystem&rev=173 is the link to the commit. I'll make an update tomorrow.
Comment 4 Ondrej Vasik 2013-01-23 04:08:07 EST
Fixed in Rawhide - coreutils-8.20-6.fc19 - http://lists.fedoraproject.org/pipermail/scm-commits/2013-January/933514.html . CLOSING RAWHIDE (will prepare updates for lower Fedoras based on #902917)
Comment 5 Fedora Update System 2013-01-30 11:18:45 EST
coreutils-8.15-10.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/coreutils-8.15-10.fc17
Comment 6 Fedora Update System 2013-03-12 04:51:09 EDT
coreutils-8.15-10.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

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