ci/build: add ubsan build jobs

This adds build jobs to support Undefined Behaviour Sanitizer (UBSan),
both in x86_64 and arm64.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30880>
This commit is contained in:
Juan A. Suarez Romero
2024-07-29 11:54:15 +02:00
committed by Marge Bot
parent 48603f08fb
commit 37ee035e42
5 changed files with 64 additions and 8 deletions

View File

@@ -189,6 +189,34 @@ debian-testing-msan:
-D intel-clc=enabled -D intel-clc=enabled
-D install-intel-clc=true -D install-intel-clc=true
debian-testing-ubsan:
extends:
- debian-testing
stage: build-for-tests
timeout: 40m
variables:
C_ARGS: >
-Wno-error=stringop-overflow
-Wno-error=stringop-truncation
CPP_ARGS: >
-Wno-error=array-bounds
EXTRA_OPTION: >
-D b_sanitize=undefined
-D intel-clc=system
S3_ARTIFACT_NAME: ""
ARTIFACTS_DEBUG_SYMBOLS: 1
HOST_BUILD_OPTIONS: >
-D build-tests=false
-D enable-glcpp-tests=false
-D gallium-opencl=disabled
-D gallium-drivers=
-D vulkan-drivers=
-D video-codecs=
-D glx=disabled
-D platforms=
-D intel-clc=enabled
-D install-intel-clc=true
debian-build-testing: debian-build-testing:
extends: .meson-build extends: .meson-build
stage: build-for-tests stage: build-for-tests
@@ -350,12 +378,6 @@ fedora-release:
CPP_ARGS: > CPP_ARGS: >
-Wno-error=dangling-reference -Wno-error=dangling-reference
-Wno-error=overloaded-virtual -Wno-error=overloaded-virtual
C_LINK_ARGS: >
-Wno-error=stringop-overflow
-Wno-error=stringop-overread
CPP_LINK_ARGS: >
-Wno-error=stringop-overflow
-Wno-error=stringop-overread
DRI_LOADERS: > DRI_LOADERS: >
-D glx=dri -D glx=dri
-D gbm=enabled -D gbm=enabled
@@ -569,6 +591,26 @@ debian-arm64-asan:
S3_ARTIFACT_NAME: mesa-arm64-asan-${BUILDTYPE} S3_ARTIFACT_NAME: mesa-arm64-asan-${BUILDTYPE}
MESON_TEST_ARGS: "--no-suite mesa:compiler" MESON_TEST_ARGS: "--no-suite mesa:compiler"
debian-arm64-ubsan:
extends:
- debian-arm64
stage: build-for-tests
variables:
C_ARGS: >
-Wno-error=array-bounds
-Wno-error=stringop-overflow
-Wno-error=stringop-truncation
CPP_ARGS: >
-Wno-error=array-bounds
-fno-var-tracking-assignments
DRI_LOADERS:
-D glvnd=disabled
EXTRA_OPTION: >
-D b_sanitize=undefined
ARTIFACTS_DEBUG_SYMBOLS: 1
S3_ARTIFACT_NAME: mesa-arm64-ubsan-${BUILDTYPE}
MESON_TEST_ARGS: "--no-suite mesa:compiler"
debian-arm64-build-test: debian-arm64-build-test:
extends: extends:
- .meson-arm - .meson-arm

View File

@@ -82,6 +82,7 @@ DEPS=(
liblz4-1 liblz4-1
libpng16-16 libpng16-16
libpython3.11 libpython3.11
libubsan1
libvulkan1 libvulkan1
libwayland-client0 libwayland-client0
libwayland-server0 libwayland-server0

View File

@@ -184,6 +184,7 @@ PKG_CI=(
bash ca-certificates curl bash ca-certificates curl
initramfs-tools jq netcat-openbsd dropbear openssh-server initramfs-tools jq netcat-openbsd dropbear openssh-server
libasan8 libasan8
libubsan1
git git
python3-dev python3-pip python3-setuptools python3-wheel python3-dev python3-pip python3-setuptools python3-wheel
weston # Wayland weston # Wayland

View File

@@ -13,7 +13,7 @@
variables: variables:
DEBIAN_X86_64_BUILD_BASE_IMAGE: "debian/x86_64_build-base" DEBIAN_X86_64_BUILD_BASE_IMAGE: "debian/x86_64_build-base"
DEBIAN_BASE_TAG: "20241125-crosvm" DEBIAN_BASE_TAG: "20250109-libubsan1"
DEBIAN_X86_64_BUILD_IMAGE_PATH: "debian/x86_64_build" DEBIAN_X86_64_BUILD_IMAGE_PATH: "debian/x86_64_build"
DEBIAN_BUILD_TAG: "20241220-android" DEBIAN_BUILD_TAG: "20241220-android"
@@ -30,7 +30,7 @@ variables:
DEBIAN_TEST_ANDROID_TAG: "20241220-venus" DEBIAN_TEST_ANDROID_TAG: "20241220-venus"
DEBIAN_TEST_GL_TAG: "20241210-piglit-4c" DEBIAN_TEST_GL_TAG: "20241210-piglit-4c"
DEBIAN_TEST_VK_TAG: "20250103-vkd3d" DEBIAN_TEST_VK_TAG: "20250103-vkd3d"
KERNEL_ROOTFS_TAG: "20250103-vkd3d" KERNEL_ROOTFS_TAG: "20250109-libubsan1"
DEBIAN_PYUTILS_IMAGE: "debian/x86_64_pyutils" DEBIAN_PYUTILS_IMAGE: "debian/x86_64_pyutils"
DEBIAN_PYUTILS_TAG: "20241223-pyutils" DEBIAN_PYUTILS_TAG: "20241223-pyutils"

View File

@@ -259,6 +259,18 @@ yaml-toml-shell-py-test:
artifacts: false artifacts: false
- !reference [.required-for-hardware-jobs, needs] - !reference [.required-for-hardware-jobs, needs]
.baremetal-arm64-ubsan-test:
extends:
- .baremetal-test
- .use-debian/baremetal_arm64_test
variables:
S3_ARTIFACT_NAME: mesa-arm64-ubsan-debugoptimized
needs:
- debian/baremetal_arm64_test
- job: debian-arm64-ubsan
artifacts: false
- !reference [.required-for-hardware-jobs, needs]
.baremetal-deqp-test: .baremetal-deqp-test:
variables: variables:
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh" HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"