Bug 36539
Summary: | sort goes into infinite loop with LC_ALL unset | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Greg Bailey <gbailey> | ||||
Component: | glibc | Assignee: | Bernhard Rosenkraenzer <bero> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | David Lawrence <dkl> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | high | ||||||
Version: | 7.1 | CC: | fweimer | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i386 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2001-04-30 17:10:20 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
Greg Bailey
2001-04-18 19:18:21 UTC
Created attachment 15664 [details]
Test input file for sort failure
problem is still in textutils-2.0.13-1 Seems to be a problem with the strcoll() function. Consider the following program: #include <stdio.h> #include <string.h> #include <locale.h> int main( int argc, char *argv[] ) { char *t1 = "0-0-0-0-0-0-0-0-0-0.COM"; char *t2 = "00000-00000.COM"; setlocale( LC_ALL, "" ); printf( "strcoll( \"%s\", \"%s\" ) = %d\n", t1, t2, strcoll( t1, t2 ) ); printf( "strcoll( \"%s\", \"%s\" ) = %d\n", t2, t1, strcoll( t2, t1 ) ); } Yields the output: strcoll( "0-0-0-0-0-0-0-0-0-0.COM", "00000-00000.COM" ) = 1 strcoll( "00000-00000.COM", "0-0-0-0-0-0-0-0-0-0.COM" ) = 4 So when the sort utility is trying to merge the temporary files together in mergefps(), it keeps swapping the same two entries corresponding to the test samples above, as the first argument will ALWAYS be considered "greater" than the second one, regardless of the order they are passed. Will go digging through glibc unless someone else finds this one first... I've checed into the CVS archive a patch to fix this problem. The fixed version will be in 2.2.3. Can this be included if an errata RPM is made of glibc-2.2.2? This affects lots of other utilities in addition to "sort" like "ls", etc., etc. It's fixed in rawhide and will be in the glibc errata we'll release in a while. |