[{"id":28666,"web_url":"https://patchwork.libcamera.org/comment/28666/","msgid":"<Zc3qQNgbEr9kqiqk@pyrite.rasen.tech>","date":"2024-02-15T10:41:04","subject":"Re: [PATCH v1] utils: mojom: Fix build error caused by the mojom\n\ttool update","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Naush,\n\nOn Thu, Feb 15, 2024 at 08:23:42AM +0000, Naushir Patuck wrote:\n> The update to the mojom tool in commit d17de86904f0 causes build errors\n> with gcc 12.2 release builds. One such error is:\n> \n> In file included from src/libcamera/proxy/worker/raspberrypi_ipa_proxy_worker.cpp:18:\n> In static member function ‘static libcamera::ipa::RPi::ProcessParams libcamera::IPADataSerializer<libcamera::ipa::RPi::ProcessParams>::deserialize(std::vector<unsigned char>::const_iterator, std::vector<unsigned char>::const_iterator, libcamera::ControlSerializer*)’,\n>     inlined from ‘void IPAProxyRPiWorker::readyRead()’ at src/libcamera/proxy/worker/raspberrypi_ipa_proxy_worker.cpp:302:70:\n> include/libcamera/ipa/raspberrypi_ipa_serializer.h:1172:32: error: ‘*(uint32_t*)((char*)&ret + offsetof(libcamera::ipa::RPi::ProcessParams, libcamera::ipa::RPi::ProcessParams::buffers.libcamera::ipa::RPi::BufferIds::bayer))’ may be used uninitialized [-Werror=maybe-uninitialized]\n>  1172 |                         return ret;\n> \n> The failure is caused by the new auto-generated IPA interface not\n> initialising POD types to a default value. This is because the updated\n> mojom library uses a new mojom.ValueKind class to represent POD types,\n> whereas the interface generator script uses the mojom.Kind class, which\n> is correct for the older mojom library.\n\nIndeed that seems to be the case. (Not sure why it didn't error out for me :S)\n\n> Fix this breakage by switching the interface generator script to use\n> mojom.ValueKind to test for POD types.\n> \n> Fixes: d17de86904f0 (\"utils: ipc: Update mojo\")\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nThank you for the fix.\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  utils/ipc/generators/mojom_libcamera_generator.py | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/utils/ipc/generators/mojom_libcamera_generator.py b/utils/ipc/generators/mojom_libcamera_generator.py\n> index 582818c98b5f..99d905de456c 100644\n> --- a/utils/ipc/generators/mojom_libcamera_generator.py\n> +++ b/utils/ipc/generators/mojom_libcamera_generator.py\n> @@ -72,7 +72,7 @@ def ParamsCommaSep(l):\n>  def GetDefaultValue(element):\n>      if element.default is not None:\n>          return element.default\n> -    if type(element.kind) == mojom.Kind:\n> +    if type(element.kind) == mojom.ValueKind:\n>          return '0'\n>      if IsFlags(element):\n>          return ''\n> -- \n> 2.34.1\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 B19AEC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Feb 2024 10:41:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C9B4762801;\n\tThu, 15 Feb 2024 11:41:13 +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 9423761CAC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Feb 2024 11:41:12 +0100 (CET)","from pyrite.rasen.tech (h175-177-049-156.catv02.itscom.jp\n\t[175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E6019183;\n\tThu, 15 Feb 2024 11:41:07 +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=\"HHcu0t/x\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1707993668;\n\tbh=pVsAm3Hy6RrfwYKtXy+MuHksEusnDqj7BtGniRHDXlA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=HHcu0t/xVuNS1gjDloYLAlVDkE+I1jaExS2eDHP5F+bXpvK4Uf/02uic66f88dz1w\n\tINdswhOnLCzpoKWmsa3XXDjf9vSzb6/dWYKbor+x6Ex+J0A9zpsP9SFAzdyWgKl2Mv\n\t5cc4hMUN1C8rqd6TjNCTTxDt1MqhsVhbmiTHVIuc=","Date":"Thu, 15 Feb 2024 19:41:04 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Subject":"Re: [PATCH v1] utils: mojom: Fix build error caused by the mojom\n\ttool update","Message-ID":"<Zc3qQNgbEr9kqiqk@pyrite.rasen.tech>","References":"<20240215082342.6437-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20240215082342.6437-1-naush@raspberrypi.com>","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28667,"web_url":"https://patchwork.libcamera.org/comment/28667/","msgid":"<170799397200.561469.9633653783106201404@ping.linuxembedded.co.uk>","date":"2024-02-15T10:46:12","subject":"Re: [PATCH v1] utils: mojom: Fix build error caused by the mojom\n\ttool update","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck (2024-02-15 08:23:42)\n> The update to the mojom tool in commit d17de86904f0 causes build errors\n> with gcc 12.2 release builds. One such error is:\n> \n> In file included from src/libcamera/proxy/worker/raspberrypi_ipa_proxy_worker.cpp:18:\n> In static member function ‘static libcamera::ipa::RPi::ProcessParams libcamera::IPADataSerializer<libcamera::ipa::RPi::ProcessParams>::deserialize(std::vector<unsigned char>::const_iterator, std::vector<unsigned char>::const_iterator, libcamera::ControlSerializer*)’,\n>     inlined from ‘void IPAProxyRPiWorker::readyRead()’ at src/libcamera/proxy/worker/raspberrypi_ipa_proxy_worker.cpp:302:70:\n> include/libcamera/ipa/raspberrypi_ipa_serializer.h:1172:32: error: ‘*(uint32_t*)((char*)&ret + offsetof(libcamera::ipa::RPi::ProcessParams, libcamera::ipa::RPi::ProcessParams::buffers.libcamera::ipa::RPi::BufferIds::bayer))’ may be used uninitialized [-Werror=maybe-uninitialized]\n>  1172 |                         return ret;\n> \n> The failure is caused by the new auto-generated IPA interface not\n> initialising POD types to a default value. This is because the updated\n> mojom library uses a new mojom.ValueKind class to represent POD types,\n> whereas the interface generator script uses the mojom.Kind class, which\n> is correct for the older mojom library.\n\nInteresting, that explains why we had to add\n - https://patchwork.libcamera.org/patch/19446/\n\nbut clearly it wasn't a complete solution.\n\n\n> \n> Fix this breakage by switching the interface generator script to use\n> mojom.ValueKind to test for POD types.\n> \n> Fixes: d17de86904f0 (\"utils: ipc: Update mojo\")\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  utils/ipc/generators/mojom_libcamera_generator.py | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/utils/ipc/generators/mojom_libcamera_generator.py b/utils/ipc/generators/mojom_libcamera_generator.py\n> index 582818c98b5f..99d905de456c 100644\n> --- a/utils/ipc/generators/mojom_libcamera_generator.py\n> +++ b/utils/ipc/generators/mojom_libcamera_generator.py\n> @@ -72,7 +72,7 @@ def ParamsCommaSep(l):\n>  def GetDefaultValue(element):\n>      if element.default is not None:\n>          return element.default\n> -    if type(element.kind) == mojom.Kind:\n> +    if type(element.kind) == mojom.ValueKind:\n\nYeah, I have no idea ;-) I'll leave this to Paul as he's the expert\nhere. But I'm happy to merge if we're sure it's the right fix, and all\nthe other tests pass.\n\nAcked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>          return '0'\n>      if IsFlags(element):\n>          return ''\n> -- \n> 2.34.1\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 7417ABDE17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Feb 2024 10:46:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CAA7962806;\n\tThu, 15 Feb 2024 11:46:15 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22E3B61CAC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Feb 2024 11:46:15 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7315A183;\n\tThu, 15 Feb 2024 11:46:11 +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=\"Dh1XheY4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1707993971;\n\tbh=bp9MU68gcIj2viLfgDCo5eyc9bttxbHUyWmIMKZgR5k=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=Dh1XheY4k8cuQJkYY+gcwol4hc8DFkcstLTYxasyVrzYRFM45MjAwUjX4bbULU51s\n\tKWREW0s8KqwqMFe03d8oofe8JayJAnMl+4xKeJnEXMzwtD/07vuQVzcByviG4Hxcy4\n\tt5Jzk0N6lx6Z/ZDraEK3RpMgD6iVoKR0Qt5YpAV0=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240215082342.6437-1-naush@raspberrypi.com>","References":"<20240215082342.6437-1-naush@raspberrypi.com>","Subject":"Re: [PATCH v1] utils: mojom: Fix build error caused by the mojom\n\ttool update","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 15 Feb 2024 10:46:12 +0000","Message-ID":"<170799397200.561469.9633653783106201404@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}},{"id":28668,"web_url":"https://patchwork.libcamera.org/comment/28668/","msgid":"<170799756054.252503.2250840095788236257@ping.linuxembedded.co.uk>","date":"2024-02-15T11:46:00","subject":"Re: [PATCH v1] utils: mojom: Fix build error caused by the mojom\n\ttool update","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck (2024-02-15 08:23:42)\n> The update to the mojom tool in commit d17de86904f0 causes build errors\n> with gcc 12.2 release builds. One such error is:\n> \n> In file included from src/libcamera/proxy/worker/raspberrypi_ipa_proxy_worker.cpp:18:\n> In static member function ‘static libcamera::ipa::RPi::ProcessParams libcamera::IPADataSerializer<libcamera::ipa::RPi::ProcessParams>::deserialize(std::vector<unsigned char>::const_iterator, std::vector<unsigned char>::const_iterator, libcamera::ControlSerializer*)’,\n>     inlined from ‘void IPAProxyRPiWorker::readyRead()’ at src/libcamera/proxy/worker/raspberrypi_ipa_proxy_worker.cpp:302:70:\n> include/libcamera/ipa/raspberrypi_ipa_serializer.h:1172:32: error: ‘*(uint32_t*)((char*)&ret + offsetof(libcamera::ipa::RPi::ProcessParams, libcamera::ipa::RPi::ProcessParams::buffers.libcamera::ipa::RPi::BufferIds::bayer))’ may be used uninitialized [-Werror=maybe-uninitialized]\n>  1172 |                         return ret;\n> \n> The failure is caused by the new auto-generated IPA interface not\n> initialising POD types to a default value. This is because the updated\n> mojom library uses a new mojom.ValueKind class to represent POD types,\n> whereas the interface generator script uses the mojom.Kind class, which\n> is correct for the older mojom library.\n> \n> Fix this breakage by switching the interface generator script to use\n> mojom.ValueKind to test for POD types.\n> \n> Fixes: d17de86904f0 (\"utils: ipc: Update mojo\")\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nCI-OK: https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1103947 \nMerged\n\n--\nThanks.\n\nKieran\n\n\n> ---\n>  utils/ipc/generators/mojom_libcamera_generator.py | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/utils/ipc/generators/mojom_libcamera_generator.py b/utils/ipc/generators/mojom_libcamera_generator.py\n> index 582818c98b5f..99d905de456c 100644\n> --- a/utils/ipc/generators/mojom_libcamera_generator.py\n> +++ b/utils/ipc/generators/mojom_libcamera_generator.py\n> @@ -72,7 +72,7 @@ def ParamsCommaSep(l):\n>  def GetDefaultValue(element):\n>      if element.default is not None:\n>          return element.default\n> -    if type(element.kind) == mojom.Kind:\n> +    if type(element.kind) == mojom.ValueKind:\n>          return '0'\n>      if IsFlags(element):\n>          return ''\n> -- \n> 2.34.1\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 DE4F7C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Feb 2024 11:46:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2F02462805;\n\tThu, 15 Feb 2024 12:46:04 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6265E61CB0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Feb 2024 12:46:03 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AE08F231;\n\tThu, 15 Feb 2024 12:45:59 +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=\"VxHr4gHA\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1707997559;\n\tbh=bJyDepYlnJ8ZfOtK/ddQSH1w5st8QATLAbxPpejaJAM=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=VxHr4gHA8sv6QJ9tFCXjv/EPhotD0Ex/km5AlMmpliA6V4DWVUJpjamLN9BAvIEcw\n\t0HWCAFYex2iexAQOPsy5ncME/U/l63mVeZHZ51WaM70WG6WTg2rQxAtlgcjU5NKOZ8\n\tOKW0LIGCDdJli19cBG93Py5ATxvTVBalycedmpZc=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240215082342.6437-1-naush@raspberrypi.com>","References":"<20240215082342.6437-1-naush@raspberrypi.com>","Subject":"Re: [PATCH v1] utils: mojom: Fix build error caused by the mojom\n\ttool update","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 15 Feb 2024 11:46:00 +0000","Message-ID":"<170799756054.252503.2250840095788236257@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}}]