Bug 208266

Summary: strxfrm and strcoll do not always agree
Product: Base System Reporter: Thomas Munro <munro>
Component: standardsAssignee: Baptiste Daroussin <bapt>
Status: Closed FIXED    
Severity: Affects Many People CC: bapt, noah, standards, yuripv
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Test program
none
Script to run test program against all locales none

Description Thomas Munro 2016-03-24 19:37:16 UTC
The man page for strxfrm says:

"Comparing two strings using strcmp() after strxfrm() is equal to compar-
ing two original strings with strcoll()."

The PostgreSQL hackers wrote a test program to study a collation bug
on another operating system.  The test generates random strings and
checks if strxfrm and strcoll agree on their ordering, according to
each locale available on the system.  I decided to try it out on
FreeBSD and found that it passes on 10.2, but fails miserably on
11.0-CURRENT.

The test program is here:

http://www.postgresql.org/message-id/31913.1458747836@sss.pgh.pa.us
Comment 1 Thomas Munro 2016-03-24 20:17:48 UTC
Created attachment 168579 [details]
Test program
Comment 2 Thomas Munro 2016-03-24 20:18:17 UTC
Created attachment 168580 [details]
Script to run test program against all locales
Comment 3 Thomas Munro 2016-03-24 20:32:02 UTC
Filed as 'standards' because POSIX requires strxfrm and strcoll to agree, but please move to the correct component for libc bugs if appropriate.
Comment 4 Yuri Pankov 2017-12-05 23:54:43 UTC
This should be fixed in base r317034.
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2018-09-22 03:00:49 UTC
Assign to committer that resolves (see comment 4)

If the issue is not resolved, please re-open