Bug 211179 - libc strcoll() enters endless loop when comparing two identical UTF8 strings under UTF-8 locale
Summary: libc strcoll() enters endless loop when comparing two identical UTF8 strings ...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.0-STABLE
Hardware: amd64 Any
: Normal Affects Many People
Assignee: Baptiste Daroussin
URL:
Keywords:
Depends on: 211135
Blocks:
  Show dependency treegraph
 
Reported: 2016-07-17 20:32 UTC by Martin Matuska
Modified: 2016-07-21 07:13 UTC (History)
1 user (show)

See Also:


Attachments
Test with polish UTF-8 character (127 bytes, text/x-csrc)
2016-07-17 20:32 UTC, Martin Matuska
no flags Details
Test with czech/slovak UTF-8 character (127 bytes, text/x-csrc)
2016-07-17 20:35 UTC, Martin Matuska
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Matuska freebsd_committer freebsd_triage 2016-07-17 20:32:23 UTC
Created attachment 172613 [details]
Test with polish UTF-8 character

See attached examples with single characters.
Comment 1 Martin Matuska freebsd_committer freebsd_triage 2016-07-17 20:35:38 UTC
Created attachment 172614 [details]
Test with czech/slovak UTF-8 character
Comment 2 Martin Matuska freebsd_committer freebsd_triage 2016-07-17 20:37:31 UTC
Using e.g. de_DE.UTF-8 as locale has the same effect
Comment 3 Martin Matuska freebsd_committer freebsd_triage 2016-07-18 08:11:44 UTC
I have narrowed this down to a endless loop in wcscoll_l():
for (pass = 0; pass <= table->info->directive_count; pass++) { }
Comment 4 Martin Matuska freebsd_committer freebsd_triage 2016-07-18 11:10:43 UTC
I can confirm this is fixed by John Marino's patch in DragonflyBSD:

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/3a40390f6101dd0c97b3cf92a44b2428a19c2a35
Comment 5 Martin Matuska freebsd_committer freebsd_triage 2016-07-18 11:29:22 UTC
I correct myself, we need to roll back r302324
Comment 6 Baptiste Daroussin freebsd_committer freebsd_triage 2016-07-21 07:13:38 UTC
Fixed by: 302916 in head 303112 in stable/11