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

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

Thread Previous | Thread Next
June 21, 2012 03:50
[perl #113770] (?>(?:)...) match failure
Message ID:
# New Ticket Created by  Zefram 
# Please include the string:  [perl #113770]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
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"'
$ perl5.17.1 -e 'print "[A]" =~ /\A(?>\[(?:(?:)(?:R){1}|T|V?|A)\])\z/ ? "OK\n" : "BUG\n"'

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

3b6759a6b10290b6fea26fb98b50fbf5ce4466b5 is the first bad commit
commit 3b6759a6b10290b6fea26fb98b50fbf5ce4466b5
Author: Yves Orton <>
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]
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:
    osname=linux, osvers=3.2.0-0.bpo.2-amd64, archname=x86_64-linux-thread-multi
    uname='linux 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
    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',
    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/, so=so, useshrplib=true,
  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:

Environment for perl 5.17.1:
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About