agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Andres Freund <andres@anarazel.de>
Subject: [PATCH v4 2/2] ci: use -fsanitize=undefined,alignment in linux tasks
Date: Thu, 29 Sep 2022 17:44:45 -0700
---
.cirrus.yml | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/.cirrus.yml b/.cirrus.yml
index a5679fdfb9b..93ea6524a7a 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -235,8 +235,28 @@ task:
CCACHE_DIR: /tmp/ccache_dir
DEBUGINFOD_URLS: "https://debuginfod.debian.net";
- CFLAGS: -Og -ggdb
- CXXFLAGS: -Og -ggdb
+ # Enable a reasonable set of sanitizers. Use the linux task for that, as
+ # it currently is the fastest task. Also several of the sanitizers work
+ # best on linux.
+ #
+ # The overhead of alignment sanitizer is low, undefined behaviour has
+ # moderate overhead. Test alignment sanitizer in the meson task, as it
+ # does both 32 and 64 bit builds and is thus more likely to expose
+ # alignment bugs.
+ #
+ # Address sanitizer in contrast somewhat expensive. Enable it in the
+ # autoconf task, as the meson task tests both 32 and 64bit.
+ #
+ # disable_coredump=0, abort_on_error=1: for useful backtraces in case of crashes
+ # print_stacktraces=1,verbosity=2, duh
+ # detect_leaks=0: too many uninteresting leak errors in short-lived binaries
+ UBSAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:verbosity=2
+ ASAN_OPTIONS: print_stacktrace=1:disable_coredump=0:abort_on_error=1:detect_leaks=0
+
+ # SANITIZER_FLAGS is set in the tasks below
+ CFLAGS: -Og -ggdb -fno-sanitize-recover=all $SANITIZER_FLAGS
+ CXXFLAGS: $CFLAGS
+ LDFLAGS: $SANITIZER_FLAGS
CC: ccache gcc
CXX: ccache g++
@@ -280,6 +300,9 @@ task:
matrix:
- name: Linux - Debian Bullseye - Autoconf
+ env:
+ SANITIZER_FLAGS: -fsanitize=address
+
configure_script: |
su postgres <<-EOF
./configure \
@@ -306,6 +329,7 @@ task:
env:
CCACHE_MAXSIZE: "400M" # tests two different builds
+ SANITIZER_FLAGS: -fsanitize=alignment,undefined
configure_script: |
su postgres <<-EOF
--
2.37.1.188.g71a8fab31b
--fu3iz7szz3tctxi7--
view thread (5+ messages) latest in thread
Message-ID: <no-message-id-634669@localhost>
Permalink: ../../no-message-id-634669@localhost/
Also on: postgresql.org/message-id/no-message-id-634669@localhost
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: andres@anarazel.de
Subject: Re: [PATCH v4 2/2] ci: use -fsanitize=undefined,alignment in linux tasks
In-Reply-To: <no-message-id-634669@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox