From nobody Sun Feb 8 17:47:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620313872; cv=none; d=zohomail.com; s=zohoarc; b=FU8F0GGMycmYO4uCorNXJnBzJz3kGw0gd7Bpe3pLJvLtyRQvtW0IY+I2nhJ3l/avGnf16hMkYAkfgANRwxdf+oeJx6uw0xyKQlklf/15EvzRjF44f+JwMqLGjVYGNnem1Du0aJWI0051s5SMw58rt9rtA4U9PNPA8klopajYopo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620313872; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XtIFzBx7R5PeKXlFxgJzGjcBNB1Nn7+guhs0LaBDGwM=; b=nmmyY3pVfQG6koYsZ6cok8BwcrxkbG31hnH1wvkDTC/xctPKjXRsqmNdnsfKpskbMFXSneWF5RveqTK/5QeEq9brlj4IgTpjdpw+9+Tjx9QEwiV00w+CNI2KbH47CXP1QemoY+sLJdNFR/BsSKeAbhdHva19XUlUhCJ7UQoLeuQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 162031387205294.94353060101616; Thu, 6 May 2021 08:11:12 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-174-PAWGOlqpO6mmqc19iI1BBA-1; Thu, 06 May 2021 11:11:07 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 24F8E1898297; Thu, 6 May 2021 15:11:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F3BB15C22B; Thu, 6 May 2021 15:11:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B586555356; Thu, 6 May 2021 15:11:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 146F8oCX008353 for ; Thu, 6 May 2021 11:08:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7E4DC189A5; Thu, 6 May 2021 15:08:50 +0000 (UTC) Received: from work.redhat.com (ovpn-113-21.ams2.redhat.com [10.36.113.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id C47F319C9B; Thu, 6 May 2021 15:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620313869; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XtIFzBx7R5PeKXlFxgJzGjcBNB1Nn7+guhs0LaBDGwM=; b=bAYMFTAD2niIQJRnJMBfn+EAg3fumm1Upb5b0KWepVCLIJpbtqypHjSlNy/BPGjKyO8cGw JQ5Zn7XSqLG2M2GYXVdo2BRVVuLza17haKmQB6NfAXFg4YwgSfn0P/b4usM5GhCDJ8f0Cg 4rZINeKG8YnBPvO1sgFKDsoOQcAxLJY= X-MC-Unique: PAWGOlqpO6mmqc19iI1BBA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 7/7] ci: Enable address and undefined behavior sanitizers Date: Thu, 6 May 2021 17:08:38 +0200 Message-Id: <20210506150838.30129-8-twiederh@redhat.com> In-Reply-To: <20210506150838.30129-1-twiederh@redhat.com> References: <20210506150838.30129-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" meson supports the following sanitizers: "address" (e.g. out-of-bounds memory access, use-after-free, etc.), "thread" (data races), "undefined" (e.g. signed integer overflow), and "memory" (use of uninitialized memory). Note that not all sanitizers are supported by all compilers, and that more sanitizers exist. Not all sanitizers can be enabled at the same time, but "address" and "undefined" can. Both thread and memory sanitizers require an instrumented build of all dependencies, including libc. gcc and clang use different implementations of these sanitizers and have proven to find different issues. Create CI jobs for both. Signed-off-by: Tim Wiederhake --- .gitlab-ci.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 89f618e678..4de4c30d7f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,6 +73,26 @@ stages: rpmbuild --nodeps -ta build/meson-dist/libvirt-*.tar.xz; fi =20 +.sanitizer_build_job: + stage: builds + image: $CI_REGISTRY_IMAGE/ci-ubuntu-2004:latest + needs: + - x64-ubuntu-2004-container + rules: + - if: "$TEMPORARILY_DISABLED" + allow_failure: true + - when: on_success + cache: + paths: + - ccache/ + key: "$CI_JOB_NAME" + before_script: + - *script_variables + script: + - meson build --werror -Db_lundef=3Dfalse -Db_sanitize=3D"$SANITIZER" + - ninja -C build; + - ninja -C build test; + # Jobs that we delegate to Cirrus CI because they require an operating # system other than Linux. These jobs will only run if the required # setup has been performed on the GitLab account (see ci/README.rst). @@ -521,6 +541,21 @@ mingw64-fedora-rawhide: NAME: fedora-rawhide CROSS: mingw64 =20 +# Sanitizers + +sanitize-gcc: + extends: .sanitizer_build_job + variables: + ASAN_OPTIONS: verify_asan_link_order=3D0 + CC: gcc + SANITIZER: address,undefined + +sanitize-clang: + extends: .sanitizer_build_job + variables: + CC: clang + SANITIZER: address,undefined + =20 # This artifact published by this job is downloaded by libvirt.org to # be deployed to the web root: --=20 2.26.3