public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug locale/28255] New: A locale with zero collation rules cause fnmatch, regexec, and regcomp failures.
@ 2021-08-20 22:05 carlos at redhat dot com
  2021-09-16 20:18 ` [Bug locale/28255] " fweimer at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: carlos at redhat dot com @ 2021-08-20 22:05 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28255

            Bug ID: 28255
           Summary: A locale with zero collation rules cause fnmatch,
                    regexec, and regcomp failures.
           Product: glibc
           Version: 2.35
            Status: NEW
          Severity: normal
          Priority: P2
         Component: locale
          Assignee: unassigned at sourceware dot org
          Reporter: carlos at redhat dot com
  Target Milestone: ---

It should be possible to build a locale with zero collation rules. Such a
locale would fall back to using strcmp and wcscmp during collation.

Such a collation, one with zero collation rules, would also lack any data for
_NL_COLLATE_COLLSEQMB, and _NL_COLLATE_COLLSEQWC. Any code using these tables
must be gated on nrules != 0.

However, as-of today, the only such locale in glibc was the builtin C locale,
and even though it has 0 collation rules, it has identity tables for
_NL_COLLATE_COLLSEQMB, and _NL_COLLATE_COLLSEQWC.

These identity tables are used unconditionally by fnmatch, regexec, and
regcomp, which means that when you don't generate them, the code does not
properly handle regular expressions.

The fix for this is quite extensive, and I didn't want to include it in glibc
2.34, but the fixes are present here in v4 of my C.UTF-8 patch series:
https://patchwork.sourceware.org/project/glibc/patch/20210729063515.1541388-2-carlos@redhat.com/

The fix is also insufficient because statically linked applications would not
have the fixes, so we must still keep the identity tables to allow static
applications to continue working with the new binary locales (until we manage
to make C.UTF-8 builtin).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-16 22:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20 22:05 [Bug locale/28255] New: A locale with zero collation rules cause fnmatch, regexec, and regcomp failures carlos at redhat dot com
2021-09-16 20:18 ` [Bug locale/28255] " fweimer at redhat dot com
2021-12-16 22:32 ` carlos at redhat dot com
2021-12-16 22:32 ` carlos at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).