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

[perl #113770] (?>(?:)...) match failure

Thread Previous | Thread Next
From:
Zefram
Date:
June 21, 2012 03:50
Subject:
[perl #113770] (?>(?:)...) match failure
Message ID:
rt-3.6.HEAD-5009-1340275791-1395.113770-75-0@perl.org
# New Ticket Created by  Zefram 
# Please include the string:  [perl #113770]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=113770 >



This is a bug report for perl from zefram@fysh.org,
generated with the help of perlbug 1.39 running under perl 5.17.1.


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

$ perl5.17.0 -e 'print "[A]" =~ /\A(?>\[(?:(?:)(?:R){1}|T|V?|A)\])\z/ ? "OK\n" : "BUG\n"'
OK
$ perl5.17.1 -e 'print "[A]" =~ /\A(?>\[(?:(?:)(?:R){1}|T|V?|A)\])\z/ ? "OK\n" : "BUG\n"'
BUG

This breaks the IPv6 address parsing in Net::{FTP,HTTP}::Tiny.  bisect says:

3b6759a6b10290b6fea26fb98b50fbf5ce4466b5 is the first bad commit
commit 3b6759a6b10290b6fea26fb98b50fbf5ce4466b5
Author: Yves Orton <demerphq@gmail.com>
Date:   Wed Jun 6 08:53:05 2012 +0200

    optimise (?:|) and related NOTHING like constructs out of the compiled optree
    
    A pattern like (?:|) causes the regex engine to do extra work even though
    it is equivelent to matching nothing. This optimises such sequences into
    more efficient opcodes that do less work, and in some cases optimises
    them away entirely.

:100644 100644 5ec3bc4c85f768245e2c25ca863918b57e2ce1c6 906add73130394ba7f871a2ecfd82e24b5d49348 M      regcomp.c

I've got some major deja vu about a should-be-null (?:) tickling a
regexp bug that shows up in IPv6 address parsing, but I can't find the
prior case.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl 5.17.1:

Configured by zefram at Wed Jun 20 23:58:39 BST 2012.

Summary of my perl5 (revision 5 version 17 subversion 1) configuration:
   
  Platform:
    osname=linux, osvers=3.2.0-0.bpo.2-amd64, archname=x86_64-linux-thread-multi
    uname='linux barba.rous.org 3.2.0-0.bpo.2-amd64 #1 smp sun jun 3 21:40:57 utc 2012 x86_64 gnulinux '
    config_args='-des -Dprefix=/home/zefram/usr/perl/perl_install/perl-5.17.1-i64-f52 -Duselargefiles -Dusethreads -Uafs -Ud_csh -Uusesfio -Uusenm -Duseshrplib -Dusedevel -Uversiononly -Ui_db'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.4.5', 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 =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib /lib64 /usr/lib64
    libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.11.3.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.11.3'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/home/zefram/usr/perl/perl_install/perl-5.17.1-i64-f52/lib/5.17.1/x86_64-linux-thread-multi/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Locally applied patches:
    

---
@INC for perl 5.17.1:
    /home/zefram/usr/perl/perl_install/perl-5.17.1-i64-f52/lib/site_perl/5.17.1/x86_64-linux-thread-multi
    /home/zefram/usr/perl/perl_install/perl-5.17.1-i64-f52/lib/site_perl/5.17.1
    /home/zefram/usr/perl/perl_install/perl-5.17.1-i64-f52/lib/5.17.1/x86_64-linux-thread-multi
    /home/zefram/usr/perl/perl_install/perl-5.17.1-i64-f52/lib/5.17.1
    .

---
Environment for perl 5.17.1:
    HOME=/home/zefram
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/zefram/usr/perl/perl_install/perl-5.17.1-i64-f52/bin:/home/zefram/usr/perl/util:/home/zefram/pub/x86_64-unknown-linux-gnu/bin:/home/zefram/pub/common/bin:/usr/bin:/bin:/usr/local/bin:/usr/games
    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