{"id":1364,"url":"https://patchwork.libcamera.org/api/patches/1364/?format=json","web_url":"https://patchwork.libcamera.org/patch/1364/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190605221817.966-4-paul.elder@ideasonboard.com>","date":"2019-06-05T22:18:10","name":"[libcamera-devel,RFC,03/10] libcamera: ipa_module: add loading error messages","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"791028d34b6205a5cd05a4be43e22ad0e670aa88","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1364/mbox/","series":[{"id":339,"url":"https://patchwork.libcamera.org/api/series/339/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=339","date":"2019-06-05T22:18:07","name":"Add IPA process isolation","version":1,"mbox":"https://patchwork.libcamera.org/series/339/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1364/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1364/checks/","tags":{},"headers":{"Return-Path":"<paul.elder@ideasonboard.com>","Received":["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 2A2F763B17\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Jun 2019 00:18:30 +0200 (CEST)","from localhost.localdomain (unknown [96.44.9.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5BBE62D1;\n\tThu,  6 Jun 2019 00:18:29 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1559773109;\n\tbh=PJPujODM+mZEHea8RunfQ7+YGDTZ/WytjuNJ9SWA8c8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=f1eFeDElaNkD682FjfsGxhdGJcUrwwmkdU/flO23cbw4rgCAZRVgs5KdmjMpjNtPo\n\to+yOoyDM43WsnMpIgMbEKaQfIiCEivyrMwBKKXUCbPFO8O7iOYtttF5zJNC9e1sgv1\n\tJ+bXsozQdIMl87/VSM1toZiYHlV+MOiuMeE0MDPk=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed,  5 Jun 2019 18:18:10 -0400","Message-Id":"<20190605221817.966-4-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20190605221817.966-1-paul.elder@ideasonboard.com>","References":"<20190605221817.966-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFC PATCH 03/10] libcamera: ipa_module: add\n\tloading error messages","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Wed, 05 Jun 2019 22:18:30 -0000"},"content":"Currently, if an IPAModule fails to be constructed due to size mismatch\nof struct IPAModuleInfo, the error is simply \"symbol not found\". Add an\nerror message to say that the symbol is found, but not valid.\n\nAlso add an error message to tell, if an IPA module failed to load, the\npath to the IPA module shared object that was attempted to be loaded.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/libcamera/ipa_module.cpp | 12 ++++++++++++\n 1 file changed, 12 insertions(+)","diff":"diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\nindex e1d4b27..84c77f7 100644\n--- a/src/libcamera/ipa_module.cpp\n+++ b/src/libcamera/ipa_module.cpp\n@@ -145,6 +145,12 @@ int elfLoadSymbol(void *dst, size_t size, void *map, size_t soSize,\n \t\t\ttargetSymbol = sym;\n \t\t\tbreak;\n \t\t}\n+\n+\t\tif (!strcmp(name, symbol)) {\n+\t\t\tLOG(IPAModule, Error)\n+\t\t\t\t<< \"Symbol \" << symbol\n+\t\t\t\t<< \" found, but not valid. Check module version.\";\n+\t\t}\n \t}\n \n \tif (targetSymbol == nullptr) {\n@@ -286,6 +292,12 @@ int IPAModule::loadIPAModuleInfo()\n \t\tret = -EINVAL;\n \t}\n \n+\tif (ret)\n+\t\tLOG(IPAModule, Error)\n+\t\t\t<< \"Error loading IPA module at \"\n+\t\t\t<< libPath_;\n+\n+\n unmap:\n \tmunmap(map, soSize);\n close:\n","prefixes":["libcamera-devel","RFC","03/10"]}