develooper Front page | perl.perl5.porters | Postings from September 2019

[perl #134182] Fix test failure in POSIX/t/mb.t with semi-brokenlocales

From:
Tony Cook via RT
Date:
September 16, 2019 06:54
Subject:
[perl #134182] Fix test failure in POSIX/t/mb.t with semi-brokenlocales
Message ID:
rt-4.0.24-12252-1568616859-1816.134182-15-0@perl.org
On Mon, 17 Jun 2019 09:21:04 -0700, ntyni@debian.org wrote:
> On Mon, Jun 17, 2019 at 02:49:43PM +0300, Niko Tyni wrote:
> > On Mon, Jun 17, 2019 at 09:47:04AM +0300, Niko Tyni wrote:
> > 
> > > I can reproduce it on 5.30.0. It seems to be related to version strings
> > > and LC_NUMERIC.  I reduced it to this:
> > > 
> > > $ LC_NUMERIC=C.UTF-8 ./perl -l -Ilib -e 'require 5.006;'
> > 
> > And further to this. It's not clear to me if this is a problem with asan
> > or the code.
> > 
> > $ cat t.c; clang -g -fsanitize=address t.c; ./a.out
> > #include <locale.h>
> > int main(void) {
> >     char *l;
> >     setlocale(LC_NUMERIC, "C.UTF-8");
> >     l = setlocale(LC_NUMERIC, NULL);
> >     setlocale(LC_NUMERIC, "C");
> >     setlocale(LC_NUMERIC, l);
> > }
> 
> Presumably the intervening setlocale() call clobbers the buffer
> that l points to.
> 
> The attached patch to vutil.c seems to fix this issue for me,
> but eyeballs appreciated of course.

https://rt.perl.org/Ticket/Display.html?id=134212 has a more complete fix (I didn't see this until I diagnosed it.)

Tony



---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=134182



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About