[{"id":35010,"web_url":"https://patchwork.libcamera.org/comment/35010/","msgid":"<175317679345.3923365.12890139214674048076@neptunite.rasen.tech>","date":"2025-07-22T09:33:13","subject":"Re: [PATCH v1] utils: codegen: proxy: Check `ipc_` instead of\n\t`isolate_`","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Barnabás,\n\nThanks for the patch.\n\nQuoting Barnabás Pőcze (2025-07-22 17:34:41)\n> Only try to send the \"Exit\" message if the `IPCPipeUnixSocket` object\n> exists. If the constructor fails, then `ipc_` might not be initialized,\n\nRight, I missed that when I originally wrote this...\n\n> which would lead to a nullptr dereference. This can still result in an\n> `ipc_->sendAsync()` call even if `ipc_` is unconnected, but that only\n> reports an error, and is still better than the status quo.\n> \n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=276\n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> ---\n>  .../generators/libcamera_templates/module_ipa_proxy.cpp.tmpl    | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n> index 9a3aadbd2..ba740a0de 100644\n> --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n> +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n> @@ -96,7 +96,7 @@ namespace {{ns}} {\n>  \n>  {{proxy_name}}::~{{proxy_name}}()\n>  {\n> -       if (isolate_) {\n> +       if (ipc_) {\n\nI wonder if ipc_ && isolate_ would be better?\n\n\nThanks,\n\nPaul\n\n>                 IPCMessage::Header header =\n>                         { static_cast<uint32_t>({{cmd_enum_name}}::Exit), seq_++ };\n>                 IPCMessage msg(header);\n> -- \n> 2.50.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 9D16EBDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Jul 2025 09:33:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AD95069025;\n\tTue, 22 Jul 2025 11:33:21 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9AF5C614F6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jul 2025 11:33:20 +0200 (CEST)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:5fe2:6df7:ad99:5884])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 7A89F16C5; \n\tTue, 22 Jul 2025 11:32:42 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"vFDBPI6H\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753176763;\n\tbh=eShU20TGuo7NnBVnvxTImNGohbJQcUQ9a9as5U+Tel4=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=vFDBPI6HrHtEr8KwhfzdALpyUGbiavMZ/abksbPqTSq/p7WtvRriMJ6Uuvo2LC/9u\n\tFenglOvYh6PtnPj277uqmR4NlIC76R1VNSwtlAMYf1Rkv3oh7pP76/yUH3zmmtRsVa\n\t1RXYLJkiqEqpean1izRP1N0ylQOjr8Qm61B3I4dM=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250722083441.1716976-1-barnabas.pocze@ideasonboard.com>","References":"<20250722083441.1716976-1-barnabas.pocze@ideasonboard.com>","Subject":"Re: [PATCH v1] utils: codegen: proxy: Check `ipc_` instead of\n\t`isolate_`","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 22 Jul 2025 18:33:13 +0900","Message-ID":"<175317679345.3923365.12890139214674048076@neptunite.rasen.tech>","User-Agent":"alot/0.0.0","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":35011,"web_url":"https://patchwork.libcamera.org/comment/35011/","msgid":"<f9cc5efa-d7d9-41e4-b28b-709afeefffa2@ideasonboard.com>","date":"2025-07-22T09:41:28","subject":"Re: [PATCH v1] utils: codegen: proxy: Check `ipc_` instead of\n\t`isolate_`","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 07. 22. 11:33 keltezéssel, Paul Elder írta:\n> Hi Barnabás,\n> \n> Thanks for the patch.\n> \n> Quoting Barnabás Pőcze (2025-07-22 17:34:41)\n>> Only try to send the \"Exit\" message if the `IPCPipeUnixSocket` object\n>> exists. If the constructor fails, then `ipc_` might not be initialized,\n> \n> Right, I missed that when I originally wrote this...\n> \n>> which would lead to a nullptr dereference. This can still result in an\n>> `ipc_->sendAsync()` call even if `ipc_` is unconnected, but that only\n>> reports an error, and is still better than the status quo.\n>>\n>> Bug: https://bugs.libcamera.org/show_bug.cgi?id=276\n>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n>> ---\n>>   .../generators/libcamera_templates/module_ipa_proxy.cpp.tmpl    | 2 +-\n>>   1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n>> index 9a3aadbd2..ba740a0de 100644\n>> --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n>> +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n>> @@ -96,7 +96,7 @@ namespace {{ns}} {\n>>   \n>>   {{proxy_name}}::~{{proxy_name}}()\n>>   {\n>> -       if (isolate_) {\n>> +       if (ipc_) {\n> \n> I wonder if ipc_ && isolate_ would be better?\n\nHmm... I would go the exact opposite way, and remove `isolate_` altogether.\n\n\nRegards,\nBarnabás Pőcze\n\n\n> \n> \n> Thanks,\n> \n> Paul\n> \n>>                  IPCMessage::Header header =\n>>                          { static_cast<uint32_t>({{cmd_enum_name}}::Exit), seq_++ };\n>>                  IPCMessage msg(header);\n>> -- \n>> 2.50.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 271A4C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Jul 2025 09:41:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2C2E169025;\n\tTue, 22 Jul 2025 11:41:34 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D112D614F6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jul 2025 11:41:32 +0200 (CEST)","from [192.168.33.11] (185.221.140.39.nat.pool.zt.hu\n\t[185.221.140.39])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 31D1F2209;\n\tTue, 22 Jul 2025 11:40:55 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"CWnuB14E\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753177255;\n\tbh=xHMGOdMbtsBMIdg9FzcOvOHerj2+HVtFD8E73xDKYZg=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=CWnuB14ES2mAr4rKQmSKhXWfBB82fiTiIxRmXkhQnhqtGHvbXCZPvBKq3KYYBHrRH\n\tfQkWKAL5uYoJOlaDxaO/lTnTIteb1A1ENTTt04ZoUBSCoWp5/t/TE55SBtI2xAB+oS\n\tssEWh/Te/O7G7MmuSOr6XtXCRvQQqQwo0KMf53N0=","Message-ID":"<f9cc5efa-d7d9-41e4-b28b-709afeefffa2@ideasonboard.com>","Date":"Tue, 22 Jul 2025 11:41:28 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v1] utils: codegen: proxy: Check `ipc_` instead of\n\t`isolate_`","To":"Paul Elder <paul.elder@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20250722083441.1716976-1-barnabas.pocze@ideasonboard.com>\n\t<175317679345.3923365.12890139214674048076@neptunite.rasen.tech>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<175317679345.3923365.12890139214674048076@neptunite.rasen.tech>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}},{"id":35029,"web_url":"https://patchwork.libcamera.org/comment/35029/","msgid":"<05b426ef-eea3-4648-ba6d-4ba70ebdf93a@ideasonboard.com>","date":"2025-07-22T15:24:46","subject":"Re: [PATCH v1] utils: codegen: proxy: Check `ipc_` instead of\n\t`isolate_`","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 07. 22. 11:41 keltezéssel, Barnabás Pőcze írta:\n> Hi\n> \n> 2025. 07. 22. 11:33 keltezéssel, Paul Elder írta:\n>> Hi Barnabás,\n>>\n>> Thanks for the patch.\n>>\n>> Quoting Barnabás Pőcze (2025-07-22 17:34:41)\n>>> Only try to send the \"Exit\" message if the `IPCPipeUnixSocket` object\n>>> exists. If the constructor fails, then `ipc_` might not be initialized,\n>>\n>> Right, I missed that when I originally wrote this...\n>>\n>>> which would lead to a nullptr dereference. This can still result in an\n>>> `ipc_->sendAsync()` call even if `ipc_` is unconnected, but that only\n>>> reports an error, and is still better than the status quo.\n>>>\n>>> Bug: https://bugs.libcamera.org/show_bug.cgi?id=276\n>>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n>>> ---\n>>>   .../generators/libcamera_templates/module_ipa_proxy.cpp.tmpl    | 2 +-\n>>>   1 file changed, 1 insertion(+), 1 deletion(-)\n>>>\n>>> diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n>>> index 9a3aadbd2..ba740a0de 100644\n>>> --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n>>> +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n>>> @@ -96,7 +96,7 @@ namespace {{ns}} {\n>>>   {{proxy_name}}::~{{proxy_name}}()\n>>>   {\n>>> -       if (isolate_) {\n>>> +       if (ipc_) {\n>>\n>> I wonder if ipc_ && isolate_ would be better?\n> \n> Hmm... I would go the exact opposite way, and remove `isolate_` altogether.\n\nI have a prototype that does that, so I would like to keep it `if (ipc_)`.\nPlease see the second version.\n\n\nRegards,\nBarnabás Pőcze\n\n\n> \n> \n> Regards,\n> Barnabás Pőcze\n> \n> \n>>\n>>\n>> Thanks,\n>>\n>> Paul\n>>\n>>>                  IPCMessage::Header header =\n>>>                          { static_cast<uint32_t>({{cmd_enum_name}}::Exit), seq_++ };\n>>>                  IPCMessage msg(header);\n>>> -- \n>>> 2.50.1\n>>>\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 85133BDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Jul 2025 15:24:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6AAA36903E;\n\tTue, 22 Jul 2025 17:24:51 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F160668F93\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jul 2025 17:24:49 +0200 (CEST)","from [192.168.33.11] (185.221.140.39.nat.pool.zt.hu\n\t[185.221.140.39])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DFD5D20EE;\n\tTue, 22 Jul 2025 17:24:11 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"c95kITjr\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753197852;\n\tbh=VALERNIG9c+5o2TAQ/yrBF08igW9+Z6oWKYiSkqK65Y=;\n\th=Date:Subject:From:To:References:Cc:In-Reply-To:From;\n\tb=c95kITjr0YHuemwIVgmjvau0imHkLhT+OfXhLXcpEiBYuwwFq8iySnC8NYPFb+9lH\n\t9MgX7vs+d1SkTEvZ5PwAeYf0P5/kIf1ssQgssqoJn73tEmbHfBnTtmqnVubR7EMjyI\n\tyzbOhSzidKrbG6E6vgUehZiTs3nhhlOT5LgTb7ec=","Message-ID":"<05b426ef-eea3-4648-ba6d-4ba70ebdf93a@ideasonboard.com>","Date":"Tue, 22 Jul 2025 17:24:46 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v1] utils: codegen: proxy: Check `ipc_` instead of\n\t`isolate_`","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","References":"<20250722083441.1716976-1-barnabas.pocze@ideasonboard.com>\n\t<175317679345.3923365.12890139214674048076@neptunite.rasen.tech>\n\t<f9cc5efa-d7d9-41e4-b28b-709afeefffa2@ideasonboard.com>","Content-Language":"en-US, hu-HU","Cc":"libcamera-devel@lists.libcamera.org","In-Reply-To":"<f9cc5efa-d7d9-41e4-b28b-709afeefffa2@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}}]