From nobody Fri Sep 27 09:17:27 2024 X-Original-To: standards@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XFPxg39Hjz5XlHj for ; Fri, 27 Sep 2024 09:17:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XFPxg1HvDz4Qx7 for ; Fri, 27 Sep 2024 09:17:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727428647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZyGJNS3YVh1lvQIX6fTiiKjJshFzMw7jxlfepkHul3Q=; b=MGULLnB8XsIEriN0SV+NW/BxtBoIfQKnkvmUuq9NT1jXoYgLV8D72IJPjpGKJFdoaq23F5 +W7boRUGeYlT51xfMpDaeOXnyzxINunloOPyCk8PZ8AR/DyCQFrqsLTuG92CAcQH3Mt15c BILkrjF5NVc0+wdhKtK+CfWS/deP/mdMo0WOSTp4iT2V2b5+Tebb71AyvQflfmr6yuJJXP Pt0AcmWikeqQSDMX0ntIct8SNp1v0qNlVO660smnGPZZXK4VG6pwHV/GVaxVKU4iOLZ0cP JolWWIK6kzlnE3nQG5t+lNrCr3VchUSDeC1CEwZhITbaddyDQYMLqqNQpzeHrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727428647; a=rsa-sha256; cv=none; b=bzJSs0Gv7uXU9+ZRuXJL8Rj96TMsLDqNRd4unsIU3pUW5Npv6HWfRerY2bHVx7bweDMiAH Ax/2pS+zmkeDBwPkQWHGImEM77XUJBpBmYfUN3rSBBhW3lQ+V11wRpIrItlTm98orkPka3 jKrh3yWrA6NaK0Hla3SbPqifJ66pPsOb+XYQst9Wr0rOS2LgW55RSeqWLTpUcFt/5sNCu3 q9q+zjXKxDheHBZnZYOzAigt784W2ynJ767b0+NhSIU4ezxTXuYWWLsbcQD78+Edfytf+8 pFXd9oI1Q6ZvfMNyWgpJUyf5g5xJSkMuF79C6FFHjOtrRAPQ1CsyW0IV7xdjIw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XFPxg0vgKzZmV for ; Fri, 27 Sep 2024 09:17:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 48R9HQu0030710 for ; Fri, 27 Sep 2024 09:17:26 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 48R9HQkk030709 for standards@FreeBSD.org; Fri, 27 Sep 2024 09:17:26 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: standards@FreeBSD.org Subject: [Bug 281710] RegEXP bug in bracket expression [^...] - sed(1), grep(1), re_format(7) Date: Fri, 27 Sep 2024 09:17:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: standards X-Bugzilla-Version: 14.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: erichanskrs@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: kevans@freebsd.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Standards compliance List-Archive: https://lists.freebsd.org/archives/freebsd-standards List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-standards@freebsd.org Sender: owner-freebsd-standards@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D281710 --- Comment #13 from Eric --- (in reply to Kyle Evans comment #10) (in reply to Olivier Certner comment #12) Based on the commit comments=20 https://cgit.freebsd.org/src/commit/?id=3D8f7ed58a15556bf567ff876e1999e4fe4= d684e1d however, I see that I may have underestimated the possible veracious impact= on string processing in a pervasive UTF-8 world. I haven't a test setup available at the moment to test the examples below on -CURRENT or -STABLE-13 or 14 -- Examples [1] # cat names cedric =C3=A9tienne =C3=A9gards fran=C3=A7ois [2] # cat names | grep '[=C3=A9]' =C3=A9tienne =C3=A9gards [3] # cat names | grep '[=C3=A9=C3=A7]' =C3=A9tienne =C3=A9gards fran=C3=A7ois [4] # cat names | grep '[=C3=A9i]' # <-- error cedric =C3=A9tienne fran=C3=A7ois [5] # cat names | grep -i '[=C3=A9i]' # <-- case-insensitive "avoids" sin= gleton=20 cedric =C3=A9tienne =C3=A9gards fran=C3=A7ois [6] # cat names | grep -E '[=C3=A9]|[i]' # <-- splitting in two bracket exp= ressions avoids errroneous code cedric =C3=A9tienne =C3=A9gards fran=C3=A7ois [7] # I think such cases likely will have been overlooked, misjudged as correctly processed or not investigated further. Fast & correct (UTF-8) string processing is difficult and this made me have another look at singleton's char processing.=20 Viewing from a distance (and assuming one test operation (the first only) in the string of "shortcut" ||-operands), the distance to the prize (i.e. line 1626) in https://github.com/freebsd/freebsd-src/blob/main/lib/libc/regex/regcomp.c#L= 1626=20 as compared to https://github.com/freebsd/freebsd-src/blob/releng/14.1/lib/libc/regex/regc= omp.c#L1600 has gone up considerably: singleton-error: 2 tests singleton-modified: 6 tests Are the added complexity and extra processing steps of an added singleton function for a bracket expression still justified? Case-insensitive bracket expressions don't profit, as can be painfully obse= rved in the examples above; they just add a certain small amount of additional t= ime. I wonder if comparitive testing with singleton processing versus without it yields justifiable gains=E2=80=94yes, that is a subjective adjective. --=20 You are receiving this mail because: You are on the CC list for the bug.=