Show a patch.

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

{
    "id": 11445,
    "url": "https://patchwork.libcamera.org/api/patches/11445/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11445/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20210302122341.83985-2-kieran.bingham@ideasonboard.com>",
    "date": "2021-03-02T12:23:40",
    "name": "[libcamera-devel,1/2] libcamera: Request: validate state on complete",
    "commit_ref": "2cf0c87511caccabdea39a9e65aef10bf5f48c19",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "90202cd6e7a0836f0e29b3e0ed6d82b61a87cb21",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/11445/mbox/",
    "series": [
        {
            "id": 1739,
            "url": "https://patchwork.libcamera.org/api/series/1739/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1739",
            "date": "2021-03-02T12:23:39",
            "name": "libcamera: Request: Catch double completions",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1739/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11445/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11445/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 2EDBDBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  2 Mar 2021 12:23:48 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ECDF068AAB;\n\tTue,  2 Mar 2021 13:23:46 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B0DFE68A98\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  2 Mar 2021 13:23:45 +0100 (CET)",
            "from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net\n\t[86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4A19A8F3;\n\tTue,  2 Mar 2021 13:23:45 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"O14nrx5/\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1614687825;\n\tbh=4+cQre32CGAD54M4055pdgyfYWJb6NvbhJm1CZobWH0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=O14nrx5/JDPIXmJUFJGIBlOOHZF375q9T3wwZY//28/c+sNto0MhoONWbjVn2Ya8N\n\t/jK+1BNnSihfUZ63N0vpy/KQYpC9ZTOIHX5JKhvG+UwHfGOGP5iYrZxSxfXj80wvlt\n\t5WQ/Fnp0k2rq0VmJL5N11H9ui3CdQtyZkhM3t1Jk=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Tue,  2 Mar 2021 12:23:40 +0000",
        "Message-Id": "<20210302122341.83985-2-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210302122341.83985-1-kieran.bingham@ideasonboard.com>",
        "References": "<20210302122341.83985-1-kieran.bingham@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 1/2] libcamera: Request: validate state on\n\tcomplete",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Requests should only be completed from the RequestPending state.\n\nRequests which are completed from the RequestCancelled, or RequestComplete\nstate, will indicate that a double-complete has been called on the Request,\nor that it has been used internally after it has been given back to the\napplication.\n\nEnsure that this can be caught early if it occurs by enforcing the state\nrequired with an assert.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n---\nThis issue has been seen while developing the IPA for the IPU3.\n\nRequests are completed, and then completed again while closing.\nIt is likely that this occured, where a request was completed, and was\nthen re-used.\n\nA use case where the Request was deleted instead of re-used was also\nseen which caused a segmentation fault instead, due to the use of the\nmemory after free().\n\n src/libcamera/request.cpp | 2 ++\n 1 file changed, 2 insertions(+)",
    "diff": "diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\nindex e561ce1d5d0e..24c3694de5fc 100644\n--- a/src/libcamera/request.cpp\n+++ b/src/libcamera/request.cpp\n@@ -262,7 +262,9 @@ FrameBuffer *Request::findBuffer(const Stream *stream) const\n  */\n void Request::complete()\n {\n+\tASSERT(status_ == RequestPending);\n \tASSERT(!hasPendingBuffers());\n+\n \tstatus_ = cancelled_ ? RequestCancelled : RequestComplete;\n \n \tLOG(Request, Debug)\n",
    "prefixes": [
        "libcamera-devel",
        "1/2"
    ]
}