develooper Front page | perl.perl5.porters | Postings from September 2012

[perl #115050] Double empty sub-regexp makes "panic!"

Thread Previous | Thread Next
From:
ina cpan
Date:
September 26, 2012 06:25
Subject:
[perl #115050] Double empty sub-regexp makes "panic!"
Message ID:
rt-3.6.HEAD-11172-1348651193-1980.115050-75-0@perl.org
# New Ticket Created by  ina cpan 
# Please include the string:  [perl #115050]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=115050 >


This is a bug report for perl from ina@cpan.org,
generated with the help of perlbug 1.39 running under perl 5.17.4.


-----------------------------------------------------------------
Double empty sub-regexp makes "panic!"
Was it change intended?

# double_empty_subregexp.pl

print "1..5\n";

$_ = 'any string';

if (/[\@\\]|/) { # ok, no panic.
    print "ok - 1\n";
}
if (/[\@]||/) { # ok
    print "ok - 2\n";
}
if (/[\\]||/) { # ok
    print "ok - 3\n";
}
if (/\@|\\||/) { # still, ok
    print "ok - 4\n";
}

# For example,
#    $delimiter     = '';
#    $end_delimiter = '';
# Then
#    if (/[\@\\]|$delimiter|$end_delimiter/) {

if (/[\@\\]||/) { # this line makes "panic!" on perl 5.17.4
    print "ok - 5\n";
}

__END__

http://cpansearch.perl.org/src/INA/Char-EUCJP-0.82/Char/EUCJP.pm

#
# escape qq string (qq//, "", qx//, ``)
#
sub e_qq {
    ...

    # escape last octet of multiple-octet
    elsif ($char[$i] =~ /\A ([\x80-\xFF].*)
($metachar|\Q$delimiter\E|\Q$end_delimiter\E) \z/xms) {
        $char[$i] = $1 . '\\' . $2;
    }

    ...
}

-----------------------------------------------------------------
---
Flags:
    category=core
    severity=high
---
Site configuration information for perl 5.17.4:

Configured by hinaba at Tue Sep 25 10:10:43 JST 2012.

Summary of my perl5 (revision 5 version 17 subversion 4) configuration:

  Platform:
    osname=linux, osvers=2.6.9-5.el, archname=x86_64-linux
    uname='linux greentea 2.6.9-5.el #1 wed jan 5 19:21:57 est 2005
x86_64 x86_64 x86_64 gnulinux '
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.4.3 20041212 (Red Hat 3.4.3-9.EL4)',
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 =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.3.4.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.3.4'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib'

Locally applied patches:


---
@INC for perl 5.17.4:
    /home/hinaba/perl501704/lib/site_perl/5.17.4/x86_64-linux
    /home/hinaba/perl501704/lib/site_perl/5.17.4
    /home/hinaba/perl501704/lib/5.17.4/x86_64-linux
    /home/hinaba/perl501704/lib/5.17.4
    .

---
Environment for perl 5.17.4:
    HOME=/home/hinaba
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/kerberos/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/hinaba/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash


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