From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id EAEEB3858C50; Tue, 12 Jul 2022 11:45:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EAEEB3858C50 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Add tsan-suppressions.txt X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 02f0597c46892c4b69e0af45a95509bf310c759e X-Git-Newrev: 09559238fdcca6ffa2ddfdd6a89ac919a9ccb80d Message-Id: <20220712114533.EAEEB3858C50@sourceware.org> Date: Tue, 12 Jul 2022 11:45:33 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2022 11:45:34 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D09559238fdcc= a6ffa2ddfdd6a89ac919a9ccb80d commit 09559238fdcca6ffa2ddfdd6a89ac919a9ccb80d Author: Tom de Vries Date: Tue Jul 12 13:45:30 2022 +0200 [gdb/testsuite] Add tsan-suppressions.txt =20 Add a new file tsan-suppressions.txt, to suppress the "unlock unlocked = mutex" problem in ncurses, filed in PR29328. =20 The file is added to the TSAN_OPTIONS in lib/gdb.exp. =20 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29328 Diff: --- gdb/testsuite/lib/gdb.exp | 26 ++++++++++++++++++++++++++ gdb/tsan-suppressions.txt | 18 ++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index a29b8f947c4..698dd14504e 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -32,6 +32,32 @@ if {$tool =3D=3D ""} { # (which will affect any spawned sub-process) to avoid this. append ::env(ASAN_OPTIONS) ",detect_leaks=3D0" =20 +# Add VAR_ID=3DVAL to ENV_VAR, unless ENV_VAR already contains a VAR_ID se= tting. + +proc set_sanitizer_default { env_var var_id val } { + global env + + if { ![info exists env($env_var) ] + || $env($env_var) =3D=3D "" } { + # Set var_id (env_var non-existing / empty case). + append env($env_var) $var_id=3D$val + return + } + + if { [regexp $var_id=3D $env($env_var)] } { + # Don't set var_id. It's already set by the user, leave as is. + # Note that we could probably get the same result by unconditionally + # prepending it, but this way is less likely to cause confusion. + return + } + + # Set var_id (env_var not empty case). + append env($env_var) : $var_id=3D$val +} + +set_sanitizer_default TSAN_OPTIONS suppressions \ + $srcdir/../tsan-suppressions.txt + # List of procs to run in gdb_finish. set gdb_finish_hooks [list] =20 diff --git a/gdb/tsan-suppressions.txt b/gdb/tsan-suppressions.txt new file mode 100644 index 00000000000..5f1e5dc7ea7 --- /dev/null +++ b/gdb/tsan-suppressions.txt @@ -0,0 +1,18 @@ +# Copyright (C) 2022 Free Software Foundation, Inc. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Problem in ncurses, see: +# - https://sourceware.org/bugzilla/show_bug.cgi?id=3D29328. +# - https://lists.gnu.org/archive/html/bug-ncurses/2022-07/msg00002.html +mutex:newterm