Summary: | fgrep(1) stalls when a file contains null character | ||
---|---|---|---|
Product: | Base System | Reporter: | y |
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | dt71, emaste, kevans, wosch |
Priority: | Normal | ||
Version: | 9.1-RELEASE | ||
Hardware: | Any | ||
OS: | Any |
Description
y
2013-07-30 07:50:00 UTC
Can't reproduce on 10.1-RELEASE. The only weirdness I see is the following: $ dd if=/dev/zero bs=1 count=1 2>/dev/null | bsdgrep -i . $ dd if=/dev/zero bs=1 count=1 2>/dev/null | bsdgrep . Binary file (standard input) matches It seems locale-dependent. stall: dd if=/dev/zero bs=1 count=1 | env LC_CTYPE=ja_JP.eucJP fgrep -i 1 not stall: dd if=/dev/zero bs=1 count=1 | env LC_CTYPE=ja_JP.UTF-8 fgrep -i 1 As mentioned, this is a locale-dependent bug, and one that exists solely in gnugrep -- not libgnuregex. Also, as of -HEAD, the inconsistent behavior dt71@gmx.com observes is no longer. This may be closed when bsdgrep is installed as /usr/bin/grep. For bugs matching the following conditions: - Status == In Progress - Assignee == "bugs@FreeBSD.org" - Last Modified Year <= 2017 Do - Set Status to "Open" A commit references this bug: Author: kevans Date: Tue Dec 8 14:05:26 UTC 2020 New revision: 368439 URL: https://svnweb.freebsd.org/changeset/base/368439 Log: src.opts.mk: switch to bsdgrep as /usr/bin/grep This has been years in the making, and we all knew it was bound to happen some day. Switch to the BSDL grep implementation now that it's been a little more thoroughly tested and theoretically supports all of the extensions that gnugrep in base had with our libregex(3). Folks shouldn't really notice much from this update; bsdgrep is slower than gnugrep, but this is currently the price to pay for fewer bugs. Those dissatisfied with the speed of grep and in need of a faster implementation should check out what textproc/ripgrep and textproc/the_silver_searcher can do for them. I have some WIP to make bsdgrep faster, but do not consider it a blocker when compared to the pros of switching now (aforementioned bugs, licensing). PR: 228798 (exp-run) PR: 128645, 156704, 166842, 166862, 180937, 193835, 201650 PR: 232565, 242308, 246000, 251081, 191086, 194397 Relnotes: yes, please Changes: head/share/mk/src.opts.mk |