Subject: Re: bug#22793: grep -E assertion failure with back references

From: Jim Meyering <[email-masked]>
Date: Wed, 24 Feb 2016 10:56:38 -0800

forcemerge 21513 22793
thanks

On Wed, Feb 24, 2016 at 8:18 AM,  <[email-masked]> wrote:
> Hi,
>
> This is a long standing bug reported to Debian, still present in 2.23.
> It was forwarded at some point, but I cannot find any reference, so I'm
> reforwarding it.
>
> % echo abc | LANG=C grep -E '(.*)(.*)(.*)\3\2\1'
> grep: regexec.c:1401: pop_fail_stack: Assertion `num >= 0' failed.
>
> More info at: https://bugs.debian.org/186568

Correct, this was reported some time ago,
both here and in the upstream glibc bugzilla:

  http://bugs.gnu.org/21513
  https://sourceware.org/bugzilla/show_bug.cgi?id=18986

There is currently an "XFAIL" (expected-to-fail) test in grep's
test suite that exercises precisely this bug:

  git.savannah.gnu.org/cgit/grep.git/tree/tests/triple-backref