Subject: bug#16499: closed (Re: GNU grep-2.16-1.mga4 , grep-2.16 from sources and grep from git master HEAD get stuck during an LC_ALL=en_US.UTF-8 search inside a short binary file)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 21 Jan 2014 23:57:03 +0000

Your bug report

#16499: GNU grep-2.16-1.mga4 , grep-2.16 from sources and grep from git master HEAD get stuck during an LC_ALL=en_US.UTF-8 search inside a short binary file

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].

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

Subject: Re: GNU grep-2.16-1.mga4 , grep-2.16 from sources and grep from git master HEAD get stuck during an LC_ALL=en_US.UTF-8 search inside a short binary file
From: Jim Meyering <[email-masked]>
To: Shlomi Fish <[email-masked]>
Cc: Paolo Bonzini <[email-masked]>, shlomif <[email-masked]>, [email-masked]
Date: Tue, 21 Jan 2014 15:56:21 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

tags 16499 notabug
close 16499
thanks

Thank you for investigating.  I agree that it sure looks like the bug
is in libpcre, and not in grep itself.  If you haven't already
reported it to libpcre developers, would you please do that?

Subject: GNU grep-2.16-1.mga4 , grep-2.16 from sources and grep from git master HEAD get stuck during an LC_ALL=en_US.UTF-8 search inside a short binary file
From: Shlomi Fish <[email-masked]>
To: [email-masked]
Date: Sun, 19 Jan 2014 17:10:11 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi all,

after I save the attached file as 1.dat , I see that grep -iP on '^Subject:'
or on '^S' gets stuck in the en_US.UTF-8 locale. It is fine in pcregrep and in
ack.

[SHELL]
shlomif@telaviv1:~$ time LC_ALL=en_US.UTF-8
~/apps/TEST-grep-from-git-TO-DEL/bin/grep -iP '^Subject:' < 1.dat ^C

real    0m4.199s
user    0m4.195s
sys     0m0.003s
shlomif@telaviv1:~$ time LC_ALL=en_US.UTF-8
~/apps/TEST-grep-from-git-TO-DEL/bin/grep -iP '^S' < 1.dat ^C

real    0m3.486s
user    0m3.485s
sys     0m0.001s
shlomif@telaviv1:~$ time LC_ALL=en_US.UTF-8
~/apps/TEST-grep-from-git-TO-DEL/bin/grep -iE '^S' < 1.dat

real    0m0.002s
user    0m0.002s
sys     0m0.000s
shlomif@telaviv1:~$ time LC_ALL=en_US.UTF-8
~/apps/TEST-grep-from-git-TO-DEL/bin/grep -P '^S' < 1.dat ^C

real    0m1.887s
user    0m1.885s
sys     0m0.000s
shlomif@telaviv1:~$ time LC_ALL=en_US.UTF-8
~/apps/TEST-grep-from-git-TO-DEL/bin/grep -P '^Subject:' < 1.dat

real    0m0.003s
user    0m0.000s
sys     0m0.002s
shlomif@telaviv1:~$ time LC_ALL=en_US.UTF-8
~/apps/TEST-grep-from-git-TO-DEL/bin/grep -P '^Subject:' < 1.dat time LC_ALL=C
~/apps/TEST-grep-from-git-TO-DEL/bin/grep -iP '^Subject:' < 1.dat

real    0m0.003s
user    0m0.001s
sys     0m0.001s
shlomif@telaviv1:~$ time LC_ALL=C pcregrep -i '^Subject:' < 1.dat

real    0m0.002s
user    0m0.001s
sys     0m0.000s
shlomif@telaviv1:~$ time LC_ALL=C ack -i '^Subject:' 1.dat

real    0m0.066s
user    0m0.059s
sys     0m0.007s
shlomif@telaviv1:~$ time LC_ALL=en_US.UTF-8 ack -i '^Subject:' 1.dat

real    0m0.070s
user    0m0.063s
sys     0m0.006s
[/SHELL]

The same thing happens with grep-2.16 built from the sources. I'm on Mageia
Linux x86-64 Cauldron (what will be Mageia 4). 

shlomif@telaviv1:~$ ldd ~/apps/TEST-grep-from-git-TO-DEL/bin/grep 
        linux-vdso.so.1 (0x00007fff2a7fe000)
        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f19ed302000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f19ecf4d000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f19ecd30000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f19ed568000)
shlomif@telaviv1:~$ rpm -qf /lib64/libpcre.so.1
lib64pcre1-8.33-2.mga4

Regards,

	Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Humanity - Parody of Modern Life - http://shlom.in/humanity

Linux — Because Software Problems Should not Cost Money.

Please reply to list if it's a mailing list post - http://shlom.in/reply .