From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7880 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general 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 Message-ID: <20150605161654.GV17573@brightrain.aerifal.cx> References: <20150604203018.GA10046@brightrain.aerifal.cx> <20150605112030.3a8c8184@vostro> <20150605150156.GU17573@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TKYYegg/GYAC5JIZ" X-Trace: ger.gmane.org 1433521068 3734 80.91.229.3 (5 Jun 2015 16:17:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Jun 2015 16:17:48 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7893-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jun 05 18:17:35 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Z0uIv-0006BJ-Ch for gllmg-musl@m.gmane.org; Fri, 05 Jun 2015 18:17:09 +0200 Original-Received: (qmail 26237 invoked by uid 550); 5 Jun 2015 16:17:07 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 26215 invoked from network); 5 Jun 2015 16:17:07 -0000 Content-Disposition: inline In-Reply-To: <20150605150156.GU17573@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7880 Archived-At: --TKYYegg/GYAC5JIZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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 --TKYYegg/GYAC5JIZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="uselocale-0.c" // commit: 63f4b9f18f3674124d8bcb119739fec85e6da005 // uselocale(0) should not change the current locale #include #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; } --TKYYegg/GYAC5JIZ--