unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Carlos O'Donell <carlos@redhat.com>
Cc: "Ondřej Bílka" <neleai@seznam.cz>,
	libc-alpha@sourceware.org, guix-devel@gnu.org,
	"Roland McGrath" <roland@hack.frob.com>
Subject: Re: [PATCH] Gracefully handle incompatible locale data
Date: Tue, 29 Sep 2015 10:08:53 +0200	[thread overview]
Message-ID: <87io6t1wbu.fsf@gnu.org> (raw)
In-Reply-To: <5609A8E9.7050201@redhat.com> (Carlos O'Donell's message of "Mon, 28 Sep 2015 16:54:01 -0400")

"Carlos O'Donell" <carlos@redhat.com> skribis:

> On 09/26/2015 06:24 AM, Ludovic Courtès wrote:
>> Furthermore, the function in question returns EINVAL in other similar
>> cases–e.g., when libc 2.22 loads LC_COLLATE data from libc 2.21.
>
> If you change this particular case to EINVAL, what does the user see
> as a result of this change?

The user-visible change is that, if incompatible or broken locale data
is found, a call like:

  setlocale (LC_ALL, "");

returns EINVAL instead of aborting.

> Do they get a non-zero exit code from `localedef --list-archive` along
> with an error written out to stderr?

‘localedef’ starts with:

  setlocale (LC_MESSAGES, "");
  setlocale (LC_CTYPE, "");

so it will no longer abort when invalid locale data is found (although
in the 2.21 → 2.22 transition, only the LC_COLLATE data format differs
anyway.)

Apart from that, ‘localedef --list-archive’ simply opens the locale
archive (typically /usr/lib/locale/locale-archive, regardless of the
‘LOCPATH’ environment variable value), so its behavior is unchanged.

Am I overlooking something?

> This is the kind of change I'm expecting. If we are removing an assertion,
> we should be replacing it with something meaningful and verifying that
> meaningful change.

Yes, agreed.

The function that is changed, ‘_nl_intern_locale_data’, has only two
callers in libc, and both check whether it returns NULL.  So it seems to
me that the code is not introducing anything new in the API contract.
WDYT?

Thank you,
Ludo’.

  reply	other threads:[~2015-09-29  8:08 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
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 [this message]
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=87io6t1wbu.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=carlos@redhat.com \
    --cc=guix-devel@gnu.org \
    --cc=libc-alpha@sourceware.org \
    --cc=neleai@seznam.cz \
    --cc=roland@hack.frob.com \
    /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).