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

[perl #21968] pattern match hangs on malformed UTF-8 input

Thread Next
From:
Josh Mankoff
Date:
April 16, 2003 18:38
Subject:
[perl #21968] pattern match hangs on malformed UTF-8 input
Message ID:
rt-21968-55165.17.8118123019063@bugs6.perl.org
# New Ticket Created by  Josh Mankoff 
# Please include the string:  [perl #21968]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=21968 >


I tried to submit this using perlbug, but it never showed up on the bug
tracking list, so here it is again:

The following perl script hangs on my system. I realize that the input is
malformed UTF-8, but I would expect to get the error message "malformed
UTF-8 input". Note that there seems to be a small class of replacement
patterns that cause a hang. It seems to be any character class followed by a
single space:

printf "x\0227 " | perl -e 'use utf8; while (<STDIN>) { s/\d //; }'

Note that the perl script also hangs in Perl 5.8 without the 'use utf8', but
with the LANG environment variable set to a locale that expects UTF-8.

Thanks,
Josh


---
Flags:
    category=
    severity=high
---
Site configuration information for perl v5.6.1:

Configured by majer at Mon Mar 31 17:18:45 EST 2003.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.18-3bigmem, archname=i686-linux
    uname='linux corona 2.4.18-3bigmem #1 smp thu apr 18 07:17:10 edt 2002
i686 unknown '
    config_args='-ds -e -Dprefix=/usr/local/perl-5.6.1'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.3 2.96-110)',
gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl v5.6.1:
    /usr/local/lib/perl5/5.6.1//i686-linux
    /usr/local/lib/perl5/5.6.1/
    /usr/local/perl-5.6.1/lib/5.6.1/i686-linux
    /usr/local/perl-5.6.1/lib/5.6.1
    /usr/local/perl-5.6.1/lib/site_perl/5.6.1/i686-linux
    /usr/local/perl-5.6.1/lib/site_perl/5.6.1
    /usr/local/perl-5.6.1/lib/site_perl
    .

---
Environment for perl v5.6.1:
    HOME=/home/jmankoff
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/local/lib:/lib
    LOGDIR (unset)
    PATH=.:/usr/local/bin:/usr/bin:/bin:/usr/ccs/bin
    PERL5LIB=/usr/local/lib/perl5/5.6.1/
    PERLLIB=/usr/local/lib/perl5/5.6.1/
    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