GNU bug report logs - #19833
grep: internal PCRE error: -27 since updating from 2.16 to 2.21

Previous Next

Package: grep;

Reported by: Oliver Freyermuth <o.freyermuth <at> googlemail.com>

Date: Tue, 10 Feb 2015 22:15:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#19833: closed (grep: internal PCRE error: -27 since updating
 from 2.16 to 2.21)
Date: Wed, 11 Feb 2015 07:50:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 10 Feb 2015 23:49:17 -0800
with message-id <54DB097D.5060406 <at> cs.ucla.edu>
and subject line Re: bug#19833: grep: internal PCRE error: -27 since updating from 2.16 to 2.21
has caused the debbugs.gnu.org bug report #19833,
regarding grep: internal PCRE error: -27 since updating from 2.16 to 2.21
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
19833: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19833
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Oliver Freyermuth <o.freyermuth <at> googlemail.com>
To: bug-grep <at> gnu.org
Subject: grep: internal PCRE error: -27 since updating from 2.16 to 2.21
Date: Tue, 10 Feb 2015 22:59:38 +0100
[Message part 3 (text/plain, inline)]
Dear grep'pers,

since I updated from 2.16 to 2.21, several of my "check list of files
for bad filenames"-style grep expressions fail like this:
grep: internal PCRE error: -27
(one of the failing examples follows at the end of the mail, example
filename-list attached)

Researching this, I found that -27 is PCRE_ERROR_JIT_STACKLIMIT.
Apparently I exceed the 512 K JIT-stack-limit which is hardcoded in grep
with several of my regexps.

As using the JIT can not be turned off at runtime, nor can the stacksize
be controlled without patching + recompiling, this breaks previously
working expressions for me, so I consider this a new regression,
introduced with b06f7a29a58bbdd5866afc1e92dba3fdc9e2ed59 .

I tested that increasing the stack-size to 1 M fixes the problem for me.
A better fix could maybe consist of a better error message, allowing
stack-size control at runtime and / or making JIT optional at runtime.


Reproducer, using the attached file (which is generated by a find
command, of course - only 637 files with absolute paths in plain ASCII):
$ LANG=C grep -P -n '^([/](?!/)|[^/])*~/.*' pcrejit.txt
grep: internal PCRE error: -27


Cheers,
	Oliver
[pcrejit.txt (text/plain, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Oliver Freyermuth <o.freyermuth <at> googlemail.com>, 
 19833-done <at> debbugs.gnu.org
Subject: Re: bug#19833: grep: internal PCRE error: -27 since updating from
 2.16 to 2.21
Date: Tue, 10 Feb 2015 23:49:17 -0800
[Message part 6 (text/plain, inline)]
Thanks for the bug report and test case.  I installed the attached patch, which 
fixed the bug for me, and which adds a similar test case to the test database.
[0001-Grow-the-JIT-stack-if-it-becomes-exhausted.patch (text/x-patch, attachment)]

This bug report was last modified 10 years and 156 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.