develooper Front page | perl.perl5.porters | Postings from February 2018

Re: [perl #132901] setlocale's return value is broken

Thread Previous | Thread Next
From:
Karl Williamson
Date:
February 23, 2018 23:58
Subject:
Re: [perl #132901] setlocale's return value is broken
Message ID:
eb1fe06a-2994-728e-4a33-dff6e61e25ad@khwilliamson.com
On 02/23/2018 02:41 PM, Slaven Rezic wrote:
> Karl Williamson <public@khwilliamson.com> writes:
> 
>> On 02/23/2018 12:33 AM, slaven@rezic.de wrote:
>>> # New Ticket Created by  slaven@rezic.de
>>> # Please include the string:  [perl #132901]
>>> # in the subject line of all future correspondence about this issue.
>>> # <URL: https://rt.perl.org/Ticket/Display.html?id=132901 >
>>>
>>>
>>>
>>> This is a bug report for perl from slaven@rezic.de,
>>> generated with the help of perlbug 1.41 running under perl 5.27.9.
>>>
>>>
>>> -----------------------------------------------------------------
>>> On Linux systems (checked CentOS6 and various Debians) the
>>> following call returns binary garbage instead of the current locale:
>>>
>>>       $ env LC_ALL=de_DE.UTF-8 perl5.27.9 -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)'
>>
>> I don't get garbage, but I'm not getting the shortest output possible
>> on Ubuntu, which I have a fix for.
>>
>> Please run the following on a DEBUGGING build, and post the output.
>> (The problem will not occur on systems that have querylocale(), nor in
>> locales, such as C, where the radix character is a dot)
>>
>> env LC_ALL=de_DE.UTF-8 env PERL_DEBUG_LOCALE_INIT=1 perl5.27.9 -DLv
>> -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)'
>>
>> (I don't know the proper syntax of stringing two env's together, so
>> adjust if necessary)
> 
> Attached. This is with a slightly newer perl than 5.27.9 (d3a1131).

Unfortunately the logging option you selected was lowercase 'l' instead 
of uppercase, and so its the wrong information.  You might want to try 
instead doing a checkout of smoke-me/khw-locale, which has several bug 
fixes related to locales.
> 
> Regards,
>      Slaven
> 
>>>
>>> This does not seem to happen if the current locale is C. And I cannot
>>> reproduce the problem on FreeBSD systems.
>>>
>>> The problem does not happen with 5.27.8-157-gef80cd9 or earlier perl
>>> versions.
>>>
>>> (Discovered because the test suite of MSCHOUT/Math-Currency-0.52.tar.gz
>>> fails because of this problem).
>>>
>>> -----------------------------------------------------------------
>>> ---
>>> Flags:
>>>       category=library
>>>       severity=low
>>>       module=POSIX
>>> ---
>>> Site configuration information for perl 5.27.9:
>>>
>>> Configured by eserte at Tue Feb 20 21:59:42 CET 2018.
>>>
>>> Summary of my perl5 (revision 5 version 27 subversion 9) configuration:
>>>         Platform:
>>>       osname=linux
>>>       osvers=3.16.0-4-amd64
>>>       archname=x86_64-linux
>>>       uname='linux cabulja 3.16.0-4-amd64 #1 smp debian 3.16.51-3 (2017-12-13) x86_64 gnulinux '
>>>       config_args='-ds -e -Dprefix=/opt/perl-5.27.9 -Dusedevel -Dusemallocwrap=no -Dcf_email=srezic@cpan.org'
>>>       hint=recommended
>>>       useposix=true
>>>       d_sigaction=define
>>>       useithreads=undef
>>>       usemultiplicity=undef
>>>       use64bitint=define
>>>       use64bitall=define
>>>       uselongdouble=undef
>>>       usemymalloc=n
>>>       default_inc_excludes_dot=define
>>>       bincompat5005=undef
>>>     Compiler:
>>>       cc='cc'
>>>       ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
>>>       optimize='-O2'
>>>       cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
>>>       ccversion=''
>>>       gccversion='4.9.2'
>>>       gccosandvers=''
>>>       intsize=4
>>>       longsize=8
>>>       ptrsize=8
>>>       doublesize=8
>>>       byteorder=12345678
>>>       doublekind=3
>>>       d_longlong=define
>>>       longlongsize=8
>>>       d_longdbl=define
>>>       longdblsize=16
>>>       longdblkind=3
>>>       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-strong -L/usr/local/lib'
>>>       libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib
>>>       libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
>>>       perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
>>>       libc=libc-2.19.so
>>>       so=so
>>>       useshrplib=false
>>>       libperl=libperl.a
>>>       gnulibc_version='2.19'
>>>     Dynamic Linking:
>>>       dlsrc=dl_dlopen.xs
>>>       dlext=so
>>>       d_dlsymun=undef
>>>       ccdlflags='-Wl,-E'
>>>       cccdlflags='-fPIC'
>>>       lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'
>>>
>>>
>>> ---
>>> @INC for perl 5.27.9:
>>>       /opt/perl-5.27.9/lib/site_perl/5.27.9/x86_64-linux
>>>       /opt/perl-5.27.9/lib/site_perl/5.27.9
>>>       /opt/perl-5.27.9/lib/5.27.9/x86_64-linux
>>>       /opt/perl-5.27.9/lib/5.27.9
>>>
>>> ---
>>> Environment for perl 5.27.9:
>>>       HOME=/home/eserte
>>>       LANG=en_US.UTF-8
>>>       LANGUAGE (unset)
>>>       LD_LIBRARY_PATH (unset)
>>>       LOGDIR (unset)
>>>       PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/eserte/bin/linux-gnu:/home/eserte/bin/sh:/home/eserte/bin:/home/eserte/bin/pistachio-perl/bin:/usr/games:/home/eserte/devel
>>>       PERLDOC=-MPod::Perldoc::ToTextOverstrike
>>>       PERL_BADLANG (unset)
>>>       SHELL=/bin/zsh
>>>
>>>
> 
> 
> 
> 

Thread Previous | Thread Next


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