strxfrm output stability

Florian Weimer fweimer@redhat.com
Tue Sep 8 21:26:00 GMT 2015


On 09/08/2015 11:18 PM, Roland McGrath wrote:
> The only thing that matters about strxfrm output is its strcmp ordering.
> If that changes, it's either a bug fix or a bug (either in the code or in
> the locale data).  If the string contents change but the ordering doesn't,
> then it's an implementation detail that is allowed to change.

Why do you think that?  I don't see this documented anywhere, and I
doubt it is something many readers of the C standard, the man page, or
the glibc manual would expect.

The manual suggests to store the strxfrm output and use it for sorting.
 I expect that some applications put it into on-disk database indexes as
a result.  This will lead to subtle breakage on glibc updates.

(The larger problem is that there are *definitely* databases out there
which use B-tree indexes in locale collation order, which break in even
more subtle ways if we make minor changes to the collation order.)

-- 
Florian Weimer / Red Hat Product Security



More information about the Libc-alpha mailing list