Bug 1269895 - strcoll is broken on fedora 23 with LC_COLLATE=cs_CZ
Summary: strcoll is broken on fedora 23 with LC_COLLATE=cs_CZ
Keywords:
Status: CLOSED DUPLICATE of bug 1276711
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Carlos O'Donell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-08 12:38 UTC by Pavel Raiskup
Modified: 2015-11-11 14:08 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-11 14:08:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Reproducer. (382 bytes, application/x-gzip)
2015-10-08 12:38 UTC, Pavel Raiskup
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Sourceware 18589 0 None None None Never

Description Pavel Raiskup 2015-10-08 12:38:20 UTC
Created attachment 1080988 [details]
Reproducer.

Reproducer attached, strcoll() fails to compare "config" and "choose"
in czech collation.

Actual results:

  $ tar xf reproducer.tar.gz && cd reproducer
  $ make
  gcc main.c -o reproducer
  8
  7

Expected results:

  $ tar xf reproducer.tar.gz && cd reproducer
  $ make
  gcc main.c -o reproducer
  -7
  7

Comment 2 Florian Weimer 2015-10-08 13:43:40 UTC
“config“ comes before “choose” in the Czech alphabet because CH is a digraph that sorts between H and I.  We cannot fix this without breaking the expected collation order for Czech.

Comment 3 Pavel Raiskup 2015-10-08 13:53:00 UTC
Yes, but strcoll("config", "choose") returns positive number in cs_CZ, but
should return negative.  Or what am I missing here?  Have you tried the
reproducer, Florian?

Comment 4 Florian Weimer 2015-10-08 14:23:25 UTC
I cannot reproduce this:

$ cat main.c 
#include <stdio.h>
#include <string.h>
#include <locale.h>

int main()
{
    setlocale (LC_ALL, "");
    printf("%d\n", strcoll("config", "choose"));
    return 0;
}
$ gcc -O2 -Wall main.c 
$ LC_ALL=cs_CZ ./a.out 
-7

Comment 5 Pavel Raiskup 2015-10-08 14:34:23 UTC
Well, thats weird.  I can do that on native 23 box and also in F23 mock
on F23 box.  While I'm not able to reproduce this in F22 box.

My output looks like:
 sh-4.3# LC_ALL=cs_CZ ./a.out 
 8
 sh-4.3# cat /etc/os-release | grep PRETTY
 PRETTY_NAME="Fedora 23 (Twenty Three)"

Comment 6 Pavel Raiskup 2015-10-08 15:05:16 UTC
# from fedora 22 x86_64:
mock -r fedora-23-x86_64 --copyin /tmp/reproducer.tar.gz /
mock -r fedora-23-x86_64 --shell 'tar -xf reproducer.tar.gz && make -C reproducer'
....
Start: shell
make: Entering directory '/reproducer'
8
7
make: Leaving directory '/reproducer'
Finish: shell
....

Correctly working glibc prints:
-7
7

Comment 7 Florian Weimer 2015-10-08 16:14:44 UTC
Right, I used the wrong chroot, sorry.

Comment 8 Carlos O'Donell 2015-10-08 16:33:27 UTC
I cam reproduce it in F23.

This is upstream bug 18589, and reverting Leonhard's optimization fixes the sorting.

I'll get this fixed ASAP.

Comment 9 Pavel Raiskup 2015-11-11 13:28:33 UTC
Carlos, any progress on this?

Comment 10 Florian Weimer 2015-11-11 13:43:49 UTC
(In reply to Pavel Raiskup from comment #9)
> Carlos, any progress on this?

I think this is being fixed via bug 1276711.

Comment 11 Pavel Raiskup 2015-11-11 14:08:15 UTC
Truth, I'm not sure this is real duplicate but using updated glibc fixed
this problem to me.

*** This bug has been marked as a duplicate of bug 1276711 ***


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