GNU bug report logs - #19348
grep-2.21 cannot match patterns with NULLs in binary files

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: grep; Severity: wishlist; Reported by: Jaroslav Skarvada <jskarvad@HIDDEN>; dated Thu, 11 Dec 2014 15:32:01 UTC; Maintainer for grep is bug-grep@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 19348 <at> debbugs.gnu.org:


Received: (at 19348) by debbugs.gnu.org; 12 Dec 2014 05:24:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 12 00:24:50 2014
Received: from localhost ([127.0.0.1]:43442 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XzIif-0002Ll-Nc
	for submit <at> debbugs.gnu.org; Fri, 12 Dec 2014 00:24:49 -0500
Received: from smtp.cs.ucla.edu ([131.179.128.62]:44132)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eggert@HIDDEN>) id 1XzIic-0002LU-WF
 for 19348 <at> debbugs.gnu.org; Fri, 12 Dec 2014 00:24:48 -0500
Received: from localhost (localhost.localdomain [127.0.0.1])
 by smtp.cs.ucla.edu (Postfix) with ESMTP id BC6B7A60116;
 Thu, 11 Dec 2014 21:24:40 -0800 (PST)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
 by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 11p1LUCuUxJc; Thu, 11 Dec 2014 21:24:35 -0800 (PST)
Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net
 [71.177.17.123])
 by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 972B9A6001B;
 Thu, 11 Dec 2014 21:24:35 -0800 (PST)
Message-ID: <548A7C13.8020907@HIDDEN>
Date: Thu, 11 Dec 2014 21:24:35 -0800
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
 rv:31.0) Gecko/20100101 Thunderbird/31.3.0
MIME-Version: 1.0
To: Jaroslav Skarvada <jskarvad@HIDDEN>, 19348 <at> debbugs.gnu.org
Subject: Re: bug#19348: grep-2.21 cannot match patterns with NULLs in binary
 files
References: <1574360678.26672285.1418311884733.JavaMail.zimbra@HIDDEN>
In-Reply-To: <1574360678.26672285.1418311884733.JavaMail.zimbra@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 19348
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Jaroslav Skarvada wrote:

> This new behaviour is not documented in manual page

The full manual says "When matching binary data, grep may treat non-text bytes 
as line terminators."  See:

http://www.gnu.org/software/grep/manual/html_node/File-and-Directory-Selection.html

> [1]https://bugzilla.redhat.com/show_bug.cgi?id=1172405
> [2]https://bugzilla.redhat.com/show_bug.cgi?id=1172804

Those are both essentially the same bug, right?  And the symptoms are a wrong 
diagnostic but the application still works?  Anyway, I filed a bug report for 
that application here:

http://bugs.debian.org/772901

because a portable shell script cannot use 'grep' on binary data -- POSIX says 
the behavior is undefined.  It's not clear that GNU grep needs a new option to 
resurrect the 2.20 behavior, as the -a option suffices here just as well as any 
new option would, and -a is more portable.




Information forwarded to bug-grep@HIDDEN:
bug#19348; Package grep. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Dec 2014 15:32:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 11 10:32:00 2014
Received: from localhost ([127.0.0.1]:42893 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Xz5ih-00050u-SV
	for submit <at> debbugs.gnu.org; Thu, 11 Dec 2014 10:32:00 -0500
Received: from eggs.gnu.org ([208.118.235.92]:46014)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <jskarvad@HIDDEN>) id 1Xz5ig-00050i-9h
 for submit <at> debbugs.gnu.org; Thu, 11 Dec 2014 10:31:58 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jskarvad@HIDDEN>) id 1Xz5iS-00053F-0C
 for submit <at> debbugs.gnu.org; Thu, 11 Dec 2014 10:31:52 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:59020)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jskarvad@HIDDEN>) id 1Xz5iR-00053A-TR
 for submit <at> debbugs.gnu.org; Thu, 11 Dec 2014 10:31:43 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47702)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jskarvad@HIDDEN>) id 1Xz5iK-0005A2-DW
 for bug-grep@HIDDEN; Thu, 11 Dec 2014 10:31:43 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jskarvad@HIDDEN>) id 1Xz5iA-0004yr-QU
 for bug-grep@HIDDEN; Thu, 11 Dec 2014 10:31:36 -0500
Received: from mx6-phx2.redhat.com ([209.132.183.39]:42202)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jskarvad@HIDDEN>) id 1Xz5iA-0004yE-J6
 for bug-grep@HIDDEN; Thu, 11 Dec 2014 10:31:26 -0500
Received: from zmail14.collab.prod.int.phx2.redhat.com
 (zmail14.collab.prod.int.phx2.redhat.com [10.5.83.16])
 by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBBFVOuk014511
 for <bug-grep@HIDDEN>; Thu, 11 Dec 2014 10:31:25 -0500
Date: Thu, 11 Dec 2014 10:31:24 -0500 (EST)
From: Jaroslav Skarvada <jskarvad@HIDDEN>
To: bug-grep@HIDDEN
Message-ID: <1574360678.26672285.1418311884733.JavaMail.zimbra@HIDDEN>
In-Reply-To: <880775541.26663752.1418311351721.JavaMail.zimbra@HIDDEN>
Subject: grep-2.21 cannot match patterns with NULLs in binary files
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Originating-IP: [10.5.82.6]
X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF34 (Linux)/8.0.6_GA_5922)
Thread-Topic: grep-2.21 cannot match patterns with NULLs in binary files
Thread-Index: yKykKu01AzEnOHCB8yXCuM4Zg7EK7A==
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

Hi,

commit 8cc20c82a747460991305b0d8d72faf6830298f4,
"grep: non-text bytes in binary data may be treated as line ends"

added optimization that NULLs are treated as line ends. This is
change of behaviour that may break other tools. Currently I know
about [1], [2]. This new behaviour is not documented in manual page,
it is only briefly mentioned in the NEWS file.

I also think that the old behaviour is useful, so command line switch
for this would be probably handy

thanks & regards

Jaroslav

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1172405
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1172804




Acknowledgement sent to Jaroslav Skarvada <jskarvad@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-grep@HIDDEN. Full text available.
Report forwarded to bug-grep@HIDDEN:
bug#19348; Package grep. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.