From patchwork Tue Aug 17 03:16:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 13372 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C2493BD87C for ; Tue, 17 Aug 2021 03:16:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 26010688A2; Tue, 17 Aug 2021 05:16:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="KdP55VHl"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 402B56025B for ; Tue, 17 Aug 2021 05:16:30 +0200 (CEST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C489F3E5 for ; Tue, 17 Aug 2021 05:16:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1629170189; bh=EDDit49NwvynLEAvC+fUOG963VEJS3llaSsh9siAE/Y=; h=From:To:Subject:Date:From; b=KdP55VHlgNOJWf/mdt3OV/8+XU+9X0GjvdSUW+uEImLaJ75rMi2458gUX2FwG1Wtx NRvsFVDAI8hIERsrWizLrP0+eDQiX+i/9hBJkX6kePQ8wzUOBFBtgyHgsfxdVyNifO WIy8fj8ta9tvgiBpn63P4ZoSFDjo9hGpFWnNhRNQ= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Tue, 17 Aug 2021 06:16:19 +0300 Message-Id: <20210817031619.11587-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] utils: ipc: ipa_proxy_worker: Log IPCUnixSocket::send() failures X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The IPCUnixSocket::send() function may fail, in which case it can be useful for debugging to log an error message that tells which event was affected. Do so. Reported-by: Coverity CID=354836 Reported-by: Coverity CID=354837 Reported-by: Coverity CID=354838 Reported-by: Coverity CID=354839 Reported-by: Coverity CID=354840 Reported-by: Coverity CID=354841 Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Umang Jain Reviewed-by: Kieran Bingham --- This stems from a Coverity report that complains about the lock of error checking for the return value of send(). As the send() function itself logs a message on failure, I'm not entirely sure if this is needed, but we do so when replying to synchronous methods, and there's no reason to have a different behaviour for events. We should either add a message here, or drop it from method replies. Kieran, is the Reported-by tag processed by any script ? Can I write Reported-by: Coverity CID=354836-354841 or something similar ? --- .../libcamera_templates/module_ipa_proxy_worker.cpp.tmpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl index 164a4dd64882..8a88bd467da7 100644 --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl @@ -164,7 +164,10 @@ private: {{proxy_funcs.serialize_call(method|method_param_inputs, "_message.data()", "_message.fds()")}} - socket_.send(_message.payload()); + int _ret = socket_.send(_message.payload()); + if (_ret < 0) + LOG({{proxy_worker_name}}, Error) + << "Sending event {{method.mojom_name}}() failed: " << _ret; LOG({{proxy_worker_name}}, Debug) << "{{method.mojom_name}} done"; }