Show a patch.

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

{
    "id": 22560,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/22560/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/22560/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20250114143622.28803-1-laurent.pinchart@ideasonboard.com>",
    "date": "2025-01-14T14:36:22",
    "name": "libcamera: v4l2_subdevice: Work around false positive warning",
    "commit_ref": "b01918978c8281d344d5408b3a13aab9e5af4b5d",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "e438a9d7d35aee7cb56ebbf995ac38915f132e43",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/22560/mbox/",
    "series": [
        {
            "id": 4950,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4950/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4950",
            "date": "2025-01-14T14:36:22",
            "name": "libcamera: v4l2_subdevice: Work around false positive warning",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4950/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/22560/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/22560/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 6C691C3303\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Jan 2025 14:36:30 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7EF6B607D6;\n\tTue, 14 Jan 2025 15:36:29 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E427607D6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Jan 2025 15:36:27 +0100 (CET)",
            "from pendragon.ideasonboard.com (unknown [193.209.96.36])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 233BE465\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Jan 2025 15:35:30 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ABUyHqYN\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1736865330;\n\tbh=jriLsmOADQLj3IwSeTk6Wj2CHqEx/8G3dXW+urNuvss=;\n\th=From:To:Subject:Date:From;\n\tb=ABUyHqYNfTSgD4ThszvMhiIYWRKX7wEfQaspJpD0g852zlLtnt2TXPaSgCCCLThHF\n\twXC+bzLh95k4WEpmeUHWyNwurB1LL+v2Iwvp5MpfgZgFIP3SK/6Qk1qkAWBB/gwYOM\n\tlVznkMVbxJBdgkGzjukPjxuFWV0hxTgGa+qgqeDM=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH] libcamera: v4l2_subdevice: Work around false positive\n\twarning",
        "Date": "Tue, 14 Jan 2025 16:36:22 +0200",
        "Message-ID": "<20250114143622.28803-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.45.2",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "gcc 13.3.0, as provided by buildroot 2024.11.1, chokes when compiling\nv4l2_subdevice.cpp with ASan enabled, due to the usage of the C++\nstandard library regex header:\n\nIn file included from /host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/functional:59,\n                 from ../../include/libcamera/base/utils.h:12,\n                 from ../../include/libcamera/base/log.h:15,\n                 from ../../include/libcamera/internal/v4l2_subdevice.h:20,\n                 from ../../src/libcamera/v4l2_subdevice.cpp:8:\nIn constructor ‘std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = bool; _ArgTypes = {char}]’,\n    inlined from ‘std::__detail::_State<_Char_type>::_State(std::__detail::_State<_Char_type>&&) [with _Char_type = char]’ at /host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/bits/regex_automaton.h:149:4,\n    inlined from ‘std::__detail::_StateIdT std::__detail::_NFA<_TraitsT>::_M_insert_subexpr_begin() [with _TraitsT = std::__cxx11::regex_traits<char>]’ at /host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/bits/regex_automaton.h:281:24:\n/host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/bits/std_function.h:405:42: error: ‘*(std::function<bool(char)>*)((char*)&__tmp + offsetof(std::__detail::_StateT, std::__detail::_State<char>::<unnamed>.std::__detail::_State_base::<unnamed>)).std::function<bool(char)>::_M_invoker’ may be used uninitialized [-Werror=maybe-uninitialized]\n  405 |       : _Function_base(), _M_invoker(__x._M_invoker)\n      |                                      ~~~~^~~~~~~~~~\nIn file included from /host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/regex:65,\n                 from ../../src/libcamera/v4l2_subdevice.cpp:11:\n/host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/bits/regex_automaton.h: In member function ‘std::__detail::_StateIdT std::__detail::_NFA<_TraitsT>::_M_insert_subexpr_begin() [with _TraitsT = std::__cxx11::regex_traits<char>]’:\n/host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/bits/regex_automaton.h:279:17: note: ‘__tmp’ declared here\n  279 |         _StateT __tmp(_S_opcode_subexpr_begin);\n      |                 ^~~~~\nIn member function ‘bool std::_Function_base::_M_empty() const’,\n    inlined from ‘std::function<_Res(_ArgTypes ...)>::operator bool() const [with _Res = bool; _ArgTypes = {char}]’ at /host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/bits/std_function.h:574:25,\n    inlined from ‘std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = bool; _ArgTypes = {char}]’ at /host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/bits/std_function.h:407:6,\n    inlined from ‘std::__detail::_State<_Char_type>::_State(std::__detail::_State<_Char_type>&&) [with _Char_type = char]’ at /host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/bits/regex_automaton.h:149:4,\n    inlined from ‘std::__detail::_StateIdT std::__detail::_NFA<_TraitsT>::_M_insert_subexpr_begin() [with _TraitsT = std::__cxx11::regex_traits<char>]’ at /host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/bits/regex_automaton.h:281:24:\n/host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/bits/std_function.h:247:37: error: ‘*(const std::_Function_base*)((char*)&__tmp + offsetof(std::__detail::_StateT, std::__detail::_State<char>::<unnamed>.std::__detail::_State_base::<unnamed>)).std::_Function_base::_M_manager’ may be used uninitialized [-Werror=maybe-uninitialized]\n  247 |     bool _M_empty() const { return !_M_manager; }\n      |                                     ^~~~~~~~~~\n/host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/bits/regex_automaton.h: In member function ‘std::__detail::_StateIdT std::__detail::_NFA<_TraitsT>::_M_insert_subexpr_begin() [with _TraitsT = std::__cxx11:\n/host/aarch64-buildroot-linux-gnu/include/c++/13.3.0/bits/regex_automaton.h:279:17: note: ‘__tmp’ declared here\n  279 |         _StateT __tmp(_S_opcode_subexpr_begin);\n      |                 ^~~~~\n\nThis is a false positive that previously occurred with gcc 12.1.0 and\nwas fixed in 12.2 (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105562),\nand it seems to have now reappeared. The bug report indicates that the\nprobability of such false positives increase when using sanitizers. As\nthis isn't caught by CI, which compiles libcamera with gcc 13.3.0, the\nchance that such compilation failures will appear in environments\nwithout a clear pattern is relatively high. Work around the problem by\ndisabling the warning around the inclusiong of the regex header.\n\nIf the regex header needs to be included in other source files, creating\na wrapped in libcamera-base may be a cleaner alternative.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/v4l2_subdevice.cpp | 8 +++++++-\n 1 file changed, 7 insertions(+), 1 deletion(-)\n\n\nbase-commit: 2ae7b2ff7438a4deecff2a8b5de685cc14e5cd44",
    "diff": "diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex 7a064d87da41..33279654db8c 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -8,12 +8,18 @@\n #include \"libcamera/internal/v4l2_subdevice.h\"\n \n #include <fcntl.h>\n-#include <regex>\n #include <sstream>\n #include <string.h>\n #include <sys/ioctl.h>\n #include <unistd.h>\n \n+#pragma GCC diagnostic push\n+#if defined __SANITIZE_ADDRESS__ && defined __OPTIMIZE__\n+#pragma GCC diagnostic ignored \"-Wmaybe-uninitialized\"\n+#endif\n+#include <regex>\n+#pragma GCC diagnostic pop\n+\n #include <linux/media-bus-format.h>\n #include <linux/v4l2-subdev.h>\n \n",
    "prefixes": []
}