diff mbox series

[12/19] configure: added tsan support for blacklist.

Message ID 20200522160755.886-13-robert.foley@linaro.org (mailing list archive)
State New, archived
Headers show
Series Add Thread Sanitizer support to QEMU | expand

Commit Message

Robert Foley May 22, 2020, 4:07 p.m. UTC
Initially put several files into blacklist that were
causing the most problems, namely bitops.c and bitmap.c.

Signed-off-by: Robert Foley <robert.foley@linaro.org>
---
 configure                 | 3 ++-
 tests/tsan/blacklist.tsan | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 tests/tsan/blacklist.tsan

Comments

Emilio Cota May 23, 2020, 5:27 p.m. UTC | #1
On Fri, May 22, 2020 at 12:07:48 -0400, Robert Foley wrote:
> Initially put several files into blacklist that were
> causing the most problems, namely bitops.c and bitmap.c.
> 
> Signed-off-by: Robert Foley <robert.foley@linaro.org>
> ---
>  configure                 | 3 ++-
>  tests/tsan/blacklist.tsan | 5 +++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
>  create mode 100644 tests/tsan/blacklist.tsan
> 
> diff --git a/configure b/configure
> index c95c54fb48..8a86a0638d 100755
> --- a/configure
> +++ b/configure
> @@ -6306,7 +6306,8 @@ if test "$have_asan" = "yes"; then
>  fi
>  if test "$have_tsan" = "yes" ; then
>    if test "$have_tsan_iface_fiber" = "yes" ; then
> -    QEMU_CFLAGS="-fsanitize=thread $QEMU_CFLAGS"
> +    QEMU_CFLAGS="-fsanitize=thread -fsanitize-blacklist="\
> +	        "\$(SRC_PATH)/tests/tsan/blacklist.tsan $QEMU_CFLAGS"

I presume the goal here is to fix these races later (my default assumption
is that warnings == races, since most warnings are indeed races). If so,
please consider making the suppression optional (via
"--extra-cflags=-fsanitize-blacklist=path-to-this-file"), since that
way the reports are likely to get more eyeballs.

Thanks,

		E.
Robert Foley May 26, 2020, 2:07 p.m. UTC | #2
On Sat, 23 May 2020 at 13:27, Emilio G. Cota <cota@braap.org> wrote:
>
> On Fri, May 22, 2020 at 12:07:48 -0400, Robert Foley wrote:
> > Initially put several files into blacklist that were
> > causing the most problems, namely bitops.c and bitmap.c.
> >
> > Signed-off-by: Robert Foley <robert.foley@linaro.org>
> > ---
> >  configure                 | 3 ++-
> >  tests/tsan/blacklist.tsan | 5 +++++
> >  2 files changed, 7 insertions(+), 1 deletion(-)
> >  create mode 100644 tests/tsan/blacklist.tsan
> >
> > diff --git a/configure b/configure
> > index c95c54fb48..8a86a0638d 100755
> > --- a/configure
> > +++ b/configure
> > @@ -6306,7 +6306,8 @@ if test "$have_asan" = "yes"; then
> >  fi
> >  if test "$have_tsan" = "yes" ; then
> >    if test "$have_tsan_iface_fiber" = "yes" ; then
> > -    QEMU_CFLAGS="-fsanitize=thread $QEMU_CFLAGS"
> > +    QEMU_CFLAGS="-fsanitize=thread -fsanitize-blacklist="\
> > +             "\$(SRC_PATH)/tests/tsan/blacklist.tsan $QEMU_CFLAGS"
>
> I presume the goal here is to fix these races later (my default assumption
> is that warnings == races, since most warnings are indeed races). If so,
> please consider making the suppression optional (via
> "--extra-cflags=-fsanitize-blacklist=path-to-this-file"), since that
> way the reports are likely to get more eyeballs.

Yes, the goal is to fix these later.  Will add an explanation of this in
blacklist.tsan.

We will make the blacklist optional, and also add some documentation
on how to use the blacklist in the TSan section of testing.rst.

Thanks & Regards,
-Rob

>
> Thanks,
>
>                 E.
diff mbox series

Patch

diff --git a/configure b/configure
index c95c54fb48..8a86a0638d 100755
--- a/configure
+++ b/configure
@@ -6306,7 +6306,8 @@  if test "$have_asan" = "yes"; then
 fi
 if test "$have_tsan" = "yes" ; then
   if test "$have_tsan_iface_fiber" = "yes" ; then
-    QEMU_CFLAGS="-fsanitize=thread $QEMU_CFLAGS"
+    QEMU_CFLAGS="-fsanitize=thread -fsanitize-blacklist="\
+	        "\$(SRC_PATH)/tests/tsan/blacklist.tsan $QEMU_CFLAGS"
     QEMU_LDFLAGS="-fsanitize=thread $QEMU_LDFLAGS"
   else
     echo "Cannot enable TSAN due to missing fiber annotation interface."
diff --git a/tests/tsan/blacklist.tsan b/tests/tsan/blacklist.tsan
new file mode 100644
index 0000000000..67dd809e96
--- /dev/null
+++ b/tests/tsan/blacklist.tsan
@@ -0,0 +1,5 @@ 
+# TSan is not happy about setting/getting of dirty bits,
+# for example, cpu_physical_memory_set_dirty_range,
+# and cpu_physical_memory_get_dirty.
+src:bitops.c
+src:bitmap.c