Subject: bug#19567: closed (Re: bug#19567: "segmentation fault" for long patterns ...)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 11 Jan 2015 17:26:03 +0000

Your bug report

#19567: "segmentation fault" for long patterns ...

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
19567: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19567
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#19567: "segmentation fault" for long patterns ...
From: Jim Meyering <[email-masked]>
To: Roméo Capulet <[email-masked]>
Cc: [email-masked]
Date: Sun, 11 Jan 2015 09:25:00 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

On Sun, Jan 11, 2015 at 8:28 AM, Roméo Capulet <[email-masked]> wrote:
> I got a segmentation fault when I try to match a very long pattern on a
> file:
> $ grep -Po 'jQuery\.extend\(Drupal\.settings,[ \t]*\{((?!\}\}\)).)+\}\}\);'
> /tmp/pattern-exemple.txt
> Erreur de segmentation
>
> the grep version : grep (GNU grep) 2.16

Thank you for the complete bug report.
That appears to be due to a bug in the version of libpcre that your
version of grep uses.
Using the latest release, grep-2.21 with newer pcre, that example no
longer causes trouble.

Since this issue appears not to affect the latest version, I'm marking
this ticket as "done".

Subject: "segmentation fault" for long patterns ...
From: Roméo Capulet <[email-masked]>
To: [email-masked]
Date: Sun, 11 Jan 2015 17:28:37 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

hi

I got a segmentation fault when I try to match a very long pattern on a 
file:
$ grep -Po 'jQuery\.extend\(Drupal\.settings,[ 
\t]*\{((?!\}\}\)).)+\}\}\);' /tmp/pattern-exemple.txt
Erreur de segmentation

the grep version : grep (GNU grep) 2.16

the gdb backtrace:
#0  0xb7f7d01a in ?? () from /lib/i386-linux-gnu/libpcre.so.3
#1  0xb7f8b090 in ?? () from /lib/i386-linux-gnu/libpcre.so.3
#2  0xb7f8b3e3 in ?? () from /lib/i386-linux-gnu/libpcre.so.3
#3  0xb7f8b090 in ?? () from /lib/i386-linux-gnu/libpcre.so.3
#4  0xb7f8b3e3 in ?? () from /lib/i386-linux-gnu/libpcre.so.3
(...)
#13099 0xb7f8b090 in ?? () from /lib/i386-linux-gnu/libpcre.so.3
#13100 0xb7f88ab3 in ?? () from /lib/i386-linux-gnu/libpcre.so.3
#13101 0xb7f8e9f3 in pcre_exec () from /lib/i386-linux-gnu/libpcre.so.3
#13102 0x0804c8a2 in ?? ()
#13103 0x0804e191 in ?? ()
#13104 0x0804f3de in ?? ()
#13105 0x0804a630 in ?? ()
#13106 0xb7dc7905 in __libc_start_main (main=0x804a150, argc=4, 
ubp_av=0xbffff8a4, init=0x806bfd0, fini=0x806c040, rtld_fini=0xb7fed5f0 
<_dl_fini>, stack_end=0xbffff89c) at libc-start.c:260
#13107 0x0804b16d in ?? ()