From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: New libc-test regression test for uselocale [Was: Re: [musl] musl 1.1.10 released]
Date: Fri, 5 Jun 2015 12:16:54 -0400 [thread overview]
Message-ID: <20150605161654.GV17573@brightrain.aerifal.cx> (raw)
In-Reply-To: <20150605150156.GU17573@brightrain.aerifal.cx>
[-- Attachment #1: Type: text/plain, Size: 1967 bytes --]
On Fri, Jun 05, 2015 at 11:01:56AM -0400, Rich Felker wrote:
> On Fri, Jun 05, 2015 at 11:20:30AM +0300, Timo Teras wrote:
> > On Thu, 4 Jun 2015 16:30:18 -0400
> > Rich Felker <dalias@libc.org> wrote:
> >
> > > This release fixes regressions introduced as part of the dynamic
> > > linker bootstrap overhaul in musl 1.1.9, and adds several new features
> > > and improvements. Internal cleanup and optimizations have been made to
> > > the locale system. A fail-safe/allocation-free locale_t object for the
> > > C locale is now available via newlocale(), and the iconv_open function
> > > now supports "" and "CHAR" as aliases for the native (UTF-8) encoding.
> > > A new crt start file, rcrt1.o, is provided for producing static-linked
> > > position independent executables (PIE). Minor PIE-related
> > > arch-specific bugs, and a bug in the ungetc and ungetwc stdio
> > > functions which caused them to fail on files in EOF status, have also
> > > been fixed.
> > >
> > > http://www.musl-libc.org/releases/musl-1.1.10.tar.gz
> > > http://www.musl-libc.org/releases/musl-1.1.10.tar.gz.asc
> > >
> > > Thanks as always to musl's Patreon release sponsors:
> > >
> > > - The Midipix Project (midipix.org)
> > > - Hurricane Labs (hurricanelabs.com)
> > > - Justin Cormack
> > >
> > > Further notes on upcoming development will follow soon.
> >
> > There's relatively nasty regression in uselocale() breaking most X
> > applications (due to some libraries).
> >
> > See patch at:
> > http://git.alpinelinux.org/cgit/aports/plain/main/musl/0001-fix-uselocale-locale_t-0-to-not-modify-locale.patch
>
> Uhg, this kind of thing is exactly why I've been wishing we had tests
> for locale functions. I tested it minimally by hand but didn't think
> to try passing (locale_t)0. I'll probably make a fix release with this
> patch applied.
Regression test for just this one issue is attached. We should still
have some big locale functionality tests, though...
Rich
[-- Attachment #2: uselocale-0.c --]
[-- Type: text/plain, Size: 607 bytes --]
// commit: 63f4b9f18f3674124d8bcb119739fec85e6da005
// uselocale(0) should not change the current locale
#include <locale.h>
#include "test.h"
int main(void)
{
locale_t c = newlocale(LC_ALL_MASK, "C", 0);
if (!c) {
t_error("newlocale failed\n");
return t_status;
}
if (!uselocale(c))
t_error("uselocale(c) failed\n");
locale_t l1 = uselocale(0);
if (l1 != c)
t_error("uselocale failed to set locale: "
"%p != %p\n", (void*)l1, (void*)c);
locale_t l2 = uselocale(0);
if (l2 != l1)
t_error("uselocale(0) changed locale: "
"%p != %p\n", (void*)l2, (void*)l1);
return t_status;
}
prev parent reply other threads:[~2015-06-05 16:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-04 20:30 musl 1.1.10 released Rich Felker
2015-06-05 8:20 ` Timo Teras
2015-06-05 15:01 ` Rich Felker
2015-06-05 16:16 ` Rich Felker [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150605161654.GV17573@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.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.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).