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: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 942501F8C6 for ; Wed, 14 Jul 2021 15:22:38 +0000 (UTC) Received: from localhost ([::1]:35824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3gib-0007JY-9w for normalperson@yhbt.net; Wed, 14 Jul 2021 11:22:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3fIG-00040z-Ar for bug-gnulib@gnu.org; Wed, 14 Jul 2021 09:51:20 -0400 Received: from mail-yb1-xb2b.google.com ([2607:f8b0:4864:20::b2b]:39880) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3fIE-0002KB-Eg for bug-gnulib@gnu.org; Wed, 14 Jul 2021 09:51:19 -0400 Received: by mail-yb1-xb2b.google.com with SMTP id x192so3271876ybe.6 for ; Wed, 14 Jul 2021 06:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=gE0sO60ST4zjZMlrnizL72N9Kwn4fmtVPQOEAlVRMYA=; b=IpyxiSw9qngVT3NOwk6dkyxoQGGwzRKnjhgHjgirTbXQDaFDWDJ6lbFJMbTwr0eCXf dlNBk9e5ynYHXezo5mqjfp59x1sLJDaIAvxptLCR/9k8283yubmGs5GKY9DJ8bnyXcdv LFNiLL6NZ+Mbo5UKoRQNZcj4zu4cwT1Yg160J/H4/XSzWz8FuAuasm8RXW8z0ML25GHx RxRLSSh9Y41VAsYm6bpSJzTII/zMmqV6LorrK1xddzBA0mO6gOMhrG3NRcdHS/eQyQuW IbthZl3YGHBH8gBTr0ONSBFQ1FgjjWG+I1QJ0mIBiQZx3EYmUi98ud4rocwdbRR0oHJR BdSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=gE0sO60ST4zjZMlrnizL72N9Kwn4fmtVPQOEAlVRMYA=; b=KZ04kM34aWoRL5CiNxGN3GUpJueutuhb1G96GGQlL/1BePO/SOdq9FvXclSBJqEUaP mr1a8P/w3VoIyT7AknGvWeWKILGZNZPNhkKI5CcNE2HqkCYpsRPlGNEhEbJsbz2dx9im hNl8GeAsxp0k3Nh3E+G2cuh5ucCcC5PbHdMEFUIv3ygubLgEGDszFdYJy7Ij2DxbHvtx 3OCM44Y+Xl++8xQEy0tyRtqUxOMeZdyF7/9SqNXx1G/lPG+EUnLWLbUV1ilbqO3u8k5W Uqr+BypvI3HSy5PdLevtaWpMnqsZolnLfPEWh654/ioTh4kT5MQPCznG/aqjtkROygQo M9tQ== X-Gm-Message-State: AOAM532f69xrvkf0Ll5y2d/CE2Kzc/526x2Zs1QFNmZdbKrFbT0WPBfr SlcJn996Tt3iuZXrWLPoMQmwr0tXQvhW7v0lcEpQ/KxhVRE= X-Google-Smtp-Source: ABdhPJxyXLu1pWJcTlohJaz0oHAxW/7uQ1JO1H9M0w24mSG1CLTg6uboRqMD0Xv+O+RqWPfYJPhczaGfRbrcrqhdqlU= X-Received: by 2002:a25:8208:: with SMTP id q8mr14009387ybk.378.1626270675701; Wed, 14 Jul 2021 06:51:15 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?5p6X5a6P6ZuE?= Date: Wed, 14 Jul 2021 22:51:05 +0900 Message-ID: Subject: regex.m4 fails in all glibc To: bug-gnulib@gnu.org Content-Type: multipart/alternative; boundary="000000000000ef117c05c715a5e6" Received-SPF: pass client-ip=2607:f8b0:4864:20::b2b; envelope-from=hirooih@gmail.com; helo=mail-yb1-xb2b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 14 Jul 2021 11:19:22 -0400 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jim Meyering Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" --000000000000ef117c05c715a5e6 Content-Type: text/plain; charset="UTF-8" I'm importing the regex module of Gnulib to Universal ctags. https://github.com/universal-ctags/ctags/pull/3054 >From the comment of regex.m4 # If the system regex support is good enough that it passes the # following run test, then default to *not* using the included regex.c. We expect that configure should not use the included regex.c on the system with up-to-date glibc. But we found it used the included regex.c even in (at least) glibc-2.31 and glibc-2.33. The test added by the following commit fails. ----------------------------------------- commit 55a4abd92a0a8fa0a9d9aff3892505f7b0c6d73c Author: Jim Meyering meyering@fb.com Date: Sat Dec 15 15:24:21 2018 -0800 regex: work around a bug in glibc-2.27 and prior * m4/regex.m4 (gl_REGEX): Reject any system regexp that gets a failed assertion for /0|()0|\1|0/. * tests/test-regex.c (main): Add the same test here. ... ----------------------------------------- It should fails in glibc-2.27 and prior, but it fails in all glibc, if I understand correctly. Here is the test fails. ----------------------------------------- ... /* Matching with the compiled form of this regexp would provoke an assertion failure prior to glibc-2.28: regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed With glibc-2.28, compilation fails and reports the invalid back reference. */ re_set_syntax (RE_SYNTAX_POSIX_EGREP); memset (®ex, 0, sizeof regex); s = re_compile_pattern ("0|()0|\\1|0", 10, ®ex); if (!s) result |= 64; // !!! FAILED HERE !!! else { if (strcmp (s, "Invalid back reference")) result |= 64; regfree (®ex); } ... ----------------------------------------- Returning 0 by re_compile_pattern() is correct behavior. It should not fail. I'm using the lastest Gnulib. Regards, -- Hiroo Hayashi --000000000000ef117c05c715a5e6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm importing the regex module of Gnulib to Universal = ctags.

<= div>From the comment of regex.m4
=C2=A0 =C2=A0 # If the system re= gex support is good enough that it passes the
=C2=A0 =C2=A0 # following = run test, then default to *not* using the included regex.c.
<= br>
We expect that configure should not use the included regex.c<= /div>
on the system with up-to-date glibc.
But we found it us= ed the included regex.c even in (at least) glibc-2.31 and glibc-2.33.
=

The test added by the following commit fails.
-----------------------------------------
commit 55a4abd92a0a8fa= 0a9d9aff3892505f7b0c6d73c
Author: Jim Meyering meyering@fb.com
Date: Sat Dec 15 15:24:21 2018 -0800
regex: work around a bug in glibc-2.27 and prior

* m4/regex.m4 (gl= _REGEX): Reject any system regexp that gets a failed
assertion for /0|()= 0|\1|0/.
* tests/test-regex.c (main): Add the same test here.
...
-----------------------------------------

It should fails in glibc-2.27 and prior, but it fails in al= l glibc, if I understand correctly.

Here is the test fa= ils.
-----------------------------------------
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ...
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Matching with the compiled form of t= his regexp would provoke
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0an assertion failure prior to glibc-2.28:
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0regexec.c:1375: pop_fail_stack: A= ssertion 'num >=3D 0' failed
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0With glibc-2.28, compilation fails and reports the = invalid
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0back refe= rence. =C2=A0*/
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 re_set_syntax = (RE_SYNTAX_POSIX_EGREP);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 memse= t (&regex, 0, sizeof regex);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 s =3D re_compile_pattern ("0|()0|\\1|0", 10, &regex);
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!s)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 result |=3D 64; =C2=A0 =C2=A0 // !!! FAILED HER= E !!!
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 if (strcmp (s, "Invalid back reference"))=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 result |=3D= 64;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 regfree (&a= mp;regex);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ...
--------------------------= ---------------
Returning 0 by re_compile_pattern() is correct behavior. It sho= uld not fail.

I'm using the lastest Gnulib.

Regards,
--
Hiroo Hayashi
--000000000000ef117c05c715a5e6--