Bug 96997

Summary: "sort -M" segfaults or asserts always
Product: [Retired] Red Hat Linux Reporter: Markku Kolkka <markku.kolkka>
Component: coreutilsAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 5.0-5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-06-09 13:36:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
test case that causes sort -M to fail none

Description Markku Kolkka 2003-06-08 11:09:17 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Description of problem:
Using the -M or --month-sort options to /bin/sort causes it to crash with failed
assertion (if run as regular user) or segfault (when run as root).

Version-Release number of selected component (if applicable):
coreutils-4.5.3-19

How reproducible:
Always

Steps to Reproduce:
1.cat foo.txt | sort -M
2.
3.
    

Actual Results:  sort: sort.c:1770: getmonth_mb: Assert-makro "mblength != (-1)
&& *wpp == ((void *)0)" ei pid� paikkaansa.
Keskeytetty


Expected Results:  data sorted by month code

Additional info:

Comment 1 Tim Waugh 2003-06-09 12:41:32 UTC
Seems to work fine in coreutils-5.0-5.  Please supply a small test case that
causes problems for you, so that I can verify the problem is really fixed.

Comment 2 Markku Kolkka 2003-06-09 13:20:27 UTC
Created attachment 92274 [details]
test case that causes sort -M to fail

The bug is related to line length and locale, if the lines to be sorted are
under 49 charecters or a non-UTF-8 locale is used there is no error.

Comment 3 Tim Waugh 2003-06-09 13:36:42 UTC
Thanks.

$ cat test.txt | sort -M
Feb 5 bbbb qqqqq zzzz aaaaa pppppp ggggg dddddddd
Jan 1 aaaa ccccc gggg xxxxx yyyyyy zzzzz ffffffff
$ rpm -q coreutils
coreutils-5.0-5
$ echo $LANG
en_GB.UTF-8

So it looks like this really is fixed.

Comment 4 Bryce 2004-02-24 18:40:24 UTC
Tim, where can we find coreutils-5.0-5?

Cheers

Phil
=--=

Comment 5 Bryce 2004-02-24 20:26:04 UTC
Never mind, I was only asking to see if I could get away without
having to tinker unhooking the selinux bit.

Rebuilt 5.2.0-4 for AS3 - the selinux bit

Phil
=--=

Comment 6 Tim Waugh 2004-02-24 22:36:04 UTC
Note that 5.2.0-4 has bugs, since 5.2.0 isn't very old.  In
particular, sort -M doesn't work. :-)

Grab 5.2.0-7, which should appear tomorrow -- that has fewer bugs than
5.2.0-4, but (I'm sure) more than 5.2.0-8 will have when it exists..