2 potentially 6.1 related questions

Alexander E. Patrakov patrakov at ums.usu.ru
Mon Apr 4 19:57:59 PDT 2005


Matthew Burgess wrote:

> Hi folks,
> 
> In both sets of grep's instructions we use the '--with-included-regex'
> to prevent grep from using potentially buggy regex code from glibc.
> Now, I can understand this in chapter 5 where the host's glibc can't be
> guaranteed to work.  However, in chapter 6 we have a known version of
> glibc.  The question is, does anyone know whether recent versions of
> glibc still have the buggy regex code, and how can we test/verify it (is
>   running grep's own testsuite enough to spot any problems)?

The testsuite passes in both cases (LFS 6.0), but that means absolutely 
nothing.

As you can see, the testsuite has one test commented out because it would take 
infinite time to finish with glibc regex (uclibc apparently doesn't have that 
bug -- but that information is not verified by me, just copied from Gentoo's 
ebuild).

In both cases, grep also suffers from the "-o and -i options together don't 
work" bug. Distros apply a patch against this bug, but they don't notice that 
the patch in fact doesn't help :( Testcase (fails even with the patch):

echo aABb | grep -o -i ab

One of the variants of this non-working patch is located at:

http://www.gentoo.org/cgi-bin/viewcvs.cgi/sys-apps/grep/files/grep-2.5.1-oi.patch.bz2?rev=1.1

BTW I think someone (maybe myself, but that would be slow) should investigate 
the way distros build grep. Gentoo applies just too many patches so one can't 
seriously consider the "grep" package trouble-free.

At least one patch has to be added (maybe post-6.1) for eliminating important 
UTF-8 bug:

http://www.gentoo.org/cgi-bin/viewcvs.cgi/*checkout*/sys-apps/grep/files/2.5.1-utf8-case.patch?rev=1.1

-- 
Alexander E. Patrakov



More information about the lfs-dev mailing list