Well, I have wily and I am observing this bug all the time (starting
from a few months ago), or at least I was told that what I'm observing
was a duplicate of this bug.

What I see is that when I grep text files, randomly (but the same files will 
consistently produce the same results) text files are processed like binary 
files, meaning that the output is
  Binary file xxxx.txt matches 
rather than the line of text with the match.

Most of the times, text files that are incorrectly processed as binary
are ISO-8859-whatever encoded while files that are matched like text as
expected are utf8-encoded (my locale is utf8). However, I tried with two
files I created from scratch, one utf-8 and the other iso-8859, and I
couldn't reproduce the issue at will.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to grep in Ubuntu.
https://bugs.launchpad.net/bugs/1547466

Title:
  grep switches into binary mode while processing a text file

Status in grep package in Ubuntu:
  Fix Released
Status in grep source package in Xenial:
  In Progress
Status in grep source package in Yakkety:
  Fix Released
Status in grep package in Debian:
  Fix Released

Bug description:
  I noticed this staring to happen in Xenial about two days ago. When
  running sbuild (or now the buildd, too), the build breaks when trying
  to compile a generated file. I traced the problem down to grep
  suddenly acting weird. When not having any language set (or a non-UTF8
  mode) it will start printing some lines of a source file and then
  suddenly end that by printing "Binary file ... matches".

  With the attached file, the difference can be observed (running
  Xenial):

  LANG=C grep -v xxx grant_table.h

  and

  LANG=C.UTF-8 grep -v xxx grant_table.h

  SRU INFORMATION
  ===============
  Upstream fixes:
   - http://git.savannah.gnu.org/cgit/grep.git/commit/?id=d8a366218 (but 
depends on previous patches and is not sufficient by itself)
   - http://git.savannah.gnu.org/cgit/grep.git/commit/?id=d8a366218 (tests+doc)

  Test case:

  Call grep on a file or a string with non-ASCII characters in the C locale:
      $ echo 'héll☺ ≥x' | LC_ALL=C grep .
  In xenial this just shows "Binary file (standard input) matches", with the 
fix it should show the actual input string (with some garbled output of course 
as the UTF-8 chars cannot be displayed in C)

  Regression potential: grep is being used in tons of places; during
  xenial we had to fix/put a "use grep -a" workaround into a lot of
  packages to fix the fallout from grep 2.23 which introduced this. That
  said, as a result of "Binary file matches" does not give any more
  information than the actual string match, and scripts which get along
  with this answer most likely just check the exit code anyway (which
  does not change), the risk is bearable.

  We will soon do a test rebuild in yakkety with gcc-6 and grep 2.25,
  and will sift through the results to identify new FTBFS that are due
  to grep 2.25. This SRU should not be released until this happens.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grep/+bug/1547466/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to