metacpan / metacpan-grep-front-end

Grep Front end code
GNU General Public License v3.0
13 stars 12 forks source link

Search says 2 distributions match, but nothing is listed #62

Open neilb opened 2 years ago

neilb commented 2 years ago

If I run the following search:

=.*qr.*=.*qr.*=.*qr

I'm told:

Result: found 2 distributions and 3 files matching your query ! ( run in 1.109 ) 

But then no distributions or files are listed.

toddr commented 2 years ago
$>git grep -P '=.*qr.*=.*qr.*=.*qr'
Binary file A/ASP4x-Captcha-Imager/t/etc/LiberationSans-Regular.ttf matches
A/Ado/etc/plugins/routes.conf:            params => {controller => qr/[\w-]{3,}/, action => qr/\w{3,}/, id => qr/\d+/},
fatal: pcre_exec failed with error code -8
toddr commented 2 years ago
$>git grep -P '=.*qr.*=.*qr.*=.*qr' distros/A/Alien-Web-ExtJS-V3/share/docs/extjs/ext-all.js
fatal: pcre_exec failed with error code -8
toddr commented 2 years ago
$>egrep -l '=.*qr.*=.*qr.*=.*qr' distros/A/Alien-Web-ExtJS-V3/share/docs/extjs/ext-all.js
distros/A/Alien-Web-ExtJS-V3/share/docs/extjs/ext-all.js
toddr commented 2 years ago

If I add that file to perl, I get:

$>git grep -P '=.*qr.*=.*qr.*=.*qr' 
cpan/Math-Complex/lib/Math/Complex.pm:  sqrt([x,pi]) = sqrt(x) * exp(i*pi/2) = [sqrt(x),pi/2] = sqrt(x)*i
fatal: pcre2_jit_match failed with error code -47: match limit exceeded
toddr commented 2 years ago

Just adding this single file to a lone repo gives me this.

$>time git grep -l -P '=.*qr.*=.*qr.*=.*qr' 
fatal: pcre2_jit_match failed with error code -47: match limit exceeded
git grep -l -P '=.*qr.*=.*qr.*=.*qr'  19.92s user 0.01s system 99% cpu 19.942 total
toddr commented 2 years ago
$>ls -ld distros/A/Alien-Web-ExtJS-V3/share/docs/extjs/ext-all.js                           
-rw-r--r--. 1 root root 1292594 Dec  6  2014 distros/A/Alien-Web-ExtJS-V3/share/docs/extjs/ext-all.js
toddr commented 2 years ago

This takes 4 minutes to run but passes in 5.32.

$>perl -MFile::Slurper=read_text -E'my $f = read_text("ext-all.js"); $f =~ m{=.*qr.*=.*qr.*=.*qr}; say "ok"'
ok
toddr commented 2 years ago

@neilb this runs rather zippily on ubuntu 20.04. What version of grep/pcre is this running on?

ubuntu 20.04$>time git grep -l -P '=.*qr.*=.*qr.*=' 
ext-all.js
git grep -l -P '=.*qr.*=.*qr.*='  11.39s user 0.04s system 100% cpu 11.424 total
ii  libpcre16-3:amd64                                                2:8.39-12build1                                                      amd64        Old Perl 5 Compatible Regular Expression Library - 16 bit runtime files
ii  libpcre2-16-0:amd64                                              10.34-7                                                              amd64        New Perl Compatible Regular Expression Library - 16 bit runtime files
ii  libpcre2-32-0:amd64                                              10.34-7                                                              amd64        New Perl Compatible Regular Expression Library - 32 bit runtime files
ii  libpcre2-8-0:amd64                                               10.34-7                                                              amd64        New Perl Compatible Regular Expression Library- 8 bit runtime files
ii  libpcre2-dev:amd64                                               10.34-7                                                              amd64        New Perl Compatible Regular Expression Library - development files
ii  libpcre2-posix2:amd64                                            10.34-7                                                              amd64        New Perl Compatible Regular Expression Library - posix-compatible runtime files
ii  libpcre3:amd64                                                   2:8.39-12build1                                                      amd64        Old Perl 5 Compatible Regular Expression Library - runtime files
ii  libpcre3-dev:amd64                                               2:8.39-12build1                                                      amd64        Old Perl 5 Compatible Regular Expression Library - development files
ii  libpcre32-3:amd64                                                2:8.39-12build1                                                      amd64        Old Perl 5 Compatible Regular Expression Library - 32 bit runtime files
ii  libpcrecpp0v5:amd64                                              2:8.39-12build1                                                      amd64        Old Perl 5 Compatible Regular Expression Library - C++ runtime files
ii  pcre2-utils                                                      10.34-7                                                              amd64        New Perl Compatible Regular Expression Library - utilities
ii  git                                                              1:2.25.1-1ubuntu3.2                                                  amd64        fast, scalable, distributed revision control system
toddr commented 2 years ago

Actually the version on the server seems to be up to date, so the fact this worked on my server may be a memory issue. I've got more memory on my server.

toddr commented 2 years ago

Thanks for the reports. We'll be looking at this closer at TPRC.