I'm trying to grep for suppressions containing a certain library in a Valgrind log which is a couple of million lines long with PCREGrep.
I can get each suppression individually using pcregrep -M "{\n([^}]+\n)+}"
which produces individual entries like this:
{
<insert_a_suppression_name_here>
Memcheck:ReallocZero
fun:realloc
obj:/usr/lib/libnvidia-glcore.so.535.54.03
obj:/usr/lib/libGLX_nvidia.so.535.54.03
obj:/usr/lib/libGLX_nvidia.so.535.54.03
obj:/usr/lib/libGLX_nvidia.so.535.54.03
}
What I wanted to do was find all entries which reference nvidia
, so I tried {\n([^}]+\n)+.+nvidia.+\n([^}]+\n)+}
. This causes PCREGrep to produce output which looks like this:
pcregrep: pcre_exec() gave error -8 while matching text that starts:
{
<insert_a_suppression_name_here>
Memcheck:Value8
obj:/usr/lib/libnvidia-glcore.so.535.54.03
obj:/usr/lib/libnvidia-glcore.so.535.54.03
obj:/usr/lib/libnvidia-glcore.so.535.54.03
ob
as well as the terminating message
pcregrep: Too many errors - abandoned.
pcregrep: Error -8, -21 or -27 means that a resource limit was exceeded.
pcregrep: Check your regex for nested unlimited loops.
How can I format this regex in a way that doesn't cause this issue? Or if the issue is inherently present in my scenario, how can I increase whatever limit is being hit?