From: "Ondřej Bílka" <neleai@seznam.cz>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: libc-alpha@sourceware.org, guix-devel@gnu.org
Subject: Re: [PATCH] Gracefully handle incompatible locale data
Date: Thu, 24 Sep 2015 10:27:55 +0200 [thread overview]
Message-ID: <20150924082755.GA4767@domone> (raw)
In-Reply-To: <8737y4hkrz.fsf@gnu.org>
On Wed, Sep 23, 2015 at 11:45:52PM +0200, Ludovic Courtès wrote:
> Ondřej Bílka <neleai@seznam.cz> skribis:
>
> > On Tue, Sep 22, 2015 at 11:22:40PM +0200, Ludovic Courtès wrote:
> >> Ondřej Bílka <neleai@seznam.cz> skribis:
> >>
> >> > On Tue, Sep 22, 2015 at 05:27:55PM +0200, Ludovic Courtès wrote:
> >> >> With libc 2.22 people are starting to realize that libc does not
> >> >> guarantee that it can load locale data built with another libc version,
> >> >> but they learn it the hard way:
> >> >>
> >> >> loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.
> >> >>
> >> >> This patch changes such conditions to return EINVAL instead of aborting.
> >> >>
> >> >> WDYT?
> >> >>
> >> > While that assert is quite cryptic I dont see why just returning EINVAL is
> >> > better. How do you distinguish that its wrong locale version versus not
> >> > installed?
> >>
> >> The rest of this function already returns EINVAL when something is
> >> fishy. This patch makes the behavior more consistent.
> >>
> > Then I take that back. But I don't see how this is reliable assertion to
> > detect different libc version.
>
> The goal is not to detect a different libc version, but rather to
> gracefully handle the situation where incompatible (or broken) locale
> data is found.
>
But my point is that this assert doesn't do that reliably. There could
be incompatible change that doesn't trigger that assert.
> > So could you as followup patch add version field and check that
> > instead this assert?
>
> It would be inaccurate since sometimes different libc versions produce
> and consume the same binary data (typically when no locale category
> elements are added, as was the case between ~2.19 to 2.21.)
>
Its better to keep it simple, you couldn't use locale data between
versions period. There could be also changes of algorithm so its harder
to tell if it will work or not.
> In addition, there is no errno value to report this specific
> version-mismatch diagnostic.
>
We could also reject your patch based on this as you dont report
specific value for assert so this doesn't matter.
next prev parent reply other threads:[~2015-09-24 8:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 15:27 [PATCH] Gracefully handle incompatible locale data Ludovic Courtès
2015-09-22 18:26 ` Roland McGrath
2015-09-22 19:18 ` Ondřej Bílka
2015-09-22 21:22 ` Ludovic Courtès
2015-09-22 21:50 ` Ondřej Bílka
2015-09-23 21:45 ` Ludovic Courtès
2015-09-24 8:27 ` Ondřej Bílka [this message]
2015-09-24 16:12 ` Ludovic Courtès
2015-09-25 21:20 ` Carlos O'Donell
2015-09-26 10:24 ` Ludovic Courtès
2015-09-28 20:54 ` Carlos O'Donell
2015-09-29 8:08 ` Ludovic Courtès
2015-10-08 10:31 ` Ludovic Courtès
2015-10-13 13:30 ` Carlos O'Donell
2015-10-13 14:45 ` Ludovic Courtès
2015-10-28 5:38 ` Carlos O'Donell
2015-10-13 0:49 ` Allan McRae
2015-10-13 9:50 ` Ludovic Courtès
2015-10-13 13:31 ` Carlos O'Donell
2015-09-23 6:59 ` Andreas Schwab
2015-09-23 7:03 ` Andreas Schwab
2015-09-24 2:15 ` Mark H Weaver
2015-09-24 19:32 ` Ludovic Courtès
2015-10-27 15:30 ` Samuel Thibault
2015-10-27 15:57 ` Ludovic Courtès
2015-10-28 6:19 ` Carlos O'Donell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150924082755.GA4767@domone \
--to=neleai@seznam.cz \
--cc=guix-devel@gnu.org \
--cc=libc-alpha@sourceware.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).