From owner-freebsd-bugs@FreeBSD.ORG Tue Oct 25 07:10:18 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6DABE16A420 for ; Tue, 25 Oct 2005 07:10:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0187D43D55 for ; Tue, 25 Oct 2005 07:10:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9P7AGup042815 for ; Tue, 25 Oct 2005 07:10:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j9P7AGsn042814; Tue, 25 Oct 2005 07:10:16 GMT (envelope-from gnats) Resent-Date: Tue, 25 Oct 2005 07:10:16 GMT Resent-Message-Id: <200510250710.j9P7AGsn042814@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Yar Tikhiy Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C95416A41F; Tue, 25 Oct 2005 07:06:38 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 276F643D48; Tue, 25 Oct 2005 07:06:36 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.3/8.13.3) with ESMTP id j9P76YP7072874; Tue, 25 Oct 2005 11:06:34 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.3/8.13.3/Submit) id j9P76Yke072873; Tue, 25 Oct 2005 11:06:34 +0400 (MSD) (envelope-from yar) Message-Id: <200510250706.j9P76Yke072873@comp.chem.msu.su> Date: Tue, 25 Oct 2005 11:06:34 +0400 (MSD) From: Yar Tikhiy To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: re@FreeBSD.org, tjr@FreeBSD.org Subject: gnu/87969: Regression in "fgrep -w" X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2005 07:10:18 -0000 >Number: 87969 >Category: gnu >Synopsis: Regression in "fgrep -w" >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 25 07:10:16 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Yar Tikhiy >Release: FreeBSD 7.0-CURRENT i386 >Organization: MSU >Environment: The problem found in CURRENT and RELENG_6, but not in RELENG_5 or RELENG_4. >Description: The manifestation of the problem is simple: "fgrep -w" fails to match the substring given although it is there and delimited by whitespace or other non-word characters (tested for '.'). This failure happened for all substrings tested. The problem is rather grave because grep is widely used to process system logs and its malfunction can lead to system events of high importance missed. The problem is specific to fgrep or "grep -F", and it doesn't seem to affect basic grep or "grep -E". "fgrep -w" appears to be broken in CURRENT and RELENG_6, but not in RELENG_5 despite the fact that all the 3 branches share the same version of grep. RELENG_4 isn't affected either. Hence the problem might have to do with the changes to grep that had come to HEAD before RELENG_6 was tagged. src/gnu/usr.bin/grep/search.c is the most probable suspect. >How-To-Repeat: CURRENT built yesterday: yar@behemoth:~$unset LANG LC_ALL LC_CTYPE yar@behemoth:~$grep --version grep (GNU grep) 2.5.1-FreeBSD Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. yar@behemoth:~$echo a b c | grep -Fw b yar@behemoth:~$echo a.b.c | grep -Fw b yar@behemoth:~$echo a b c | grep -w b a b c yar@behemoth:~$echo a b c | grep -Ew b a b c yar@behemoth:~$echo a b c | grep -F b a b c yar@behemoth:~$ RELENG_6 as of about RC1 time: yar@rt2:~$unset LANG LC_ALL LC_CTYPE yar@rt2:~$grep --version grep (GNU grep) 2.5.1-FreeBSD Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. yar@rt2:~$echo a b c | grep -Fw b yar@rt2:~$echo a.b.c | grep -Fw b yar@rt2:~$echo a b c | grep -w b a b c yar@rt2:~$echo a b c | grep -Ew b a b c yar@rt2:~$echo a b c | grep -F b a b c yar@rt2:~$ RELENG_5 (pretty old, as of the 23rd of May): yar@rt1:~$unset LANG LC_ALL LC_CTYPE yar@rt1:~$grep --version grep (GNU grep) 2.5.1-FreeBSD Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. yar@rt1:~$echo a b c | grep -Fw b a b c yar@rt1:~$echo a.b.c | grep -Fw b a.b.c yar@rt1:~$ RELENG_4 (freefall): -bash-2.05b$ echo a b c | grep -Fw b a b c -bash-2.05b$ echo a.b.c | grep -Fw b a.b.c -bash-2.05b$ >Fix: >Release-Note: >Audit-Trail: >Unformatted: