Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting LC_NUMERIC breaks parsing of constants #13459

Closed
p5pRT opened this issue Dec 7, 2013 · 5 comments

Comments

@p5pRT
Copy link

commented Dec 7, 2013

Migrated from rt.perl.org#120723 (status was 'resolved')

Searchable as RT120723$

@p5pRT

This comment has been minimized.

Copy link
Author

commented Dec 7, 2013

From kaffeetisch@gmx.de

Created by kaffeetisch@gmx.de

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 01ec34b
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.

Perl Info

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

@p5pRT

This comment has been minimized.

Copy link
Author

commented Dec 8, 2013

From @khwilliamson

On 12/07/2013 02​:56 PM, Torsten Schoenfeld (via RT) wrote​:

# 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-archive.perl.org/perl5/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 01ec34b
Author​: Karl Williamson <public@​khwilliamson.com>
Date​: Thu Jun 20 12​:28​:12 2013 -0600

 util\.c&#8203;: 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.

@p5pRT

This comment has been minimized.

Copy link
Author

commented Dec 8, 2013

The RT System itself - Status changed from 'new' to 'open'

@p5pRT

This comment has been minimized.

Copy link
Author

commented Jan 4, 2014

From @khwilliamson

Fixed by bc8ec7c
--
Karl Williamson

@p5pRT

This comment has been minimized.

Copy link
Author

commented Jan 4, 2014

@khwilliamson - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this Jan 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.