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