get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2233380/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2233380,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2233380/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20260506102327.24801-2-gaoxiang@kylinos.cn/",
    "project": {
        "id": 41,
        "url": "http://patchwork.ozlabs.org/api/1.1/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": ""
    },
    "msgid": "<20260506102327.24801-2-gaoxiang@kylinos.cn>",
    "date": "2026-05-06T10:23:27",
    "name": "[v3,2/2] libio: Ignore doallocate for open_memstream and open_wmemstream [BZ #34019]",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "30f8d2afd2b3200b4dfbf31788dfb360c88f95e1",
    "submitter": {
        "id": 92909,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/92909/?format=api",
        "name": "Gao Xiang",
        "email": "gaoxiang@kylinos.cn"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20260506102327.24801-2-gaoxiang@kylinos.cn/mbox/",
    "series": [
        {
            "id": 502956,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/502956/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=502956",
            "date": "2026-05-06T10:23:27",
            "name": "[v3,1/2] libio: Ignore setbuf for open_memstream and open_wmemstream [BZ #34019]",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/502956/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2233380/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2233380/checks/",
    "tags": {},
    "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 spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=2620:52:6:3111::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 dmarc=none (p=none dis=none) header.from=kylinos.cn",
            "sourceware.org; spf=pass smtp.mailfrom=kylinos.cn",
            "sourceware.org;\n arc=none smtp.remote-ip=124.126.103.232"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::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 4g9WkJ6mGdz1yJq\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 20:26:00 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [IPv6:::1])\n\tby sourceware.org (Postfix) with ESMTP id D1F774BA901D\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  6 May 2026 10:25:58 +0000 (GMT)",
            "from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232])\n by sourceware.org (Postfix) with ESMTPS id 9B62D4BA23F4\n for <libc-alpha@sourceware.org>; Wed,  6 May 2026 10:25:21 +0000 (GMT)",
            "from bogon [(117.61.195.135)] by mailgw.kylinos.cn\n (envelope-from <gaoxiang@kylinos.cn>)\n (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256)\n with ESMTP id 984087769; Wed, 06 May 2026 18:25:14 +0800"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org D1F774BA901D",
            "OpenDKIM Filter v2.11.0 sourceware.org 9B62D4BA23F4"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 9B62D4BA23F4",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 9B62D4BA23F4",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778063122; cv=none;\n b=fbjmRXS12lW4R0tCpZD5r4xRFY02n3b2rjmWAfl5/hFZ1fR6KYT0TyWYfOowCFwNkdZYwKmEPLealI0uXk8e55W5gJEEZa9ecQWi+tGFOjd0SKfe9l3WBsAiB0Tont90Bo8w5Thf21Sb1iUZ4rvMyuj+4rLLadoXwt9qxpfZe8o=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1778063122; c=relaxed/simple;\n bh=b67zKgANeiIM3P4Qt2FbtexJHvgD7w05btfD2gc+Bwg=;\n h=From:To:Subject:Date:Message-ID:MIME-Version;\n b=Pj4qENjQSI3YjAwsPzbUwhLJZkkSFJAPI6IHJntacnyYYGOCccEi+EeYuz+3r/kRMdHpd1qiwJGFtjvQSRdGw6xCctOAv+bhqZVc8csIXp+JoHOIQbW67A6Gjen5ISwyXZaA0LlJQZ012gPHaYhlzMGMfUpTZ71LZ6CxXA8Bthw=",
        "ARC-Authentication-Results": "i=1; sourceware.org",
        "X-UUID": [
            "defc90d6493511f1aa26b74ffac11d73-20260506",
            "defc90d6493511f1aa26b74ffac11d73-20260506"
        ],
        "X-CTIC-Tags": "HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NAME, HR_CTE_8B,\n HR_CTT_MISS\n HR_DATE_H, HR_DATE_WKD, HR_DATE_ZONE, HR_FROM_NAME, HR_SJ_DIGIT_LEN\n HR_SJ_LANG, HR_SJ_LEN, HR_SJ_LETTER, HR_SJ_NOR_SYM, HR_SJ_PHRASE\n HR_SJ_PHRASE_LEN, HR_SJ_WS, HR_TO_COUNT, HR_TO_DOMAIN_COUNT, HR_TO_NO_NAME\n IP_UNTRUSTED, SRC_UNTRUSTED, IP_UNFAMILIAR, SRC_UNFAMILIAR, DN_TRUSTED\n SRC_TRUSTED, SA_EXISTED, SN_TRUSTED, SN_EXISTED, SPF_NOPASS\n DKIM_NOPASS, DMARC_NOPASS, UD_TRUSTED, CIE_GOOD_SPF, CIE_UNKNOWN\n GTI_FG_BS, GTI_C_CI, GTI_FG_IT, GTI_RG_INFO, GTI_C_BU\n AMN_T1, AMN_GOOD, AMN_C_TI, ABX_MISS_RDNS",
        "X-CID-O-RULE": "Release_Ham",
        "X-CID-RULE": "Release_Ham",
        "X-CID-O-INFO": "VERSION:1.3.12, REQID:b59c5d4c-8bd8-47bf-acd1-2c1a8df75a68,\n IP:10,\n URL:0,TC:0,Content:0,EDM:25,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTI\n ON:release,TS:30",
        "X-CID-INFO": "VERSION:1.3.12, REQID:b59c5d4c-8bd8-47bf-acd1-2c1a8df75a68, IP:10,\n UR\n L:0,TC:0,Content:0,EDM:25,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTION\n :release,TS:30",
        "X-CID-META": "VersionHash:e7bac3a, CLOUDID:424fb2c3ed331d317d861b0e4561ecc9,\n BulkI\n D:260506182516W9R99KXV,BulkQuantity:0,Recheck:0,SF:17|19|66|78|81|82|102|1\n 27|898,TC:nil,Content:0|15|50,EDM:5,IP:-2,URL:1,File:nil,RT:nil,Bulk:nil,Q\n S:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,\n ARC:0",
        "X-CID-BVR": "2,SSN|SDN",
        "X-CID-BAS": "2,SSN|SDN,0,_",
        "X-CID-FACTOR": "TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_ULS",
        "X-CID-RHF": "D41D8CD98F00B204E9800998ECF8427E",
        "X-User": "gaoxiang@kylinos.cn",
        "From": "Gao Xiang <gaoxiang@kylinos.cn>",
        "To": "libc-alpha@sourceware.org",
        "Cc": "Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,\n Rocket Ma <marocketbd@gmail.com>, Xiang Gao <gaoxiang@kylinos.cn>",
        "Subject": "[PATCH v3 2/2] libio: Ignore doallocate for open_memstream and\n open_wmemstream [BZ #34019]",
        "Date": "Wed,  6 May 2026 18:23:27 +0800",
        "Message-ID": "<20260506102327.24801-2-gaoxiang@kylinos.cn>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260506102327.24801-1-gaoxiang@kylinos.cn>",
        "References": "<e732abd8-6c6e-4e89-8365-5e20dc191898@linaro.org>\n <20260506102327.24801-1-gaoxiang@kylinos.cn>",
        "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": "From: Xiang Gao <gaoxiang@kylinos.cn>\n\nsetvbuf (stream, NULL, _IOFBF, 0) takes a special path in\n_IO_setvbuf: if the byte-oriented buffer base is NULL, it calls\n_IO_DOALLOCATE and returns without invoking the stream setbuf hook.\n\nFor open_wmemstream, the byte-oriented buffer base is NULL although\nthe wide result buffer has already been initialized in _wide_data.\nAs a result, this path calls _IO_wdefault_doallocate, which may\nreplace the wide buffer managed by open_wmemstream.\n\nInstall an open_wmemstream-specific doallocate hook that leaves\nthe growable result buffer unchanged. Add a regression test for this\npath.\n\nInstall a narrow memstream doallocate hook as well. It keeps both\nmemstream vtables consistent (generic stdio allocation must not\nreplace the growable result buffer).\n\nSigned-off-by: Xiang Gao <gaoxiang@kylinos.cn>\n---\n libio/Makefile                            |  1 +\n libio/libioP.h                            |  3 ++\n libio/memstream.c                         |  9 ++++\n libio/tst-wmemstream-setvbuf-doallocate.c | 64 +++++++++++++++++++++++\n libio/vtables.c                           |  6 ++-\n libio/wmemstream.c                        |  9 ++++\n 6 files changed, 90 insertions(+), 2 deletions(-)\n create mode 100644 libio/tst-wmemstream-setvbuf-doallocate.c",
    "diff": "diff --git a/libio/Makefile b/libio/Makefile\nindex 584fcdb14d..b3c2d818b3 100644\n--- a/libio/Makefile\n+++ b/libio/Makefile\n@@ -140,6 +140,7 @@ tests = \\\n   tst-wfile-sync \\\n   tst-wfiledoallocate-static \\\n   tst-widetext \\\n+  tst-wmemstream-setvbuf-doallocate \\\n   tst-wmemstream1 \\\n   tst-wmemstream2 \\\n   tst-wmemstream3 \\\ndiff --git a/libio/libioP.h b/libio/libioP.h\nindex 17c0b6e76d..fa547a4a29 100644\n--- a/libio/libioP.h\n+++ b/libio/libioP.h\n@@ -742,10 +742,13 @@ extern int _IO_mem_sync (FILE *fp) __THROW attribute_hidden;\n extern void _IO_mem_finish (FILE *fp, int) __THROW attribute_hidden;\n extern FILE *_IO_mem_setbuf (FILE *fp, char *buf, ssize_t size)\n   __THROW attribute_hidden;\n+extern int _IO_mem_doallocate (FILE *fp) __THROW attribute_hidden;\n+\n extern int _IO_wmem_sync (FILE *fp) __THROW attribute_hidden;\n extern void _IO_wmem_finish (FILE *fp, int) __THROW attribute_hidden;\n extern FILE *_IO_wmem_setbuf (FILE *fp, char *buf, ssize_t size)\n   __THROW attribute_hidden;\n+extern int _IO_wmem_doallocate (FILE *fp) __THROW attribute_hidden;\n \n /* Other strfile functions */\n struct _IO_strfile_;\ndiff --git a/libio/memstream.c b/libio/memstream.c\nindex a5f909cf64..918a2d6015 100644\n--- a/libio/memstream.c\n+++ b/libio/memstream.c\n@@ -121,3 +121,12 @@ _IO_mem_setbuf (FILE *fp, char *p, ssize_t len)\n   (void) len;\n   return fp;\n }\n+\n+int\n+_IO_mem_doallocate (FILE *fp)\n+{\n+  /* memstream manage a growable buffer internally.  The doallocate\n+     hook must not replace it with a generic stdio buffer.  */\n+  (void) fp;\n+  return 1;\n+}\ndiff --git a/libio/tst-wmemstream-setvbuf-doallocate.c b/libio/tst-wmemstream-setvbuf-doallocate.c\nnew file mode 100644\nindex 0000000000..595a716db5\n--- /dev/null\n+++ b/libio/tst-wmemstream-setvbuf-doallocate.c\n@@ -0,0 +1,64 @@\n+/* Test setvbuf on open_wmenstream, BZ #34019.\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 <stdio.h>\n+#include <stdlib.h>\n+#include <wchar.h>\n+#include <support/check.h>\n+\n+static int\n+do_test (void)\n+{\n+  /* Regression test for setvbuf doallocate on open_wmemstream.\n+     This test cover the _IO_setvbuf path for:\n+\n+     setvbuf (stream, NULL, _IOFBF, 0)\n+\n+     This path may call _IO_DOALLOCATE and return without invoking\n+     the stream setbuf hook. For open_wmemstream, the generic wide\n+     doallocate hook must not replace the growable  result buffer.  */\n+\n+  wchar_t *wbuf = NULL;\n+  size_t wlen = 0;\n+  FILE *fp = open_wmemstream (&wbuf, &wlen);\n+\n+  TEST_VERIFY_EXIT (fp != NULL);\n+\n+  TEST_COMPARE (setvbuf (fp, NULL, _IOFBF, 0), 0);\n+\n+  TEST_COMPARE (fputwc (L'A', fp), L'A');\n+  TEST_COMPARE (fflush (fp), 0);\n+  TEST_COMPARE (wlen, 1);\n+  TEST_VERIFY (wbuf != NULL);\n+  TEST_VERIFY (wbuf[0] == L'A');\n+  TEST_VERIFY (wbuf[1] == L'\\0');\n+\n+  TEST_COMPARE (fputwc (L'B', fp), L'B');\n+  TEST_COMPARE (fclose (fp), 0);\n+  TEST_COMPARE (wlen, 2);\n+  TEST_VERIFY (wbuf != NULL);\n+  TEST_VERIFY (wbuf[0] == L'A');\n+  TEST_VERIFY (wbuf[1] == L'B');\n+  TEST_VERIFY (wbuf[2] == L'\\0');\n+\n+  free (wbuf);\n+\n+  return 0;\n+}\n+\n+#include <support/test-driver.c>\ndiff --git a/libio/vtables.c b/libio/vtables.c\nindex ca9f1b2dc4..ba3f9566f8 100644\n--- a/libio/vtables.c\n+++ b/libio/vtables.c\n@@ -79,10 +79,12 @@\n # pragma weak _IO_mem_finish\n # pragma weak _IO_mem_setbuf\n # pragma weak _IO_mem_sync\n+# pragma weak _IO_mem_doallocate\n \n # pragma weak _IO_wmem_finish\n # pragma weak _IO_wmem_setbuf\n # pragma weak _IO_wmem_sync\n+# pragma weak _IO_wmem_doallocate\n \n # pragma weak __printf_buffer_as_file_overflow\n # pragma weak __printf_buffer_as_file_xsputn\n@@ -338,7 +340,7 @@ const struct _IO_jump_t __io_vtables[] attribute_relro =\n     JUMP_INIT (seekpos, _IO_default_seekpos),\n     JUMP_INIT (setbuf, _IO_mem_setbuf),\n     JUMP_INIT (sync, _IO_mem_sync),\n-    JUMP_INIT (doallocate, _IO_default_doallocate),\n+    JUMP_INIT (doallocate, _IO_mem_doallocate),\n     JUMP_INIT (read, _IO_default_read),\n     JUMP_INIT (write, _IO_default_write),\n     JUMP_INIT (seek, _IO_default_seek),\n@@ -361,7 +363,7 @@ const struct _IO_jump_t __io_vtables[] attribute_relro =\n     JUMP_INIT (seekpos, _IO_default_seekpos),\n     JUMP_INIT (setbuf, _IO_wmem_setbuf),\n     JUMP_INIT (sync, _IO_wmem_sync),\n-    JUMP_INIT (doallocate, _IO_wdefault_doallocate),\n+    JUMP_INIT (doallocate, _IO_wmem_doallocate),\n     JUMP_INIT (read, _IO_default_read),\n     JUMP_INIT (write, _IO_default_write),\n     JUMP_INIT (seek, _IO_default_seek),\ndiff --git a/libio/wmemstream.c b/libio/wmemstream.c\nindex 8f37a6efb8..498f5420e1 100644\n--- a/libio/wmemstream.c\n+++ b/libio/wmemstream.c\n@@ -127,3 +127,12 @@ _IO_wmem_setbuf (FILE *fp, char *p, ssize_t len)\n   (void) len;\n   return fp;\n }\n+\n+int\n+_IO_wmem_doallocate (FILE *fp)\n+{\n+  /* wmemstreams manage a growable buffer internally.  The doallocate\n+     hook must not replace it with a generic stdio buffer.  */\n+  (void) fp;\n+  return 1;\n+}\n",
    "prefixes": [
        "v3",
        "2/2"
    ]
}