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

[perl #133945] ce6f496d720f6206455628425320badd95b07372 breaks floatformatting under GTK

Thread Previous | Thread Next
From:
Dmitry Karasik
Date:
March 20, 2019 18:03
Subject:
[perl #133945] ce6f496d720f6206455628425320badd95b07372 breaks floatformatting under GTK
Message ID:
rt-4.0.24-20988-1553105004-633.133945-75-0@perl.org
# New Ticket Created by  Dmitry Karasik 
# Please include the string:  [perl #133945]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133945 >


This is a bug report for perl from dmitry@karasik.eu.org,
generated with the help of perlbug 1.41 running under perl 5.29.2.


-----------------------------------------------------------------
[Please describe your issue here]

ce6f496d720f6206455628425320badd95b07372 changed float/double formatting 
from strtoflt128 to Perl_strtod, which had a nasty side effect when running
under non-english locales (or I suspect with locales that use comma for decimal point)
together with GTK or any other library that calls setlocale() itself.

The test for this is rather elaborate, so I'm attaching a localebug module
that tests for it when run 'make test'. One needs the following (for Ubuntu, for
example):

* apt-get install libgtk2.0-dev (gtk development files)
* cpan ExtUtils::PkgConfig
* locale-gen de_DE.UTF-8 && update-locale (tests need de_DE.UTF-8)

When running with a faulty configuration, the core issue is basically this:

    my $s = sprintf "%s", 4.9999;
    die "bug:$s" if $s !~ /^4[,.]9999$/;

which prints just "4".

The module attached can also be found at http://karasik.eu.org/misc/localebug-1.00.tar.gz

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
This perlbug was built using Perl 5.29.3 - Wed Mar 20 18:13:09 CET 2019
It is being executed now by  Perl 5.29.2 - Wed Mar 20 18:25:02 CET 2019.

Site configuration information for perl 5.29.2:

Configured by dk at Wed Mar 20 18:25:02 CET 2019.

Summary of my perl5 (revision 5 version 29 subversion 1) configuration:
  Commit id: c7ea9f039c0e7c2333adfcb3b9f1e3f2b25693a1
  Platform:
    osname=linux
    osvers=4.15.0-45-generic
    archname=x86_64-linux
    uname='linux kraken 4.15.0-45-generic #48-ubuntu smp tue jan 29 16:28:13 utc 2019 x86_64 x86_64 x86_64 gnulinux '
    config_args=''
    hint=previous
    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'
    optimize='-O2'
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='7.3.0'
    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/7/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 /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib
    libs=-lpthread -lnsl -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.27.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.27'
  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.29.2:
    lib
    /usr/local/lib/perl5/site_perl/5.29.9/x86_64-linux
    /usr/local/lib/perl5/site_perl/5.29.9
    /usr/local/lib/perl5/5.29.9/x86_64-linux
    /usr/local/lib/perl5/5.29.9

---
Environment for perl 5.29.2:
    HOME=/home/dk
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/dk/perl5/perlbrew/bin:/home/dk/bin:/home/dk/bin:/home/dk/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/thinlinc/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/local/site/bin:/usr/local/site/sbin:/opt/ibm/db2/V9.7/bin
    PERLBREW_HOME=/home/dk/.perlbrew
    PERLBREW_ROOT=/home/dk/perl5/perlbrew
    PERLBREW_SHELLRC_VERSION=0.84
    PERL_BADLANG (unset)
    SHELL=/usr/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