From owner-freebsd-bugs@FreeBSD.ORG Thu Nov 6 00:19:02 2014 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D8C4EF1 for ; Thu, 6 Nov 2014 00:19:02 +0000 (UTC) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1362DEDB for ; Thu, 6 Nov 2014 00:19:01 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id l4so16681lbv.24 for ; Wed, 05 Nov 2014 16:18:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=yd+ZO/vJwFrKwlFD5/8+4ulJ9R1j9WATdnTdXYs187s=; b=N2Ah5oRPln95vZ6OJedJUtRFORh0IEeI6szNv+eJzq3dyZ6NCj/TLZbnEdN2AkJtlG +PJQH8youOEhyS9D0mNbYNftNZvJITUyx1l/suBIxbbX4CaSCvk4+2Ru46fXMjsMCbJm bODcl5n59FIbP94roEV4ffcN001m6UHDAzqigekExbfZCxZMJ3x/ELsNBUgLdfTl45CD 2OkUIbiERWeqm+o0zsK98Wu0L9p/LZFqzQvGKcuqIlFowcjrDgFA9+5MGiDlRo6wUCof 47md7jE8Yeghpre1/ra+lkLLzonYLkMcMlKsdEtxQNr/+Th6gGg3Ke4QAEj8ZbAKv0vo 3svg== X-Gm-Message-State: ALoCoQnGaNYTkNsFH+CQmMaTHfvMRFz2H7AxKYtjogSsScu7SCwdAg5XKAQbC2vQDBIFqhcrqxJQ X-Received: by 10.112.77.74 with SMTP id q10mr819276lbw.66.1415232838516; Wed, 05 Nov 2014 16:13:58 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id qk3sm1880427lbb.19.2014.11.05.16.13.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Nov 2014 16:13:57 -0800 (PST) Message-ID: <545ABD37.302@freebsd.org> Date: Thu, 06 Nov 2014 03:13:43 +0300 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: "John D. Hendrickson" , bugzilla-noreply@freebsd.org Subject: Re: [Bug 194823] New: "bsdgrep -E { /dev/null" core dumps References: <545AA906.3070107@cox.net> <545ABAFC.1000807@freebsd.org> In-Reply-To: <545ABAFC.1000807@freebsd.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Cc: freebsd-bugs@FreeBSD.org X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 00:19:02 -0000 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/