Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regcomp warning gives wrong position of problem #14065

Closed
p5pRT opened this issue Sep 1, 2014 · 8 comments
Closed

regcomp warning gives wrong position of problem #14065

p5pRT opened this issue Sep 1, 2014 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 1, 2014

Migrated from rt.perl.org#122680 (status was 'resolved')

Searchable as RT122680$

@p5pRT
Copy link
Author

p5pRT commented Sep 1, 2014

From @khwilliamson

This is a bug report for perl from khw@​khw.(none),
generated with the help of perlbug 1.40 running under perl 5.21.4.


The only warning raised by study_chunk in regcomp.c always says the
problem was at the end of the pattern, no matter where it actually
occurred. Thus for very large patterns, the warning can point to
someplace millions of bytes away from the actual problem location.

The reason is that the message uses the parse position pointer
RExC_parse, and by the time the message is raised, the whole pattern has
been parsed, so of course it's going to point to the very end of the
pattern.

The "solution" that occurs to me is simply to not bother to output a
position. No position is better than a wrong one. I don't see any
other way to do it that doesn't involve too much work.



Flags​:
  category=core
  severity=low


Site configuration information for perl 5.21.4​:

Configured by khw at Mon Sep 1 11​:29​:12 MDT 2014.

Summary of my perl5 (revision 5 version 21 subversion 4) configuration​:
  Derived from​: c0cd65b
  Platform​:
  osname=linux, osvers=3.13.0-35-generic,
archname=x86_64-linux-thread-multi-ld
  uname='linux khw 3.13.0-35-generic #62-ubuntu smp fri aug 15
01​:58​:42 utc 2014 x86_64 x86_64 x86_64 gnulinux '
  config_args='-des -Uversiononly -Dprefix=/home/khw/blead -Dusedevel
-D'optimize=-ggdb3' -A'optimize=-ggdb3' -A'optimize=-O0'
-Accflags='-DPERL_BOOL_AS_CHAR' -Dman1dir=none -Dman3dir=none
-DDEBUGGING -DDEBUGGING -Dcc=g++ -Dusemorebits -Dusethreads'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=define, usemultiplicity=define
  use64bitint=define, use64bitall=define, uselongdouble=define
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='g++', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DPERL_BOOL_AS_CHAR
-fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_FORTIFY_SOURCE=2',
  optimize=' -ggdb3 -O0',
  cppflags='-D_REENTRANT -D_GNU_SOURCE -DPERL_BOOL_AS_CHAR -fwrapv
-DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include'
  ccversion='', gccversion='4.8.2', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
  d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=16, longdblkind=3
  ivtype='long', ivsize=8, nvtype='long double', nvsize=16,
Off_t='off_t', lseeksize=8
  alignbytes=16, prototype=define
  Linker and Libraries​:
  ld='g++', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/include/c++/4.8 /usr/include/x86_64-linux-gnu/c++/4.8
/usr/include/c++/4.8/backward /usr/local/lib
/usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed
/usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib
/usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib
  libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
  libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.19'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fPIC', lddlflags='-shared -ggdb3 -ggdb3 -O0
-L/usr/local/lib -fstack-protector'

Locally applied patches​:
  uncommitted-changes


@​INC for perl 5.21.4​:
  /home/khw/perl/blead/lib
  /home/khw/blead/lib/perl5/site_perl/5.21.4/x86_64-linux-thread-multi-ld
  /home/khw/blead/lib/perl5/site_perl/5.21.4
  /home/khw/blead/lib/perl5/5.21.4/x86_64-linux-thread-multi-ld
  /home/khw/blead/lib/perl5/5.21.4
  /home/khw/blead/lib/perl5/site_perl/5.21.3
  /home/khw/blead/lib/perl5/site_perl/5.21.2
  /home/khw/blead/lib/perl5/site_perl/5.21.1
  /home/khw/blead/lib/perl5/site_perl/5.20.0
  /home/khw/blead/lib/perl5/site_perl/5.19.12
  /home/khw/blead/lib/perl5/site_perl/5.19.11
  /home/khw/blead/lib/perl5/site_perl/5.19.10
  /home/khw/blead/lib/perl5/site_perl
  .


Environment for perl 5.21.4​:
  HOME=/home/khw
  LANG=en_US.UTF-8
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)

PATH=/home/khw/bin​:/home/khw/perl5/perlbrew/bin​:/home/khw/print/bin​:/bin​:/usr/local/sbin​:/usr/local/bin​:/usr/sbin​:/usr/bin​:/sbin​:/usr/games​:/usr/local/games​:/home/khw/iands/www​:/home/khw/cxoffice/bin
  PERL5OPT=-w
  PERL_BADLANG (unset)
  PERL_POD_PEDANTIC=1
  SHELL=/bin/ksh

@p5pRT
Copy link
Author

p5pRT commented Sep 1, 2014

From @cpansprout

On Mon Sep 01 15​:24​:36 2014, public@​khwilliamson.com wrote​:

This is a bug report for perl from khw@​khw.(none),
generated with the help of perlbug 1.40 running under perl 5.21.4.

-----------------------------------------------------------------
The only warning raised by study_chunk in regcomp.c always says the
problem was at the end of the pattern, no matter where it actually
occurred. Thus for very large patterns, the warning can point to
someplace millions of bytes away from the actual problem location.

The reason is that the message uses the parse position pointer
RExC_parse, and by the time the message is raised, the whole pattern
has
been parsed, so of course it's going to point to the very end of the
pattern.

Confirmed​:

$ ./perl -Ilib -we '/(a|b)(?=a){3}aaaaaaaaaaaaaa/ if 0'
Quantifier unexpected on zero-length expression in regex; marked by <-- HERE in m/(a|b)(?=a){3}aaaaaaaaaaaaaa <-- HERE / at -e line 1.

The "solution" that occurs to me is simply to not bother to output a
position. No position is better than a wrong one. I don't see any
other way to do it that doesn't involve too much work.

I suggest you cite the source of the regexp, though, but without the HERE marker​:

Quantifier unexpected on zero-length expression in regex m/(a|b)(?=a){3}aaaaaaaaaaaaaa/ at -e line 1.

Or, we could have a bit of fun​:

Quantifier unexpected on zero-length expression in regex; not marked by <-- HERE in m/(a|b)(?=a){3}aaaaaaaaaaaaaa/ at -e line 1.

:-)

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Sep 1, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Sep 1, 2014

From @khwilliamson

On 09/01/2014 05​:06 PM, Father Chrysostomos via RT wrote​:

Or, we could have a bit of fun​:

Quantifier unexpected on zero-length expression in regex; not marked by <-- HERE in m/(a|b)(?=a){3}aaaaaaaaaaaaaa/ at -e line 1.

It would have to be

Quantifier unexpected on zero-length expression in regex; not
necessarily marked by <-- HERE in m/(a|b)(?=a){3}aaaaaaaaaaaaaa/ at -e
line 1.

@p5pRT
Copy link
Author

p5pRT commented Oct 22, 2014

From @cpansprout

On Mon Sep 01 16​:06​:54 2014, I wrote​:

Quantifier unexpected on zero-length expression in regex
m/(a|b)(?=a){3}aaaaaaaaaaaaaa/ at -e line 1.

Done in e1729dc.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Oct 22, 2014

@cpansprout - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2015

From @khwilliamson

Thanks for submitting this ticket

The issue should be resolved with the release today of Perl v5.22. If you find that the problem persists, feel free to reopen this ticket

--
Karl Williamson for the Perl 5 porters team

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2015

@khwilliamson - Status changed from 'pending release' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant