Patch Detail
Show a patch.
GET /api/patches/21814/?format=api
{ "id": 21814, "url": "https://patchwork.libcamera.org/api/patches/21814/?format=api", "web_url": "https://patchwork.libcamera.org/patch/21814/", "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": "<20241105151232.21254-1-laurent.pinchart@ideasonboard.com>", "date": "2024-11-05T15:12:32", "name": "[CI] Enable ASan wherever possible", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "a29cd642333d96ff5f1c2a0725331891d68b6bc0", "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/21814/mbox/", "series": [ { "id": 4770, "url": "https://patchwork.libcamera.org/api/series/4770/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4770", "date": "2024-11-05T15:12:32", "name": "[CI] Enable ASan wherever possible", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4770/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/21814/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/21814/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 EDC64BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 5 Nov 2024 15:12:42 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3F472653F5;\n\tTue, 5 Nov 2024 16:12:42 +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 65BEF6035B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 5 Nov 2024 16:12:40 +0100 (CET)", "from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 66C02874\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 5 Nov 2024 16:12:32 +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=\"je0uEvtc\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1730819552;\n\tbh=vMBdSGF4NNnAcKf7FOY1LJik2PUt4U5nyWu5tbyKkPE=;\n\th=From:To:Subject:Date:From;\n\tb=je0uEvtcrfj/AIQnSjoO4d6u+O59X6gCl1rodjPIjW1ZtApfJpXi0b8bRZyJHDVSK\n\tmVbCijAh/PQ4Ywp5xnXRo6rE9um7AFLnTrt6TA4eA6qNqqiU7IwphSETX1peavZUoF\n\tY98eUH/u1NoWgxr5LK1Wuu5PdGWgfHk5Cfsw2a7E=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[PATCH] [CI] Enable ASan wherever possible", "Date": "Tue, 5 Nov 2024 17:12:32 +0200", "Message-ID": "<20241105151232.21254-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.45.2", "MIME-Version": "1.0", "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>" }, "content": "The address sanitizer (ASan) reports issues at both build time and\nruntime. Enabling it in CI helps catching more issues.\n\nIdeally we would enable ASan for all builds. However, a bug in gcc 12\naffects the Debian bookworm build in release mode, so ASan can't be\nenabled unconditionally. To maximize test coverage, enable it in\nMESON_ALL_OPTIONS and in the test-unit build, and disable it explicitly\nwhere it causes issues.\n\nWhen build with clang, the ASan runtime needs to be separately installed\nfor the default clang versions shipped by Debian Bookworm and Trixie.\n\nThe former is a dependency of the clang package, by the latter isn't. It\nneeds to be manually added to the Bookworm and Trixie containers as\ntheir default clang versions rely on libclang-rt-dev.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\nThis causes the test-unit job of the CI pipeline to fail in the Python\nbindings unit test with the libcamera master branch, see\nhttps://gitlab.freedesktop.org/pinchartl/libcamera/-/pipelines/1304457.\nThe \"[PATCH 0/2] test: py: Fix unit test error with ASan\" series fixes\nthe text, see https://gitlab.freedesktop.org/pinchartl/libcamera/-/pipelines/1304469.\nI will merge the fix in libcamera before pushing this patch to the CI\nrepository.\n\n---\n .gitlab-ci/setup-container.sh | 11 +++++++++--\n gitlab-ci.yml | 19 ++++++++++++++++---\n 2 files changed, 25 insertions(+), 5 deletions(-)\n\n\nbase-commit: b3f48df7d9b104c88a59cf0cebc55b22d2ce368c", "diff": "diff --git a/.gitlab-ci/setup-container.sh b/.gitlab-ci/setup-container.sh\nindex 4e487d27e31a..d2909c7257d3 100755\n--- a/.gitlab-ci/setup-container.sh\n+++ b/.gitlab-ci/setup-container.sh\n@@ -94,14 +94,21 @@ archs=( amd64 )\n \n declare -A components\n \n-# Install additional gcc versions On Debian bullseye (gcc 9) and trixie (gcc\n-# 13).\n+# Install additional packages on a per distribution version basis.\n case $FDO_DISTRIBUTION_VERSION in\n 'bullseye')\n+\t# gcc 9 to expand compilation testing coverage.\n \tPKGS_LIBCAMERA_RUNTIME+=( g++-9 )\n \t;;\n+'bookworm')\n+\t# libclang-rt-dev for the clang ASan runtime.\n+\tPKGS_LIBCAMERA_RUNTIME_MULTIARCH+=( libclang-rt-dev )\n+\t;;\n 'trixie')\n+\t# gcc 13 to expand compilation testing coverage.\n \tPKGS_LIBCAMERA_RUNTIME+=( g++-13 )\n+\t# libclang-rt-dev for the clang ASan runtime.\n+\tPKGS_LIBCAMERA_RUNTIME_MULTIARCH+=( libclang-rt-dev )\n \t;;\n esac\n \ndiff --git a/gitlab-ci.yml b/gitlab-ci.yml\nindex 57e7cc69c74f..ea038ecb5921 100644\n--- a/gitlab-ci.yml\n+++ b/gitlab-ci.yml\n@@ -13,6 +13,7 @@ variables:\n KERNEL_VERSION: '6.6'\n MESON_ALL_OPTIONS: >-\n -D android=enabled\n+ -D b_sanitize=address\n -D cam=enabled\n -D documentation=enabled\n -D gstreamer=enabled\n@@ -24,6 +25,9 @@ variables:\n -D tracing=enabled\n -D udev=enabled\n -D v4l2=true\n+ # clang fails to link with ASan if --no-undefined is enabled.\n+ MESON_CLANG_OPTIONS: >-\n+ -D b_lundef=false\n PACKAGES: >-\n ca-certificates\n git\n@@ -54,17 +58,17 @@ include:\n .libcamera-ci.debian:11:\n variables:\n FDO_DISTRIBUTION_VERSION: 'bullseye'\n- FDO_DISTRIBUTION_TAG: '2024-10-18.1'\n+ FDO_DISTRIBUTION_TAG: '2024-11-05.1'\n \n .libcamera-ci.debian:12:\n variables:\n FDO_DISTRIBUTION_VERSION: 'bookworm'\n- FDO_DISTRIBUTION_TAG: '2024-10-18.1'\n+ FDO_DISTRIBUTION_TAG: '2024-11-05.1'\n \n .libcamera-ci.debian:13:\n variables:\n FDO_DISTRIBUTION_VERSION: 'trixie'\n- FDO_DISTRIBUTION_TAG: '2024-10-18.2'\n+ FDO_DISTRIBUTION_TAG: '2024-11-05.1'\n \n .container-debian:\n extends:\n@@ -176,12 +180,19 @@ build-full:debian:12:\n BUILD_TYPE: release\n CC: gcc-12\n CXX: g++-12\n+ # gcc 12.2.0 has a bug that triggers a false positive warning with ASan\n+ # in release builds (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105562).\n+ # Disable the address sanitizer for now.\n+ MESON_OPTIONS: >-\n+ ${MESON_ALL_OPTIONS}\n+ -D b_sanitize=none\n - ARCH: amd64\n BUILD_TYPE: debug\n CC: clang\n CXX: clang++\n MESON_OPTIONS: >-\n ${MESON_ALL_OPTIONS}\n+ ${MESON_CLANG_OPTIONS}\n -D qcam=disabled\n - ARCH: amd64\n BUILD_TYPE: release\n@@ -189,6 +200,7 @@ build-full:debian:12:\n CXX: clang++\n MESON_OPTIONS: >-\n ${MESON_ALL_OPTIONS}\n+ ${MESON_CLANG_OPTIONS}\n -D qcam=disabled\n - ARCH: armhf\n - ARCH: arm64\n@@ -375,6 +387,7 @@ test-unit:\n variables:\n BUILD_TYPE: debug\n MESON_OPTIONS: >-\n+ -D b_sanitize=address\n -D cam=disabled\n -D documentation=disabled\n -D gstreamer=enabled\n", "prefixes": [ "CI" ] }