GNU bug report logs - #22793
grep -E assertion failure with back references

Previous Next

Package: grep;

Reported by: santiagorr <at> riseup.net

Date: Wed, 24 Feb 2016 16:20:02 UTC

Severity: normal

Merged with 32806, 34238, 42946

To reply to this bug, email your comments to 22793 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#22793; Package grep. (Wed, 24 Feb 2016 16:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to santiagorr <at> riseup.net:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Wed, 24 Feb 2016 16:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: santiagorr <at> riseup.net
To: bug-grep <at> gnu.org
Subject: grep -E assertion failure with back references
Date: Wed, 24 Feb 2016 17:18:54 +0100
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

Regards,

Santiago




Information forwarded to bug-grep <at> gnu.org:
bug#22793; Package grep. (Wed, 24 Feb 2016 18:58:01 GMT) Full text and rfc822 format available.

Message #8 received at 22793 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: santiagorr <at> riseup.net
Cc: 22793 <at> debbugs.gnu.org
Subject: Re: bug#22793: grep -E assertion failure with back references
Date: Wed, 24 Feb 2016 10:56:38 -0800
forcemerge 21513 22793
thanks

On Wed, Feb 24, 2016 at 8:18 AM,  <santiagorr <at> riseup.net> 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




Forcibly Merged 21513 22793. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Wed, 24 Feb 2016 19:43:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-grep <at> gnu.org:
bug#22793; Package grep. (Wed, 24 Feb 2016 19:48:01 GMT) Full text and rfc822 format available.

Message #13 received at 22793 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Jim Meyering <jim <at> meyering.net>, santiagorr <at> riseup.net
Cc: 22793 <at> debbugs.gnu.org, 186568 <at> bugs.debian.org
Subject: Re: bug#22793: grep -E assertion failure with back references
Date: Wed, 24 Feb 2016 11:46:55 -0800
With recent 'grep' you can work around the problem by configuring 
--with-included-regex. That has some other undesirable properties, though.

This is really a glibc bug 
<https://sourceware.org/bugzilla/show_bug.cgi?id=18986> and the glibc 
patch could be applied to the Debian copy of glibc. Here's the patch:

http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=5513b40999149090987a0341c018d05d3eea1272

In other words, Debian bug #186568 is really a glibc bug, not a grep 
bug. Can you please fix the Debian bug report accordingly? I'll CC: this 
message there.




Information forwarded to bug-grep <at> gnu.org:
bug#22793; Package grep. (Thu, 25 Feb 2016 06:13:02 GMT) Full text and rfc822 format available.

Message #16 received at 22793 <at> debbugs.gnu.org (full text, mbox):

From: arnold <at> skeeve.com
To: santiagorr <at> riseup.net, jim <at> meyering.net, eggert <at> cs.ucla.edu
Cc: 22793 <at> debbugs.gnu.org, 186568 <at> bugs.debian.org
Subject: Re: bug#22793: grep -E assertion failure with back references
Date: Wed, 24 Feb 2016 23:12:10 -0700
Paul Eggert <eggert <at> cs.ucla.edu> wrote:

> With recent 'grep' you can work around the problem by configuring 
> --with-included-regex.

Not so. I did a fresh

	./boostrap
	./configure --with-included-regex
	make

and it still core dumps:

$ echo abc | ./src/grep -E  '(.*)(.*)(.*)\3\2\1'
grep: regexec.c:1413: pop_fail_stack: Assertion `((Idx) (num) < ((Idx) -2))' failed.
Aborted (core dumped)

I looked at it in a debugger fs->num before the --fs->num executes looks to
be -1.

Thanks,

Arnold




Disconnected #22793 from all other report(s). Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Thu, 25 Feb 2016 07:56:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-grep <at> gnu.org:
bug#22793; Package grep. (Thu, 25 Feb 2016 08:03:02 GMT) Full text and rfc822 format available.

Message #21 received at 22793 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: arnold <at> skeeve.com, santiagorr <at> riseup.net, jim <at> meyering.net
Cc: 22793 <at> debbugs.gnu.org, 186568 <at> bugs.debian.org, 21513 <at> debbugs.gnu.org
Subject: Re: bug#22793: grep -E assertion failure with back references
Date: Thu, 25 Feb 2016 00:01:52 -0800
arnold <at> skeeve.com wrote:
> Paul Eggert <eggert <at> cs.ucla.edu> wrote:
>
>> With recent 'grep' you can work around the problem by configuring
>> --with-included-regex.
>
> Not so. I did a fresh
>
> 	./boostrap
> 	./configure --with-included-regex
> 	make
>
> and it still core dumps:
>
> $ echo abc | ./src/grep -E  '(.*)(.*)(.*)\3\2\1'
> grep: regexec.c:1413: pop_fail_stack: Assertion `((Idx) (num) < ((Idx) -2))' failed.
> Aborted (core dumped)
>
> I looked at it in a debugger fs->num before the --fs->num executes looks to
> be -1.

Sorry, you're right. I got confused into thinking that grep Bug#22793 and grep 
Bug#21513 are the same bugs, but they're not. I have unmerged them.

This is still a glibc bug, not a grep bug; it's just that we don't have a fix.

grep Bug#21513 is indeed fixed by configuring --with-included-regex.




Information forwarded to bug-grep <at> gnu.org:
bug#22793; Package grep. (Tue, 17 Jan 2017 21:38:01 GMT) Full text and rfc822 format available.

Message #24 received at 22793 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: 22793 <at> debbugs.gnu.org
Cc: Paolo Bonzini <bonzini <at> gnu.org>, arnold <at> skeeve.com, santiagorr <at> riseup.net,
 Jim Meyering <jim <at> meyering.net>
Subject: Re: grep -E assertion failure with back references
Date: Tue, 17 Jan 2017 13:37:12 -0800
> This is still a glibc bug, not a grep bug; it's just that we don't have a fix.

I finally got around to finding the correct glibc bug report for this
grep bug. Here it is:

https://sourceware.org/bugzilla/show_bug.cgi?id=11053

I added a comment to the glibc bug, saying that it causes grep Bug#22793
<https://bugs.gnu.org/22793>.

Paolo Bonzini reported the glibc bug in 2009 and is the current
assignee. I think he's pretty busy doing other things. It'd be nice if
someone could fix the glibc bug (or at least, fix it in Gnulib), though
I suspect that any fix will not be trivial.





Merged 22793 32806. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sat, 22 Sep 2018 21:24:02 GMT) Full text and rfc822 format available.

Merged 22793 32806 34238. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Thu, 31 Jan 2019 03:23:02 GMT) Full text and rfc822 format available.

Merged 22793 32806 34238 42946. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Mon, 21 Sep 2020 19:52:02 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 188 days ago.

Previous Next


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