Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2222555/?format=api
{ "id": 2222555, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2222555/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/01d8d5b649d0ce7ad68debec90e86bd9d4838266.1776022765.git.collin.funk1@gmail.com/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/1.2/projects/41/?format=api", "name": "GNU C Library", "link_name": "glibc", "list_id": "libc-alpha.sourceware.org", "list_email": "libc-alpha@sourceware.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<01d8d5b649d0ce7ad68debec90e86bd9d4838266.1776022765.git.collin.funk1@gmail.com>", "list_archive_url": null, "date": "2026-04-12T19:39:25", "name": "posix: fix false regex match with backrefs and $ anchor", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "23ca31998ad7467f0b4671338a8cff48f37adf69", "submitter": { "id": 88687, "url": "http://patchwork.ozlabs.org/api/1.2/people/88687/?format=api", "name": "Collin Funk", "email": "collin.funk1@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/01d8d5b649d0ce7ad68debec90e86bd9d4838266.1776022765.git.collin.funk1@gmail.com/mbox/", "series": [ { "id": 499628, "url": "http://patchwork.ozlabs.org/api/1.2/series/499628/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=499628", "date": "2026-04-12T19:39:25", "name": "posix: fix false regex match with backrefs and $ anchor", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499628/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2222555/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2222555/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "libc-alpha@sourceware.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "libc-alpha@sourceware.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=KavruLvA;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=KavruLvA", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "sourceware.org; spf=pass smtp.mailfrom=gmail.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=2607:f8b0:4864:20::1234" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fv18j5b9bz1yCx\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 05:40:05 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 6B1F74BA2E1D\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 12 Apr 2026 19:40:03 +0000 (GMT)", "from mail-dl1-x1234.google.com (mail-dl1-x1234.google.com\n [IPv6:2607:f8b0:4864:20::1234])\n by sourceware.org (Postfix) with ESMTPS id D7DA04BA2E09\n for <libc-alpha@sourceware.org>; Sun, 12 Apr 2026 19:39:41 +0000 (GMT)", "by mail-dl1-x1234.google.com with SMTP id\n a92af1059eb24-128b9b7e3edso4599194c88.0\n for <libc-alpha@sourceware.org>; Sun, 12 Apr 2026 12:39:41 -0700 (PDT)", "from localhost.localdomain ([2601:646:8081:3770::19df])\n by smtp.gmail.com with ESMTPSA id\n a92af1059eb24-12c3459f7ffsm11187302c88.3.2026.04.12.12.39.40\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 12 Apr 2026 12:39:40 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 6B1F74BA2E1D", "OpenDKIM Filter v2.11.0 sourceware.org D7DA04BA2E09" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org D7DA04BA2E09", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org D7DA04BA2E09", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776022782; cv=none;\n b=lzxvGZUuaA+6X4+OLtgcuPqPBv1y51iYcoIhCjE0tmKxJFAxFIpaxi1TLs53Q+HqdPVpb+wb+J3dfL+XXzg9qkWDboaYrCp3eCswv/onEKfxcYvmcsvBoRINCfHbkx/XZuGUIoAGNaPq6EWW0MiVhGfXo116a897/rQW9vD4vtU=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776022782; c=relaxed/simple;\n bh=PgJLWnydhBxxxCZhoKQhrooFgNQkC1cbDSZ1FOq5oxY=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=Ms/aLOxNPg6AGQoDlWkL8FjB6eEaG9wSEJnxeVBGhr2++V5Xypo1pZ+iXxWt0AjsVTFYa/w0VQ3xi/srQFFvmvE7aLNPlZMBdHW8EX0wQcGoaEG1/svjSG88IBLWudfzZ0dTEKr3MIk3eSoirJz+LynwzIWzRaRJBi+GBy1RGLw=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776022781; x=1776627581; darn=sourceware.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=ew0VcNVjw5OcXx4LipMhomfn1k7t5Wg4gTrW4+0Q70A=;\n b=KavruLvAaYoND9s4BJnF6pUWB9QJUqOQvKqVNXtIil384RpQ6yu6RvZSn+jE1pLf+Z\n eZySkWSMstiXM0Z2fVtvG5SYzLJNF5XFV/l4kSbwNu5KDekad4TgegVqgfaT+r7kv4Pg\n aRTGfwgEP/Q8ouY/CpJ/mpFPia0p/n6z1aaQf8msIQMylsecdt/Iex/YKJFf7gbegbm+\n U/rOgp723RnVC7H3N7z+Jmu+re/WPP/6EwE6YXjfTHsyDdFT+zIQoVsyzb0nrHB6UgP3\n l9HAiZVM0HbpOgsbX+z7s0co+xrxJIZ8fvt5pRntC6Ow+r0MjX6WCXuh/H+mGFy3WyFV\n TcBg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776022781; x=1776627581;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=ew0VcNVjw5OcXx4LipMhomfn1k7t5Wg4gTrW4+0Q70A=;\n b=OZETcbJMiOrgb+4LSLifk8MKp/KxLplIcFmXP6U9sVIxq1Q37mmh8G4zXOfqPj8tm+\n qn6SZ0aSKrO44f0Lk/x2H3LBwhYIUwq6QlYKLxvVqE8poGYxDqdzsIBEMFWFTxl7A9Vs\n x+eFqa2AwI8gJhVWdO/8waCkGIFdQKQj8L6jYepeXQc25CMbQto0Je97Hmh6oFuFZIb3\n Zm8H7cgLLs+TfhuA5a/O4ulq5gMCO4Zm29hFJOkf78ccVAd+5CoEJOo0i8etmz+jjTiO\n 7DkwnEB00vqrv1XlAKly/zy0Hxxxm7Iu2Di+niKuiWkRZb18CVXtq2HsD2ZQ7xJuwHfg\n inVg==", "X-Gm-Message-State": "AOJu0Yzwqe+WRSnRtx7enQ+EWY6ImtszggK39bpAAI9RuY3LMTPKApey\n 70Pv4O7XByfD97n/foQJJphqWC7NukMhdRA49dzgRTwxEjbMB6JjJr9DU8S3QQ==", "X-Gm-Gg": "AeBDiesF9rbhTLVAJsTuYcUvDNPdcJKIBVGiqoYHM89EbQ1O5neGgWpW934iMqRreMw\n uGHSBPBbZAlwP+MY7ph7woKhvQBPsTlFi/SjfyW3u7RLh3jNldD+KC/I8hj7dTncc75MEdINVIl\n Dgaho0bUJUp/l+BQNe+Y/pIR3Hi2ziMID8ougiuw7E9PlKs6OMoFnRfLz/hY3syLl/KFH2oT2mo\n fXKGxfoVxhBhY4IsXR5cVia6/unfOJTSY8Tv85Go+BE1Ls6izSnEFVvUoEQLhY9RLNKoicoySp+\n D6dVXVI28p/aj44rwZf3CFV8m0qj5ldEdxJIAp9MI7xJY+3WvV6RKBD8kN55jIqSNZn/NOkWlvo\n DSZ+/XemhauGJuvenYMVYhC8w2FV1VVXlS9Ypj4JVw1AUHb9uAMVaI9VsQD6j9Z2U5T7OoLWSGf\n Abb8Ib9DQlRSypGNxke4EMmIKO", "X-Received": "by 2002:a05:7022:6886:b0:12b:fb81:d69b with SMTP id\n a92af1059eb24-12c34eceb11mr6185120c88.19.1776022780704;\n Sun, 12 Apr 2026 12:39:40 -0700 (PDT)", "From": "Collin Funk <collin.funk1@gmail.com>", "To": "libc-alpha@sourceware.org", "Cc": "Jim Meyering <jim@meyering.net>, Paul Eggert <eggert@cs.ucla.edu>,\n Collin Funk <collin.funk1@gmail.com>", "Subject": "[PATCH] posix: fix false regex match with backrefs and $ anchor", "Date": "Sun, 12 Apr 2026 12:39:25 -0700", "Message-ID": "\n <01d8d5b649d0ce7ad68debec90e86bd9d4838266.1776022765.git.collin.funk1@gmail.com>", "X-Mailer": "git-send-email 2.53.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "libc-alpha@sourceware.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Libc-alpha mailing list <libc-alpha.sourceware.org>", "List-Unsubscribe": "<https://sourceware.org/mailman/options/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe>", "List-Archive": "<https://sourceware.org/pipermail/libc-alpha/>", "List-Post": "<mailto:libc-alpha@sourceware.org>", "List-Help": "<mailto:libc-alpha-request@sourceware.org?subject=help>", "List-Subscribe": "<https://sourceware.org/mailman/listinfo/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=subscribe>", "Errors-To": "libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org" }, "content": "This fixes the $ anchor being ignored in the following grep command:\n\n $ grep -E '^(.?)(.?).?\\2\\1$' <<< ab\n ab\n\nHowever, the regular expression should only match palindromes.\n\nThis patch is mostly copied from a commit in Gnulib from Jim Meyering\n[1]. It was found by Ed Morton in GNU sed [2].\n\n[1] https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commit;h=8c22765403cc34e87ad953cb3f6901e723c937f5\n[2] https://bugs.gnu.org/68725\n---\n posix/Makefile | 1 +\n posix/bug-regex39.c | 35 +++++++++++++++++++++++++++++++++++\n posix/regexec.c | 5 ++++-\n 3 files changed, 40 insertions(+), 1 deletion(-)\n create mode 100644 posix/bug-regex39.c", "diff": "diff --git a/posix/Makefile b/posix/Makefile\nindex a5e5162c61..0fa532396f 100644\n--- a/posix/Makefile\n+++ b/posix/Makefile\n@@ -242,6 +242,7 @@ tests := \\\n bug-regex36 \\\n bug-regex37 \\\n bug-regex38 \\\n+ bug-regex39 \\\n regexbug1 \\\n runptests \\\n runtests \\\ndiff --git a/posix/bug-regex39.c b/posix/bug-regex39.c\nnew file mode 100644\nindex 0000000000..393fd5491e\n--- /dev/null\n+++ b/posix/bug-regex39.c\n@@ -0,0 +1,35 @@\n+/* Test for GNU sed bug 68725.\n+ Copyright (C) 2026 Free Software Foundation, Inc.\n+ This file is part of the GNU C Library.\n+\n+ The GNU C Library is free software; you can redistribute it and/or\n+ modify it under the terms of the GNU Lesser General Public\n+ License as published by the Free Software Foundation; either\n+ version 2.1 of the License, or (at your option) any later version.\n+\n+ The GNU C Library is distributed in the hope that it will be useful,\n+ but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n+ Lesser General Public License for more details.\n+\n+ You should have received a copy of the GNU Lesser General Public\n+ License along with the GNU C Library; if not, see\n+ <https://www.gnu.org/licenses/>. */\n+\n+#include <regex.h>\n+\n+#include <support/check.h>\n+\n+static int\n+do_test (void)\n+{\n+ char const pattern[] = \"^(.?)(.?).?\\\\2\\\\1$\";\n+ regex_t re;\n+ TEST_VERIFY_EXIT (regcomp (&re, pattern, REG_EXTENDED) == 0);\n+ regmatch_t match;\n+ TEST_VERIFY (regexec (&re, \"ab\", 1, &match, 0) == REG_NOMATCH);\n+ regfree (&re);\n+ return 0;\n+}\n+\n+#include <support/test-driver.c>\ndiff --git a/posix/regexec.c b/posix/regexec.c\nindex 193d8bd650..23339fb142 100644\n--- a/posix/regexec.c\n+++ b/posix/regexec.c\n@@ -955,7 +955,10 @@ prune_impossible_nodes (re_match_context_t *mctx)\n \t\t goto free_return;\n \t\t}\n \t } while (mctx->state_log[match_last] == NULL\n-\t\t || !mctx->state_log[match_last]->halt);\n+\t\t || !mctx->state_log[match_last]->halt\n+\t\t || !check_halt_state_context (mctx,\n+\t\t\t\t\t\t mctx->state_log[match_last],\n+\t\t\t\t\t\t match_last));\n \t halt_node = check_halt_state_context (mctx,\n \t\t\t\t\t\tmctx->state_log[match_last],\n \t\t\t\t\t\tmatch_last);\n", "prefixes": [] }