[{"id":26621,"web_url":"https://patchwork.libcamera.org/comment/26621/","msgid":"<20230310104033.GD5342@pendragon.ideasonboard.com>","date":"2023-03-10T10:40:33","subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Fix crash under LTO","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush and Dave,\n\nThank you for the patch.\n\nOn Fri, Mar 10, 2023 at 09:51:26AM +0000, Naushir Patuck via libcamera-devel wrote:\n> From: Dave Jones <dave.jones@canonical.com>\n> \n> When compiled with LTO (the default on Ubuntu), the global static\n> objects camHelpers and algorithms cause a crash in raspberrypi_ipa_proxy\n> at runtime as they're not allocated by the time the registration\n> routines execute.\n> \n> This is a fairly crude fix which just converts the global static objects\n> into local static objects inside an equivalently named function.\n> \n> Signed-off-by: Dave Jones <dave.jones@canonical.com>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Tested-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/ipa/raspberrypi/cam_helper.cpp           | 16 +++++++++++++---\n>  src/ipa/raspberrypi/controller/algorithm.cpp | 19 +++++++++++++++----\n>  2 files changed, 28 insertions(+), 7 deletions(-)\n> \n> diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\n> index d90ac1deda47..efe453dc6135 100644\n> --- a/src/ipa/raspberrypi/cam_helper.cpp\n> +++ b/src/ipa/raspberrypi/cam_helper.cpp\n> @@ -9,6 +9,7 @@\n>  \n>  #include <limits>\n>  #include <map>\n> +#include <memory>\n>  #include <string.h>\n>  \n>  #include \"libcamera/internal/v4l2_videodevice.h\"\n> @@ -25,7 +26,16 @@ namespace libcamera {\n>  LOG_DECLARE_CATEGORY(IPARPI)\n>  }\n>  \n> -static std::map<std::string, CamHelperCreateFunc> camHelpers;\n> +namespace {\n> +\n> +std::map<std::string, CamHelperCreateFunc> &camHelpers()\n> +{\n> +\tstatic std::unique_ptr<std::map<std::string, CamHelperCreateFunc>> obj =\n> +\t\tstd::make_unique<std::map<std::string, CamHelperCreateFunc>>();\n> +\treturn *obj;\n\nI think you could simply write\n\n\tstatic std::map<std::string, CamHelperCreateFunc> helpers;\n\treturn helpers;\n\n> +}\n> +\n> +} /* namespace */\n>  \n>  CamHelper *CamHelper::create(std::string const &camName)\n>  {\n> @@ -33,7 +43,7 @@ CamHelper *CamHelper::create(std::string const &camName)\n>  \t * CamHelpers get registered by static RegisterCamHelper\n>  \t * initialisers.\n>  \t */\n> -\tfor (auto &p : camHelpers) {\n> +\tfor (auto &p : camHelpers()) {\n>  \t\tif (camName.find(p.first) != std::string::npos)\n>  \t\t\treturn p.second();\n>  \t}\n> @@ -253,5 +263,5 @@ void CamHelper::populateMetadata([[maybe_unused]] const MdParser::RegisterMap &r\n>  RegisterCamHelper::RegisterCamHelper(char const *camName,\n>  \t\t\t\t     CamHelperCreateFunc createFunc)\n>  {\n> -\tcamHelpers[std::string(camName)] = createFunc;\n> +\tcamHelpers()[std::string(camName)] = createFunc;\n>  }\n> diff --git a/src/ipa/raspberrypi/controller/algorithm.cpp b/src/ipa/raspberrypi/controller/algorithm.cpp\n> index 6d91ee292bd1..2650f98bee5b 100644\n> --- a/src/ipa/raspberrypi/controller/algorithm.cpp\n> +++ b/src/ipa/raspberrypi/controller/algorithm.cpp\n> @@ -4,9 +4,10 @@\n>   *\n>   * algorithm.cpp - ISP control algorithms\n>   */\n> -\n\nUnrelated and unneeded change.\n\n>  #include \"algorithm.h\"\n>  \n> +#include <memory>\n> +\n>  using namespace RPiController;\n>  \n>  int Algorithm::read([[maybe_unused]] const libcamera::YamlObject &params)\n> @@ -34,14 +35,24 @@ void Algorithm::process([[maybe_unused]] StatisticsPtr &stats,\n>  \n>  /* For registering algorithms with the system: */\n>  \n> -static std::map<std::string, AlgoCreateFunc> algorithms;\n> +namespace {\n> +\n> +static std::map<std::string, AlgoCreateFunc> &algorithms()\n> +{\n> +\tstatic std::unique_ptr<std::map<std::string, AlgoCreateFunc>> obj =\n> +\t\tstd::make_unique<std::map<std::string, AlgoCreateFunc>>();\n> +\treturn *obj;\n\nSame here.\n\n> +}\n> +\n> +} /* namespace */\n> +\n>  std::map<std::string, AlgoCreateFunc> const &RPiController::getAlgorithms()\n>  {\n> -\treturn algorithms;\n> +\treturn algorithms();\n>  }\n>  \n>  RegisterAlgorithm::RegisterAlgorithm(char const *name,\n>  \t\t\t\t     AlgoCreateFunc createFunc)\n>  {\n> -\talgorithms[std::string(name)] = createFunc;\n> +\talgorithms()[std::string(name)] = createFunc;\n>  }","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 AD303BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Mar 2023 10:40:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EBAD9626CA;\n\tFri, 10 Mar 2023 11:40:31 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3D8FD62661\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Mar 2023 11:40:31 +0100 (CET)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A7F46EF;\n\tFri, 10 Mar 2023 11:40:30 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678444831;\n\tbh=47u0/8dfk7ia6CHk3aL7gmJyhi7vyXet7tzbOhEH2Ik=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=j0cG7ZwNVimhTaYiHZWx1PvKweoAuEAP29YLDSM7cbocb7ahNQvU+XSxAP/cL6YZp\n\tl7DSfL9ierDFW56bo52dvDK32sjDQ0hfiy+iE9GoA0zTZ6vOUswfMho6cj3Y6hEoQa\n\tp4rE/v/MkjTMIEns9/SnH4vws7nmTzuHvJsgVxhajqdbVmMjP8jkpo7x+GuM636mMt\n\tfq7VlgYGNqrMC/f+T3eClkswrOebdMfBm1nfTbFMTBLojVjooa4WBmBl6x1R2GKu+l\n\tfTIMAkHS8/oxZom6cbA9OtM1tYE6PO7jelr6T4dVeSv5R4johiy0KaCGzXNAe7TA8G\n\tFVf52XdPLvDkQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1678444830;\n\tbh=47u0/8dfk7ia6CHk3aL7gmJyhi7vyXet7tzbOhEH2Ik=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=mvJGbOV3H6wjjHmGDvUNfUZU6kyjJtGchPzVVoRNezhgHsTtPbE5hrlvQs8c4vQT2\n\t5ohM3aLkxUMouytLPVv75tqdRswai/q2Ui05T81cidjQpeVmcfgmA7zuHTIEInEuLk\n\tXx9+sohATwoDVQSLr2mhH27GLCYzDq96PQDJGJIg="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"mvJGbOV3\"; dkim-atps=neutral","Date":"Fri, 10 Mar 2023 12:40:33 +0200","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20230310104033.GD5342@pendragon.ideasonboard.com>","References":"<20230310095126.27236-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230310095126.27236-1-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Fix crash under LTO","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Dave Jones <dave.jones@canonical.com>,\n\tlibcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26625,"web_url":"https://patchwork.libcamera.org/comment/26625/","msgid":"<20230310115853.r25hguxvyb2wdqqr@gonzo.waveform.org.uk>","date":"2023-03-10T11:58:53","subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Fix crash under LTO","submitter":{"id":158,"url":"https://patchwork.libcamera.org/api/people/158/","name":"Dave Jones","email":"dave.jones@canonical.com"},"content":"Hi Laurent,\n\nOn Fri, Mar 10, 2023 at 12:40:33PM +0200, Laurent Pinchart wrote:\n[snip]\n>> -static std::map<std::string, CamHelperCreateFunc> camHelpers;\n>> +namespace {\n>> +\n>> +std::map<std::string, CamHelperCreateFunc> &camHelpers()\n>> +{\n>> +\tstatic std::unique_ptr<std::map<std::string, CamHelperCreateFunc>> obj =\n>> +\t\tstd::make_unique<std::map<std::string, CamHelperCreateFunc>>();\n>> +\treturn *obj;\n>\n>I think you could simply write\n>\n>\tstatic std::map<std::string, CamHelperCreateFunc> helpers;\n>\treturn helpers;\n\nThat would likely be fine, but I thought I'd just note that in my \noriginal patch [1] I'd actually used \"new\" with a pointer instead of a \nstatic object quite deliberately. As my C++ skills are caked in the dust \nof grime of numerous years of neglect, I'd consulted the C++ FAQ and \nnoted that using a static pointer opens the possibility of a crash on \ndeinit [2] (I'm not certain it *would* crash, but I figured I'd take the \neasy/safe way out and leave the OS to deal with the memory) by using the \nsolution posited at [3].\n\n[1]: https://github.com/raspberrypi/libcamera/pull/46/files\n\n[2]: https://isocpp.org/wiki/faq/ctors#construct-on-first-use-v2\n\n[3]: https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use\n\nThat *might* be preferable, though I admit it looks ... somewhat ugly.\n\nCheers,\n\nDave Jones.","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 DEAB6BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Mar 2023 12:05:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 05E79626C5;\n\tFri, 10 Mar 2023 13:05:30 +0100 (CET)","from smtp-relay-internal-0.canonical.com\n\t(smtp-relay-internal-0.canonical.com [185.125.188.122])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C460B603B1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Mar 2023 12:58:55 +0100 (CET)","from mail-wm1-f71.google.com (mail-wm1-f71.google.com\n\t[209.85.128.71])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id\n\t9BC043F1C7 for <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Mar 2023 11:58:54 +0000 (UTC)","by mail-wm1-f71.google.com with SMTP id\n\tbi27-20020a05600c3d9b00b003e9d0925341so1721565wmb.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Mar 2023 03:58:54 -0800 (PST)","from localhost (waveform.plus.com. [80.229.34.140])\n\tby smtp.gmail.com with ESMTPSA id\n\tl10-20020a5d4bca000000b002c705058773sm1963136wrt.74.2023.03.10.03.58.53\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 10 Mar 2023 03:58:53 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678449930;\n\tbh=65SBDjT8oUJOsT4E5VWjwD/v/Kr7GVP4sitQzh6Kftc=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=DP+rq1Ji1dP4YzWkpRnCjc9MqbmYCEVrkBjecbMG6U4sMdtYc5qJ/jJW4qlfG6E19\n\tuqgxcDX9g36Ckzi2OH3KKYUjOk2laI6voVKD7o4CXfdbt6sdyTwSgMEtaBG4eotEjA\n\t7UAKIWpkSpvuFb4a1sZz6uxb6BBbdqBQEGkVAXCJJktjEX1e4YMI+xZ5tYEZA+zDIs\n\tYXNapxGeAzgnm9GSUb9d1kqxneo322axgWQc2lDth9Ppui9MB8toKgiHSrz1hL/nDE\n\tzKRiBGBd2YzRmVsB52Nuz0PthyH93SnoW3EorMvJ8yaAxe3CyUy4RDe3XhQN6ghhdB\n\taDii2UsbdrTJg==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com;\n\ts=20210705; t=1678449534;\n\tbh=D1aIC4Z/A6h32uxiiUS2tryi1nDj3VLMhnY1k9QgieE=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\tContent-Type:In-Reply-To;\n\tb=j9SDWlvRIy5Rm7ZGpIW8+pqsm33ssyCz7kLn98a4Winr0cjhqUgQ2oKjgGhq433eE\n\ts4Pf4ldkxznspmGrPnAXIom9Odx2IxFVpYM8OnAAttMD3CeGLhTIMrG0MGCC166/Mx\n\tTTIwls/qKWlrRrZzhNwdlBJjRMNBQUL/PmSqj9GRbR4lyBGOcjsSX4aqfTjr+BuXIW\n\tdIZvgVhgFKB61jYwuxvNSOWvOcZuOhAjLahYMl4sjANFBsviSZg60Hh/v8uFdChyZY\n\tB1sEGnT4cCICBq+SkLiYm7eyEX56JYJIPFMNQ1y6q0AyP+JV7pdpdv0o8ckEEgLePU\n\tEkH4FW1oYzeCQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=canonical.com\n\theader.i=@canonical.com\n\theader.b=\"j9SDWlvR\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112; t=1678449534;\n\th=user-agent:in-reply-to:content-disposition:mime-version:references\n\t:message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=D1aIC4Z/A6h32uxiiUS2tryi1nDj3VLMhnY1k9QgieE=;\n\tb=GMDYjwuG81EQz14SkijXgO7Nss5OWAWi2HXzXuT5NTUpOjgayOSLNE9aTZMCove1nN\n\tin15+errGg62GLF+SIX+qEbUkogRyaXMYDUX0BRSb7hWjwIOXLUJShqRTp4SAQj2B1Ke\n\t695nbPtYcx/NJaZlojKgJJW9YzcibBVBxq0g0poHl23JRZ4r865aEaQ26Y+cMmZm5jhu\n\tU079xLwucTDR5H+Pe3hpQEYvwPaW8EKO5W30nM0zWyN8dHxGuhk7vgNfXlLbMgNwAquZ\n\t2B7ndJiBD0Wh82K6FUz9Qw34hY6rMDDzSkVCcFNlF8fQooj60i1uL7UzdZKgXlsfM3Xi\n\tNRwQ==","X-Gm-Message-State":"AO0yUKXvu8Gg38bnSnUYThgrkIJQl/VNqrLAmaIYhq9+wxA5gy/NTCkU\n\tCMJiyiCw+WsP6IvABHXdPS4/+kF5ZG6mLoxvZUbLTn1Y0Wr961qrbK5LdJLYl7CbDAh9Z8mRFhN\n\tftKK05X3rfZ5L+FBBAcnvbWAX4SBzlWDoxCNeoBf8GAsLAWqMPMs=","X-Received":["by 2002:a5d:52c4:0:b0:2c7:390e:163c with SMTP id\n\tr4-20020a5d52c4000000b002c7390e163cmr18007664wrv.47.1678449534356; \n\tFri, 10 Mar 2023 03:58:54 -0800 (PST)","by 2002:a5d:52c4:0:b0:2c7:390e:163c with SMTP id\n\tr4-20020a5d52c4000000b002c7390e163cmr18007655wrv.47.1678449534067; \n\tFri, 10 Mar 2023 03:58:54 -0800 (PST)"],"X-Google-Smtp-Source":"AK7set9ZpnNUWYFDkn3yPBHNRt+7i/f/TX1LumoaBNn7Zj/7B+QsDG/q0/+0vLMuIzVfxD6gE5ujVA==","Date":"Fri, 10 Mar 2023 11:58:53 +0000","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20230310115853.r25hguxvyb2wdqqr@gonzo.waveform.org.uk>","References":"<20230310095126.27236-1-naush@raspberrypi.com>\n\t<20230310104033.GD5342@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii; format=flowed","Content-Disposition":"inline","In-Reply-To":"<20230310104033.GD5342@pendragon.ideasonboard.com>","User-Agent":"NeoMutt/20211029","X-Mailman-Approved-At":"Fri, 10 Mar 2023 13:05:28 +0100","Subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Fix crash under LTO","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>","From":"Dave Jones via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Dave Jones <dave.jones@canonical.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26626,"web_url":"https://patchwork.libcamera.org/comment/26626/","msgid":"<20230310134111.GH5342@pendragon.ideasonboard.com>","date":"2023-03-10T13:41:11","subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Fix crash under LTO","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Dave,\n\nOn Fri, Mar 10, 2023 at 11:58:53AM +0000, Dave Jones wrote:\n> On Fri, Mar 10, 2023 at 12:40:33PM +0200, Laurent Pinchart wrote:\n> [snip]\n> >> -static std::map<std::string, CamHelperCreateFunc> camHelpers;\n> >> +namespace {\n> >> +\n> >> +std::map<std::string, CamHelperCreateFunc> &camHelpers()\n> >> +{\n> >> +\tstatic std::unique_ptr<std::map<std::string, CamHelperCreateFunc>> obj =\n> >> +\t\tstd::make_unique<std::map<std::string, CamHelperCreateFunc>>();\n> >> +\treturn *obj;\n> >\n> > I think you could simply write\n> >\n> >\tstatic std::map<std::string, CamHelperCreateFunc> helpers;\n> >\treturn helpers;\n> \n> That would likely be fine, but I thought I'd just note that in my \n> original patch [1] I'd actually used \"new\" with a pointer instead of a \n> static object quite deliberately. As my C++ skills are caked in the dust \n> of grime of numerous years of neglect, I'd consulted the C++ FAQ and \n> noted that using a static pointer opens the possibility of a crash on \n> deinit [2] (I'm not certain it *would* crash, but I figured I'd take the \n> easy/safe way out and leave the OS to deal with the memory) by using the \n> solution posited at [3].\n> \n> [1]: https://github.com/raspberrypi/libcamera/pull/46/files\n> \n> [2]: https://isocpp.org/wiki/faq/ctors#construct-on-first-use-v2\n> \n> [3]: https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use\n> \n> That *might* be preferable, though I admit it looks ... somewhat ugly.\n\nUnless I'm mistaken, given that you're using a unique pointer, the\nobject will get deleted at deinit time. It should thus be functionally\nequivalent to the static variable in v2.\n\nWe *could* allocate the objects dynamically without std::unique_ptr to\navoid deinit issues, but we would then leak memory. That won't cause any\nissue in production, but for development it's nice if we can run\nlibcamera applications under valgrind and expect no leaks.","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 E1A1DBD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Mar 2023 13:41:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C12E261ED6;\n\tFri, 10 Mar 2023 14:41:09 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 32323603B1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Mar 2023 14:41:08 +0100 (CET)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 92CE72E5;\n\tFri, 10 Mar 2023 14:41:07 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678455669;\n\tbh=ssVc2SkPCIRQNBMkU7+w7wca/RkYGdFplFjOpOu1toY=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=B7phDQxaxPn0juJNj+vlvmEGhaK+8TEENIPWItlzyHrOktH+YyIpwdxZPr21zORUZ\n\tEFnfrN4YcUQQG9FzqGj9+k6USet7YD0eUrBqsdro94s5+7YeEBtdiRHWLoKkwZ57DB\n\ttoj7T7CPlltDTs8UZ5kNwfmrUt6ENS/PTYIIg/iiCGtKIsOmtGyhG31Z3sQM2+2KyF\n\t5eVWstSJBWRSE8eU3ITsVg5RY4G3zAKbHBCc97KDxff74O8VTJS1JWSM58JGIRjx+A\n\t2EhmZoO83DMlgXrCHG5k+aDIY8MJ9hgUnMizGUsBDVkBEoavDnLojDpXxQenT+h090\n\tX0i3tpFcU7J8A==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1678455667;\n\tbh=ssVc2SkPCIRQNBMkU7+w7wca/RkYGdFplFjOpOu1toY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=n4cyzGnFNCPfphKbY+iGh6O3Zu+KvyZUTJjRXJM2xilUfVa0CHwP19TYw0UKG/MVl\n\tAtWvzfXZkF7fc/RzgJ2SVAxzNRJUcWJHBHI3J9i2aZuXx9HYi35g3pLY8K39tscDZW\n\t6f+Bnj4Azas1qM8XsnyMejCuBSQLdPyeY8Tki2Mw="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"n4cyzGnF\"; dkim-atps=neutral","Date":"Fri, 10 Mar 2023 15:41:11 +0200","To":"Dave Jones <dave.jones@canonical.com>","Message-ID":"<20230310134111.GH5342@pendragon.ideasonboard.com>","References":"<20230310095126.27236-1-naush@raspberrypi.com>\n\t<20230310104033.GD5342@pendragon.ideasonboard.com>\n\t<20230310115853.r25hguxvyb2wdqqr@gonzo.waveform.org.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230310115853.r25hguxvyb2wdqqr@gonzo.waveform.org.uk>","Subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Fix crash under LTO","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26627,"web_url":"https://patchwork.libcamera.org/comment/26627/","msgid":"<CAEmqJPrYyZgtc5nQ3DoMH8KsaFbv5GT7bdBJoN4U8tGtQpqCeQ@mail.gmail.com>","date":"2023-03-10T13:43:44","subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Fix crash under LTO","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi all,\n\n\nOn Fri, 10 Mar 2023 at 13:41, Laurent Pinchart <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> Hi Dave,\n>\n> On Fri, Mar 10, 2023 at 11:58:53AM +0000, Dave Jones wrote:\n> > On Fri, Mar 10, 2023 at 12:40:33PM +0200, Laurent Pinchart wrote:\n> > [snip]\n> > >> -static std::map<std::string, CamHelperCreateFunc> camHelpers;\n> > >> +namespace {\n> > >> +\n> > >> +std::map<std::string, CamHelperCreateFunc> &camHelpers()\n> > >> +{\n> > >> +  static std::unique_ptr<std::map<std::string, CamHelperCreateFunc>>\n> obj =\n> > >> +          std::make_unique<std::map<std::string,\n> CamHelperCreateFunc>>();\n> > >> +  return *obj;\n> > >\n> > > I think you could simply write\n> > >\n> > >     static std::map<std::string, CamHelperCreateFunc> helpers;\n> > >     return helpers;\n> >\n> > That would likely be fine, but I thought I'd just note that in my\n> > original patch [1] I'd actually used \"new\" with a pointer instead of a\n> > static object quite deliberately. As my C++ skills are caked in the dust\n> > of grime of numerous years of neglect, I'd consulted the C++ FAQ and\n> > noted that using a static pointer opens the possibility of a crash on\n> > deinit [2] (I'm not certain it *would* crash, but I figured I'd take the\n> > easy/safe way out and leave the OS to deal with the memory) by using the\n> > solution posited at [3].\n> >\n> > [1]: https://github.com/raspberrypi/libcamera/pull/46/files\n> >\n> > [2]: https://isocpp.org/wiki/faq/ctors#construct-on-first-use-v2\n> >\n> > [3]: https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use\n> >\n> > That *might* be preferable, though I admit it looks ... somewhat ugly.\n>\n> Unless I'm mistaken, given that you're using a unique pointer, the\n> object will get deleted at deinit time. It should thus be functionally\n> equivalent to the static variable in v2.\n>\n> We *could* allocate the objects dynamically without std::unique_ptr to\n> avoid deinit issues, but we would then leak memory. That won't cause any\n> issue in production, but for development it's nice if we can run\n> libcamera applications under valgrind and expect no leaks.\n>\n\nThe unique_ptr was my addition to avoid leaks in debug.\nI think using a static object like in v2 ought to be good for this fix.\n\nRegards,\nNaush\n\n\n\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","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 7A22BBD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Mar 2023 13:44:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B71BD626C5;\n\tFri, 10 Mar 2023 14:44:03 +0100 (CET)","from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com\n\t[IPv6:2607:f8b0:4864:20::b2f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E9D04603B1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Mar 2023 14:44:01 +0100 (CET)","by mail-yb1-xb2f.google.com with SMTP id v13so5368614ybu.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Mar 2023 05:44:01 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678455843;\n\tbh=cwXvb/Mk5r4QE85qNIfBglSVZApVJjKy+x+u21xdLt0=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=YHRyZX5llzhUPHZtVPw+abfLgL420eYIHOi7/cTNtA8sQK3fDpMECXpu+muBiauYt\n\tuAsOvA6w89Ys+QCgjMx1Nm1E6WNDUd6jYMrmgRHgcnkQO5GcDsMvFfqmJFhnGGBHnn\n\tIjYo1raIxP+xp0zlXzDdSK688M7e3Cle09Gqxx8i9ZqItKyaV4DyWFGMLD0jAjoWMp\n\tRF0oyNEE+bD8nAqBab8+zH6VMEmLV+5CTNe3LFkMVlNARCJxrnfvcFrbKR8kIbABAn\n\tjprJCDiQZhDIB5I2q2lqsJrD8hqOJVVaB1y+jSEuHv0TdAbiFj0PiTM1HBq2QiNBAX\n\t6AWAceIpdTmEA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1678455841;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=bFk6pPf0GTK/ZBDFMr+ImVcHFziwjtT9VK4ADrU0+rE=;\n\tb=FSBDJrte8IJkYu32sHUtdSVssMEV4I/4pDVSYrpmwdVG46cfU+W3oUcj/zXGW+XU6U\n\tRbVkh45raMIraDENUeFyZE52I+wjhTxVdVmQuzzI80tK72uNnMC8t12XB4V+5ouvbkjS\n\tf7xZW0YRaUqTde1StBtH8zeGW/vnvVKOl7H5osqSylqKZLQ1B8VPkPbhkbEDtLnjCDqv\n\tFW5lup5reMC8J+opLl/BQiTc98U8nt3oGiVVDhv8/0jTcMnuZUQ5cWVso4bf63oGmwDx\n\tTabpQ3veB9s4O7bwAO+I8WgFB9jbCxdiWXAbBhMJgbEhZeiah96tyOMm3R2Nsrt+KhGS\n\tKmzA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"FSBDJrte\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112; t=1678455841;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=bFk6pPf0GTK/ZBDFMr+ImVcHFziwjtT9VK4ADrU0+rE=;\n\tb=H6sHhe3m/WUnRjg4F3ftYR06VXHt3OIJ8E7is3d+GngF6uuEIqaeGzyj9jRJXkOppU\n\t224zU4Rm54CfjYSf0inlA0dJqqUvYBn1jlPKMiWYFGGAANLaZIrini6C1RblonJDx9Pm\n\tcK8lYBLaTfpupnjn+YznIDo+IzRh5J9wJtyXcbJ34/xD1UXxZvv6WkHe6ib3Tdiamos0\n\t/yYDQbQkP6/0toJstJ2832B2jMwua3jSWF5cBWpSl6D+kO+VK7vYGOML/GC5r7z56VOa\n\t1UwLUkO9ugIUfUGPBGH5y55MI0dFHBRDx/RXNJq4vQWb4HRx7KcQMEsz/rxFgz0FJu36\n\tlFew==","X-Gm-Message-State":"AO0yUKXnXUJCopzXRWtqH4GkfgfmbAsURPA5YoobKfr9ZwWQUglPTgR6\n\tMv2nBa4CFxUmp7pEJuzRB76ZqcL1mKt6J2hn+87elepZyxnMFInt5Q8=","X-Google-Smtp-Source":"AK7set9KuZJNCOGdoA7zoVVg0YfLbNtcpL9CfG4zt2RdO8HzXL0nlbF5mXkpyWzz8IsTMe8xthf/EZI1+U5rtcOMT5o=","X-Received":"by 2002:a25:f210:0:b0:b30:e597:fee6 with SMTP id\n\ti16-20020a25f210000000b00b30e597fee6mr803736ybe.6.1678455840689;\n\tFri, 10 Mar 2023 05:44:00 -0800 (PST)","MIME-Version":"1.0","References":"<20230310095126.27236-1-naush@raspberrypi.com>\n\t<20230310104033.GD5342@pendragon.ideasonboard.com>\n\t<20230310115853.r25hguxvyb2wdqqr@gonzo.waveform.org.uk>\n\t<20230310134111.GH5342@pendragon.ideasonboard.com>","In-Reply-To":"<20230310134111.GH5342@pendragon.ideasonboard.com>","Date":"Fri, 10 Mar 2023 13:43:44 +0000","Message-ID":"<CAEmqJPrYyZgtc5nQ3DoMH8KsaFbv5GT7bdBJoN4U8tGtQpqCeQ@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"00000000000027eff305f68bf46a\"","Subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Fix crash under LTO","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Dave Jones <dave.jones@canonical.com>,\n\tlibcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26628,"web_url":"https://patchwork.libcamera.org/comment/26628/","msgid":"<20230310213112.vd6st6wpuzrleajq@gonzo.waveform.org.uk>","date":"2023-03-10T21:31:12","subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Fix crash under LTO","submitter":{"id":158,"url":"https://patchwork.libcamera.org/api/people/158/","name":"Dave Jones","email":"dave.jones@canonical.com"},"content":"On Fri, Mar 10, 2023 at 01:43:44PM +0000, Naushir Patuck wrote:\n>On Fri, 10 Mar 2023 at 13:41, Laurent Pinchart <\n>laurent.pinchart@ideasonboard.com> wrote:\n[snip]\n>> Unless I'm mistaken, given that you're using a unique pointer, the\n>> object will get deleted at deinit time. It should thus be functionally\n>> equivalent to the static variable in v2.\n>>\n>> We *could* allocate the objects dynamically without std::unique_ptr to\n>> avoid deinit issues, but we would then leak memory. That won't cause any\n>> issue in production, but for development it's nice if we can run\n>> libcamera applications under valgrind and expect no leaks.\n\nThe valgrind point is certainly a powerful argument in favour of using a \nstatic object here.\n\n>The unique_ptr was my addition to avoid leaks in debug.\n>I think using a static object like in v2 ought to be good for this fix.\n\nYes, it's a much nicer \"read\" than repeating all the map gubbins.","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 6BA09BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Mar 2023 21:31:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 91E06626D8;\n\tFri, 10 Mar 2023 22:31:16 +0100 (CET)","from smtp-relay-internal-0.canonical.com\n\t(smtp-relay-internal-0.canonical.com [185.125.188.122])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CFF26626A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Mar 2023 22:31:14 +0100 (CET)","from mail-ed1-f71.google.com (mail-ed1-f71.google.com\n\t[209.85.208.71])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id\n\tEFFC43F07F for <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Mar 2023 21:31:13 +0000 (UTC)","by mail-ed1-f71.google.com with SMTP id\n\tq13-20020a5085cd000000b004af50de0bcfso9548232edh.15\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Mar 2023 13:31:13 -0800 (PST)","from localhost (waveform.plus.com. [80.229.34.140])\n\tby smtp.gmail.com with ESMTPSA id\n\to1-20020a05600c4fc100b003e2096da239sm1120651wmq.7.2023.03.10.13.31.13\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 10 Mar 2023 13:31:13 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678483876;\n\tbh=sNGRn/E3l+WfBupLyn3JbOQSqR/7vumoybKA/DCyXVs=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=ySwlmZHYYsy7JoDbyjpGKi1Y9Qou1GmoP5itHoLGf21dgAMx4JcRIaYAZXRpm/48l\n\tl+VaLEdI0viJcOBEjwtLWTDXqigo0GppCmDvgfO3clXmJ5o6PqSaZCdOE5zUnHGTc/\n\t4KoxhpGiDSFg7Ginc4++0QgIePf4HZmlYlJCSMyEpoLNt1RDezqK4JWuZVktL05+1e\n\t2CPAfSw3m3Dht4MeHUd+UkShitzZv7YpugN+6eigaAr8rqNjhgU6nNiFStKBs5e3pk\n\tLbiDsM++UAgOSdxYMTB0lbGmgp70LzxttXGT7N0l8PDY3djr3/V/zXDp1q4tW6DLoP\n\tsNS4ocq2Qqk9A==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com;\n\ts=20210705; t=1678483873;\n\tbh=GzozPEIZgGyMQFzKFvFK6CkuYzNL6gSTds9PPoBBDuU=;\n\th=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:\n\tContent-Type:In-Reply-To;\n\tb=bKLaretjwEZeLpit6aXs+bQJyXCEm2vYbTgKU5b4PvDlMojThp7x1YcM0goH114oc\n\t9gd4VlRi4cxCgMCadpmhQWIPPFfwRO8e2Gz6BLwLvfL2aLZ0RGkTe6zbIi4xnZHUht\n\t58bOGH7xZhZobl8vv67e5NEe+vTv4yRLdqChoPlcgRrVj4eYYGXHhqIwTn7bMQLPh4\n\tGOccLoGE51Nt9TXbXoSTQYjVmEU/NggMyvFBAsIGpuRYjr3Cf/esPz2znuvOMVc5sY\n\tLc36chYPQjvfRY4+YswwUjBwhItdMtr404SH5SmPU5bwnHdt9YIK1Xbu8dEKu7Awxm\n\tpFRMacdoza+Hw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=canonical.com\n\theader.i=@canonical.com\n\theader.b=\"bKLaretj\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112; t=1678483873;\n\th=user-agent:in-reply-to:content-disposition:mime-version:references\n\t:message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=GzozPEIZgGyMQFzKFvFK6CkuYzNL6gSTds9PPoBBDuU=;\n\tb=k9h+qCABQUQdktHN7TBPj0Iz+4I9nWVe1m/Sq9QzNjrEMoX8M8YL1jPqPzW6ZfBi/8\n\tT6MDeFqepyQWwN76AlTI/yj3CmD5VzsQssNl7KG05xT2PnZS1ejscmYrw6HZV1qtdN00\n\tUnx/8M3fO/w22lF0qQ8laovGxbKlSkcpdUV81FnQvD5RL1hecYiqoWDlvuuXoaTZJ3T8\n\tVcJx8Q+gsBNtCRmL0mdZvZXN/0o4JF1JpjbPopmM2c51azohi7FFsYGyEGU5nWdDUj+h\n\tm524eAWp224345aCdZ1OP0ynfFfyEs6IJRb0L/O+52q233AwnwH3i2nk3MdloXakbraj\n\tn0dg==","X-Gm-Message-State":"AO0yUKVxeLUAp9WOGO6KTYMyHZ9OHej0hDzQYx1cv9YUO+klLftfd+Cc\n\t6X/dH89btSLWMtuCW6DR2cGeLO6fueuoSVk/LGVVj6wwegTcp8P3gHkx6z7arr550wQr0wkwtAu\n\tW5oc5kHTCWN2uTBd3z226DDtHTtXOPXGzLrf38GDxe83xr4rBx5o=","X-Received":["by 2002:a17:906:b791:b0:8e3:8543:8e71 with SMTP id\n\tdt17-20020a170906b79100b008e385438e71mr25961991ejb.40.1678483873635; \n\tFri, 10 Mar 2023 13:31:13 -0800 (PST)","by 2002:a17:906:b791:b0:8e3:8543:8e71 with SMTP id\n\tdt17-20020a170906b79100b008e385438e71mr25961978ejb.40.1678483873347; \n\tFri, 10 Mar 2023 13:31:13 -0800 (PST)"],"X-Google-Smtp-Source":"AK7set9KP2wvNxQJDfhY5tHPRs4aXRvh+kzEKH0zQ3P0lgP72ee+EORAEQL1LI97ebMGsuwAY+Rc3w==","Date":"Fri, 10 Mar 2023 21:31:12 +0000","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20230310213112.vd6st6wpuzrleajq@gonzo.waveform.org.uk>","References":"<20230310095126.27236-1-naush@raspberrypi.com>\n\t<20230310104033.GD5342@pendragon.ideasonboard.com>\n\t<20230310115853.r25hguxvyb2wdqqr@gonzo.waveform.org.uk>\n\t<20230310134111.GH5342@pendragon.ideasonboard.com>\n\t<CAEmqJPrYyZgtc5nQ3DoMH8KsaFbv5GT7bdBJoN4U8tGtQpqCeQ@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii; format=flowed","Content-Disposition":"inline","In-Reply-To":"<CAEmqJPrYyZgtc5nQ3DoMH8KsaFbv5GT7bdBJoN4U8tGtQpqCeQ@mail.gmail.com>","User-Agent":"NeoMutt/20211029","Subject":"Re: [libcamera-devel] [PATCH] ipa: raspberrypi: Fix crash under LTO","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>","From":"Dave Jones via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Dave Jones <dave.jones@canonical.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]