Skip Menu |
Report information
Id: 120723
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: kaffeetisch [at] gmx.de
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: (no value)
Type: (no value)
Perl Version: (no value)
Fixed In: (no value)



From: Torsten Schoenfeld <kaffeetisch [...] gmx.de>
Subject: Setting LC_NUMERIC breaks parsing of constants
Date: Sat, 07 Dec 2013 22:56:15 +0100
To: perlbug [...] perl.org
Download (untitled) / with headers
text/plain 4.2k
This is a bug report for perl from kaffeetisch@gmx.de, generated with the help of perlbug 1.39 running under perl 5.19.6. ----------------------------------------------------------------- [Please describe your issue here] It seems like setting LC_NUMERIC to any locale with a decimal separator distinct from the dot breaks parsing of constants: # perl -e'use POSIX qw/locale_h/; BEGIN{ setlocale (LC_NUMERIC, "de_DE.UTF-8"); } use 5.008;' Invalid version format (non-numeric data) at -e line 1. BEGIN failed--compilation aborted at -e line 1. Porting/bisect.pl puts the blame on this commit: commit 01ec34b5d8c7075801bdb8ca8364cbe2027147dd Author: Karl Williamson <public@khwilliamson.com> Date: Thu Jun 20 12:28:12 2013 -0600 util.c: Avoid unnecessary setlocale() calls This code sets the locale to C around its work. This is unnecessary if the locale is already C, and there is an existing global that indicates this, that can be tested to avoid the sets. [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=core severity=low --- Site configuration information for perl 5.19.6: Configured by torsten at Sat Dec 7 17:48:52 CET 2013. Summary of my perl5 (revision 5 version 19 subversion 6) configuration: Platform: osname=linux, osvers=3.8.0-34-generic, archname=x86_64-linux-thread-multi uname='linux home.hcsiteeffak.de 3.8.0-34-generic #49-ubuntu smp tue nov 12 18:00:10 utc 2013 x86_64 x86_64 x86_64 gnulinux ' config_args='-de -Dprefix=/opt/perlbrew/perls/perl-5.19.6 -Dusethreads -DDEBUGGING -Dusedevel -Aeval:scriptdir=/opt/perlbrew/perls/perl-5.19.6/bin' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -g', cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.7.3', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.17' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector' --- @INC for perl 5.19.6: /opt/perlbrew/perls/perl-5.19.6/lib/site_perl/5.19.6/x86_64-linux-thread-multi /opt/perlbrew/perls/perl-5.19.6/lib/site_perl/5.19.6 /opt/perlbrew/perls/perl-5.19.6/lib/5.19.6/x86_64-linux-thread-multi /opt/perlbrew/perls/perl-5.19.6/lib/5.19.6 . --- Environment for perl 5.19.6: HOME=/home/torsten LANG=en_US.UTF-8 LANGUAGE (unset) LC_ADDRESS=de_DE.UTF-8 LC_IDENTIFICATION=de_DE.UTF-8 LC_MEASUREMENT=de_DE.UTF-8 LC_MONETARY=de_DE.UTF-8 LC_NAME=de_DE.UTF-8 LC_NUMERIC=de_DE.UTF-8 LC_PAPER=de_DE.UTF-8 LC_TELEPHONE=de_DE.UTF-8 LC_TIME=de_DE.UTF-8 LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/opt/perlbrew/bin:/opt/perlbrew/perls/perl-5.19.6/bin:/opt/bin:/home/torsten/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games PERLBREW_BASHRC_VERSION=0.65 PERLBREW_HOME=/home/torsten/.perlbrew PERLBREW_MANPATH=/opt/perlbrew/perls/perl-5.19.6/man PERLBREW_PATH=/opt/perlbrew/bin:/opt/perlbrew/perls/perl-5.19.6/bin PERLBREW_PERL=perl-5.19.6 PERLBREW_ROOT=/opt/perlbrew PERLBREW_VERSION=0.65 PERL_BADLANG (unset) SHELL=/usr/bin/zsh
From: Karl Williamson <public [...] khwilliamson.com>
Date: Sat, 07 Dec 2013 21:56:07 -0700
Subject: Re: [perl #120723] Setting LC_NUMERIC breaks parsing of constants
To: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 2.2k
On 12/07/2013 02:56 PM, Torsten Schoenfeld (via RT) wrote: Show quoted text
> # New Ticket Created by Torsten Schoenfeld > # Please include the string: [perl #120723] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=120723 > > > > This is a bug report for perl from kaffeetisch@gmx.de, > generated with the help of perlbug 1.39 running under perl 5.19.6. > > ----------------------------------------------------------------- > [Please describe your issue here] > > It seems like setting LC_NUMERIC to any locale with a decimal separator > distinct from the dot breaks parsing of constants: > > # perl -e'use POSIX qw/locale_h/; BEGIN{ setlocale (LC_NUMERIC, > "de_DE.UTF-8"); } use 5.008;' > Invalid version format (non-numeric data) at -e line 1. > BEGIN failed--compilation aborted at -e line 1. > > Porting/bisect.pl puts the blame on this commit: > > commit 01ec34b5d8c7075801bdb8ca8364cbe2027147dd > Author: Karl Williamson <public@khwilliamson.com> > Date: Thu Jun 20 12:28:12 2013 -0600 > > util.c: Avoid unnecessary setlocale() calls > > This code sets the locale to C around its work. This is unnecessary if > the locale is already C, and there is an existing global that indicates > this, that can be tested to avoid the sets. > > [Please do not change anything below this line] > ----------------------------------------------------------------- > --- > Flags: > category=core > severity=low > --- > Site configuration information for perl 5.19.6: > > Configured by torsten at Sat Dec 7 17:48:52 CET 2013. > > Summary of my perl5 (revision 5 version 19 subversion 6) configuration: > > --- > Environment for perl 5.19.6: > HOME=/home/torsten > LANG=en_US.UTF-8 > LANGUAGE (unset) > LC_ADDRESS=de_DE.UTF-8 > LC_IDENTIFICATION=de_DE.UTF-8 > LC_MEASUREMENT=de_DE.UTF-8 > LC_MONETARY=de_DE.UTF-8 > LC_NAME=de_DE.UTF-8 > LC_NUMERIC=de_DE.UTF-8 > LC_PAPER=de_DE.UTF-8 > LC_TELEPHONE=de_DE.UTF-8 > LC_TIME=de_DE.UTF-8 > LD_LIBRARY_PATH (unset) > LOGDIR (unset) >
I couldn't reproduce this until I looked at the startup environment that perlbug graciously furnishes. It's the LC_NUMERIC=de_DE.UTF-8 that causes the problem. I will work on a patch.
RT-Send-CC: perl5-porters [...] perl.org
Fixed by bc8ec7cc020d0562094a551b280fd3f32bf5eb04 -- Karl Williamson


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org