develooper Front page | perl.perl5.porters | Postings from April 2017

[perl #131190] erroneous regex warning after utf8 conversion

Thread Next
From:
perlbug-followup
Date:
April 23, 2017 03:52
Subject:
[perl #131190] erroneous regex warning after utf8 conversion
Message ID:
rt-4.0.24-2143-1492816473-77.131190-75-0@perl.org
# New Ticket Created by   
# Please include the string:  [perl #131190]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=131190 >


This is a bug report for perl from saint.snit@gmail.com,
generated with the help of perlbug 1.40 running under perl 5.22.2.


-----------------------------------------------------------------
Perl emits an inapplicable warning for some regular expressions.
Here is a
code block that demonstrates the bug:

     use experimental 'smartmatch';
     use POSIX 'locale_h';
     use locale ':ctype';
     setlocale(LC_CTYPE, 'en_US');

     $_ = "x";
     utf8::upgrade($_);
     /x(y|z)?/;

This produces the output:

     Wide character (U+FFFD) in pattern match (m//) at - line 8.

even though no such character is ever specified.

The bug only seems to occur with the particular combination of "use"
statements above; for instance, it does not occur if the "smartmatch" line
is omitted, even though the code uses no smart matching.

(For reference, discussion about this bug originated at
http://perlmonks.com/?node_id=1188156)

Thank you for your time.
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl 5.22.2:

Configured by Gentoo at Thu Oct 20 22:32:43 CDT 2016.

Summary of my perl5 (revision 5 version 22 subversion 2) configuration:
   
  Platform:
    osname=linux, osvers=4.4.21-gentoo-evo, archname=i686-linux
    uname='linux evo 4.4.21-gentoo-evo #1 smp sun oct 9 21:43:27 cdt
2016 i686 intel(r) pentium(r) 4 cpu 1.70ghz genuineintel gnulinux '
    config_args='-des -Duseshrplib -Darchname=i686-linux
-Dcc=i686-pc-linux-gnu-gcc -Doptimize=-O2 -march=native -pipe
-Dldflags=-Wl,-O1 -Wl,--as-needed -Dprefix=/usr -Dinstallprefix=/usr
-Dsiteprefix=/usr/local -Dvendorprefix=/usr -Dscriptdir=/usr/bin
-Dprivlib=/usr/lib/perl5/5.22.2 -Darchlib=/usr/lib/perl5/5.22.2/i686-linux
-Dsitelib=/usr/local/lib/perl5/5.22.2
-Dsitearch=/usr/local/lib/perl5/5.22.2/i686-linux
-Dvendorlib=/usr/lib/perl5/vendor_perl/5.22.2
-Dvendorarch=/usr/lib/perl5/vendor_perl/5.22.2/i686-linux
-Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3
-Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3
-Dvendorman1dir=/usr/share/man/man1 -Dvendorman3dir=/usr/share/man/man3
-Dman1ext=1 -Dman3ext=3pm -Dlibperl=libperl.so.5.22.2
-Dlocincpth=/usr/include  -Dglibpth=/lib /usr/lib  -Duselargefiles
-Dd_semctl_semun -Dcf_by=Gentoo -Dmyhostname=localhost
-Dperladmin=root@localhost -Dinstallusrbinperl=n -Ud_csh -Uusenm -Di_ndbm
-Di_gdbm -Di_db -DDEBUGGING=none -Dinc_version_list=5.22.0/i686-linux
5.22.0 5.22.1/i686-linux 5.22.1  -Dnoextensions=ODBM_File'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='i686-pc-linux-gnu-gcc', ccflags ='-fwrapv -fno-strict-aliasing
-pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -march=native -pipe',
    cppflags='-fwrapv -fno-strict-aliasing -pipe'
    ccversion='', gccversion='4.9.3', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234,
doublekind=3
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12,
longdblkind=3
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='i686-pc-linux-gnu-gcc', ldflags ='-Wl,-O1 -Wl,--as-needed'
    libpth=/usr/lib/gcc/i686-pc-linux-gnu/4.9.3/include-fixed /usr/lib
/lib/../lib /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.22.so, so=so, useshrplib=true, libperl=libperl.so.5.22.2
    gnulibc_version='2.22'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -march=native -pipe
-Wl,-O1 -Wl,--as-needed'

Locally applied patches:
    gentoo/hints_hpux - Fix hpux hints
    gentoo/aix_soname - aix gcc detection and shared library soname
support
    gentoo/EUMM-RUNPATH - https://bugs.gentoo.org/105054
cpan/ExtUtils-MakeMaker: drop $PORTAGE_TMPDIR from LD_RUN_PATH
    gentoo/config_over - Remove -rpath and append LDFLAGS to lddlflags
    gentoo/opensolaris_headers - [PATCH] Add headers for opensolaris
    gentoo/patchlevel - List packaged patches for perl-5.22.2(#1)
in patchlevel.h
    gentoo/cpanplus_definstalldirs - Configure CPANPLUS to use the site
directories by default.
    gentoo/cleanup-paths - [PATCH] Cleanup PATH and shrpenv
    gentoo/enc2xs - Tweak enc2xs to follow symlinks and ignore missing
@INC directories.
    gentoo/darwin-cc-ld - https://bugs.gentoo.org/297751 [PATCH] darwin:
Use $CC to link
    gentoo/cpan_definstalldirs - Provide a sensible INSTALLDIRS default
for modules installed from CPAN.
    gentoo/interix - [PATCH] Fix interix hints
    gentoo/create_libperl_soname - https://bugs.gentoo.org/286840 [PATCH]
Set libperl soname
    gentoo/mod_paths - Add /etc/perl to @INC
    gentoo/EUMM_perllocalpod -
    gentoo/drop_fstack_protector - https://bugs.gentoo.org/348557 [PATCH]
Don't force -fstack-protector on everyone
    gentoo/usr_local - [PATCH] Remove /usr/local paths
    gentoo/D-SHA-CFLAGS - https://bugs.gentoo.org/506818 [PATCH] [PATCH]
Do not set custom CFLAGS in cpan/Digest-SHA
    gentoo/io_socket_ip_tests -
    gentoo/tests.patch -
    debian/cpan-missing-site-dirs - Fix CPAN::FirstTime defaults with
nonexisting site dirs if a parent is writable
    debian/makemaker-pasthru - Pass LD settings through to subdirectories
    debian/locale-robustness - [perl #124310] Make t/run/locale.t survive
missing locales masked by LC_ALL
    fixes/memoize_storable_nstore - [rt.cpan.org #77790]
Memoize::Storable: respect 'nstore' option not respected
    fixes/podman-pipe - Better errors for man pages from standard input
    fixes/respect_umask - Respect umask during installation
    fixes/podman-utc - Make the embedded date from Pod::Man reproducible
    fixes/podman-utc-docs - Documentation and test suite updates for
UTC fix
    fixes/net_smtp_docs - [rt.cpan.org #36038] Document the Net::SMTP
'Port' option
    fixes/document_makemaker_ccflags - [rt.cpan.org #68613] Document
that CCFLAGS should include $Config{ccflags}

---
@INC for perl 5.22.2:
    /etc/perl
    /usr/local/lib/perl5/5.22.2/i686-linux
    /usr/local/lib/perl5/5.22.2
    /usr/lib/perl5/vendor_perl/5.22.2/i686-linux
    /usr/lib/perl5/vendor_perl/5.22.2
    /usr/local/lib/perl5
    /usr/lib/perl5/vendor_perl
    /usr/lib/perl5/5.22.2/i686-linux
    /usr/lib/perl5/5.22.2
    .

---
Environment for perl 5.22.2:
    HOME=/home/vax
    LANG=C
    LANGUAGE (unset)
    LC_CTYPE=en_US.iso88591
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/vax/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.9.3:/sbin:/usr/sbin:/usr/games/bin:./bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

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