From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=0.4 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 6B22D1F670 for ; Thu, 17 Feb 2022 22:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229527AbiBQW5K (ORCPT ); Thu, 17 Feb 2022 17:57:10 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:57556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbiBQW5J (ORCPT ); Thu, 17 Feb 2022 17:57:09 -0500 Received: from pb-smtp2.pobox.com (pb-smtp2.pobox.com [64.147.108.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04A08D5DC5 for ; Thu, 17 Feb 2022 14:56:53 -0800 (PST) Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id C22BC10452D; Thu, 17 Feb 2022 17:56:52 -0500 (EST) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=OjFtrC0x1pef LcKCABVDsVg9L7vMCd/sFH6qSdCPv8c=; b=WFMcj1uu5SEtytPl87AcQiU+ZKT/ hQgTEzUMv5uMmUlJ4Aw/WDH0DGuvtbqz5PzJqYaS3YIVEsie5P7NseunubXXaf3V 4koLZ9y+MDgT0yYdf3mOyW0mgzHeNTZtFaNlPG3b0BGgKpL/ZExzPZQdyiSS2te9 485pc2BM6eFYXmk= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id BA43A10452C; Thu, 17 Feb 2022 17:56:52 -0500 (EST) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.82.80.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 209A3104528; Thu, 17 Feb 2022 17:56:52 -0500 (EST) (envelope-from junio@pobox.com) From: Junio C Hamano To: =?utf-8?Q?Ren=C3=A9?= Scharfe Cc: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason , SZEDER =?utf-8?Q?G=C3=A1bor?= , Git List , Hamza Mahfooz , Carlo Marcelo Arenas =?utf-8?Q?Bel=C3=B3n?= , Andreas Schwab Subject: Re: [v2.35.0 regression] some PCRE hangs under UTF-8 locale References: <5fa6962e-3c1c-6dbc-f6d7-589151a9baec@web.de> <20220129172542.GB2581@szeder.dev> <20220130090422.GA4769@szeder.dev> <220131.868ruvbovo.gmgdl@evledraar.gmail.com> <1425e548-c1bb-3cff-d75d-c3760abb6129@web.de> <220212.86zgmvx13i.gmgdl@evledraar.gmail.com> <4e391e2e-6561-3c2e-0306-c860a37356bc@web.de> Date: Thu, 17 Feb 2022 14:56:50 -0800 In-Reply-To: <4e391e2e-6561-3c2e-0306-c860a37356bc@web.de> (=?utf-8?Q?=22R?= =?utf-8?Q?en=C3=A9?= Scharfe"'s message of "Thu, 17 Feb 2022 22:14:29 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: E5578CB4-9044-11EC-B683-CB998F0A682E-77302942!pb-smtp2.pobox.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Ren=C3=A9 Scharfe writes: > Subject: [PATCH] grep: fix triggering PCRE2_NO_START_OPTIMIZE workaroun= d > > PCRE2 bug 2642 was fixed in version 10.36. Our 95ca1f987e (grep/pcre2: > better support invalid UTF-8 haystacks, 2021-01-24) worked around it on > older versions by setting the flag PCRE2_NO_START_OPTIMIZE. 797c359978 > (grep/pcre2: use compile-time PCREv2 version test, 2021-02-18) switched > it around to set the flag on 10.36 and higher instead, while it claimed > to use "the same test done at compile-time". > > Switch the condition back to apply the workaround on PCRE2 versions > _before_ 10.36. > > Signed-off-by: Ren=C3=A9 Scharfe > --- > grep.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/grep.c b/grep.c > index 5bec7fd793..ef34d764f9 100644 > --- a/grep.c > +++ b/grep.c > @@ -386,7 +386,7 @@ static void compile_pcre2_pattern(struct grep_pat *= p, const struct grep_opt *opt > if (!opt->ignore_locale && is_utf8_locale() && !literal) > options |=3D (PCRE2_UTF | PCRE2_MATCH_INVALID_UTF); > > -#ifdef GIT_PCRE2_VERSION_10_36_OR_HIGHER > +#ifndef GIT_PCRE2_VERSION_10_36_OR_HIGHER > /* Work around https://bugs.exim.org/show_bug.cgi?id=3D2642 fixed in = 10.36 */ Oh, that's embarrassing. The #ifdef and the comment sit next to each other and they make contradicting statement. > if (PCRE2_MATCH_INVALID_UTF && options & (PCRE2_UTF | PCRE2_CASELESS)= ) > options |=3D PCRE2_NO_START_OPTIMIZE; > -- > 2.35.1