[Bug 194823] New: "bsdgrep -E { /dev/null" core dumps

Andrey Chernov ache at freebsd.org
Thu Nov 6 00:19:02 UTC 2014


On 06.11.2014 3:04, Andrey Chernov wrote:
> On 06.11.2014 1:47, John D. Hendrickson wrote:
>>>            Summary: "bsdgrep -E { /dev/null" core dumps
>> your supposed to strive to use it correctly, not strive to find ways to
>> use it incorrectly
>>
>> how big and slow and complicated will all the binaries be if they must
>> stop and check for every possible mis-use ?
> 
> There is no misuse, just one of many bsdgrep bugs we already have. grep
> is able to search and autodetect binary files.
> 
Moreover, just single "{" is correct extended regexp. Compare with GNU
grep results and grep(1) manpage:

"GNU egrep attempts to support traditional usage by assuming that { is
not  special if it would be the start of an invalid interval specifica-
tion.  For example, the shell command egrep '{1' searches for the  two-
character  string {1 instead of reporting a syntax error in the regular
expression.  POSIX.2 allows this behavior as an extension, but portable
scripts should avoid it."

In normal case it should either follow GNU grep way (no output) or
produce error on wrong regexp, both ways are POSIX compatible but core
dump is not.

-- 
http://ache.vniz.net/


More information about the freebsd-bugs mailing list