Patch Detail
Show a patch.
GET /api/patches/18050/?format=api
{ "id": 18050, "url": "https://patchwork.libcamera.org/api/patches/18050/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18050/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20221222010132.22177-4-laurent.pinchart@ideasonboard.com>", "date": "2022-12-22T01:01:31", "name": "[libcamera-devel,v1,3/4] test: py: Fix test failure when ASan is enabled", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "fba87da0b1a8471c0901fba900da8b07aa0b2617", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18050/mbox/", "series": [ { "id": 3686, "url": "https://patchwork.libcamera.org/api/series/3686/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3686", "date": "2022-12-22T01:01:28", "name": "test: Various unit test cleanups", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3686/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18050/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18050/checks/", "tags": {}, "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 1D56CC3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Dec 2022 01:01:46 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D967D633BB;\n\tThu, 22 Dec 2022 02:01:45 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 36297633B7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Dec 2022 02:01:44 +0100 (CET)", "from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B0903903\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Dec 2022 02:01:43 +0100 (CET)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1671670905;\n\tbh=zQIClbYdYiQSRYHSWNfLXgH4Jd0Gt7Ham3eOMOnVLTw=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=QUBh+hTfq39uSz3IPYut/OaWcRvgt/yb/nArWXYL56QOOWPzCpoeBnUYQCQsP4S7G\n\t6wDrqYrKXrPoO99iF0dDurROuUhyL5Btbv3YuU3npr8JNwwXiS7VZ1vCwh7AjPVeMY\n\tw1WlYKgZfN0uoMoDoCswbiHXAo3dNWnzy17sUBl5GOViCdk7swo/WbDy4bzCI2nkoG\n\t+d0hpQxxle57doxBskNEi2MpC8iaxC1WhxJI0j42oRgEiQnrAZNNQlgjyEg5g7h7u4\n\tmH/92wfihI2ZtxlKImPcsgw+XgcqD8NWDsTB7xDDwiPC5XtM3D8NEsdB/uYV9e63Pl\n\tVSE6hS0qF3TWw==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1671670903;\n\tbh=zQIClbYdYiQSRYHSWNfLXgH4Jd0Gt7Ham3eOMOnVLTw=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=aQ74h6tcwxt3luLWaMHtkYhSmhVcWjceT4Ra33Am0C1zy48O995S/1s9ricZlYMrP\n\tY1nyTwMMs0RXzXHzowClCTgFv8uySaT1kmjkgCdYccUcb3hmBRd3Xb4niF3RmhZOLZ\n\tQszLex7aDHxVrj4mI3B6sPs0+QAulMU4AnNLZZ7I=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"aQ74h6tc\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 22 Dec 2022 03:01:31 +0200", "Message-Id": "<20221222010132.22177-4-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.38.2", "In-Reply-To": "<20221222010132.22177-1-laurent.pinchart@ideasonboard.com>", "References": "<20221222010132.22177-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v1 3/4] test: py: Fix test failure when\n\tASan is enabled", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "When the address sanitizer is enabled, the Python unit tests fail due to\nthe link order runtime check as the Python interpreter is (generally)\nnot linked to ASan. Fix this by LD_PRELOAD'ing the ASan runtime. We have\nto disable the leak detector as the Python interpreter itself leaks\nmemory, which would result in test failures.\n\nTo LD_PRELOAD the ASan runtime, the path to the binary needs to be\nknown. gcc gives us a generic way to get the path, but that doesn't work\nwith clang as the ASan runtime file name depends on the clang version\nand target architecture. We thus have to keep the Python test disabled\nwith ASan is enabled and libcamera is compiled with clang.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n test/py/meson.build | 17 ++++++++++++++++-\n 1 file changed, 16 insertions(+), 1 deletion(-)", "diff": "diff --git a/test/py/meson.build b/test/py/meson.build\nindex 2affdbd491a3..639f173594a8 100644\n--- a/test/py/meson.build\n+++ b/test/py/meson.build\n@@ -4,14 +4,29 @@ if not pycamera_enabled\n subdir_done()\n endif\n \n+# If ASan is enabled, the link order runtime check will fail as Python is not\n+# linked to ASan. LD_PRELOAD the ASAn runtime if available, or skip the test\n+# otherwise.\n+\n+if asan_runtime_missing\n+ warning('Unable to get path to ASan runtime, Python test disabled')\n+ subdir_done()\n+endif\n+\n pymod = import('python')\n py3 = pymod.find_installation('python3')\n \n pypathdir = meson.project_build_root() / 'src' / 'py'\n+py_env = ['PYTHONPATH=' + pypathdir]\n+\n+if asan_enabled\n+ # Disable leak detection as the Python interpreter is full of leaks.\n+ py_env += ['LD_PRELOAD=' + asan_runtime, 'ASAN_OPTIONS=detect_leaks=0']\n+endif\n \n test('pyunittests',\n py3,\n args : files('unittests.py'),\n- env : ['PYTHONPATH=' + pypathdir],\n+ env : py_env,\n suite : 'pybindings',\n is_parallel : false)\n", "prefixes": [ "libcamera-devel", "v1", "3/4" ] }