Bug #6904

collation: Fix expansion substitutions

Added by Garrett D'Amore over 4 years ago. Updated over 3 years ago.

lib - userland libraries
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


collate.c has some issues that John Marino fixed in DragonflyBSD -- we need to review, adjust, and integrate these fixes.

This needs to be fixed before the new CLDR data is integrated. Probably we should take the wscoll.c changes too.


Updated by Lauri Tirkkonen over 4 years ago

Original fix causes a segfault in strxfrm() with iso-8859-5 locales. After discussions with Baptiste Daroussin of FreeBSD and John Marino of DragonFly, Baptiste came up with the following patch for FreeBSD:

which fixes the segfault for them. I have code that imports these changes, as well as two tests from FreeBSD, but unfortunately on illumos the above patch causes an infinite loop in strcoll()/wcscoll() (as did my initial attempt, which briefly appeared in both BSDs mentioned above).

The original code from DragonFly (linked in the description) doesn't make complete sense; the "*state = NULL;" branch is never taken with the current check, so this still needs further investigation.


Updated by Yuri Pankov almost 4 years ago

  • Category set to lib - userland libraries
  • Status changed from New to In Progress
  • Assignee set to Yuri Pankov
  • Difficulty changed from Medium to Bite-size
  • Tags deleted (needs-triage)

Updated by Yuri Pankov over 3 years ago

  • Subject changed from collation code fixes from dragonfly bsd to collation: Fix expansion substitutions

Updated by Electric Monk over 3 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit c8e8151746c31cffabceb6c8a47afa98f041f327

commit  c8e8151746c31cffabceb6c8a47afa98f041f327
Author: John Marino <>
Date:   2017-03-28T04:12:07.000Z

    6904 collation: Fix expansion substitutions
    Reviewed by: Robert Mustacchi <>
    Reviewed by: Yuri Pankov <>
    Approved by: Dan McDonald <>

Also available in: Atom PDF