public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dmitry Vyukov <dvyukov@google.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: gcc <gcc@gcc.gnu.org>,
	ro@gcc.gnu.org, "Jakub Jelinek" <jakub@redhat.com>,
	"Martin Liška" <marxin@gcc.gnu.org>,
	"Marco Elver" <elver@google.com>,
	"Alexander Potapenko" <glider@google.com>
Subject: Re: New ThreadSanitizer runtime (v3)
Date: Mon, 22 Nov 2021 20:00:38 +0100	[thread overview]
Message-ID: <CACT4Y+YxdB9BnzGEgKuyv0uBA_cmfHMCw2JVfXojVDKeuR3Vvg@mail.gmail.com> (raw)
In-Reply-To: <1b8fa4e6-7a78-cdbb-c06d-fe7cd58d1e76@suse.cz>

On Mon, 22 Nov 2021 at 19:31, Martin Liška <mliska@suse.cz> wrote:
>
> On 11/22/21 16:22, Dmitry Vyukov wrote:
> > Hi gcc developers,
>
> Hello.
>
> >
> > I wanted to give heads up regarding a significant re-design of the
>
> Thanks for it.
>
> > ThreadSanitizer runtime:
> > https://reviews.llvm.org/D112603
> > Currently it's submitted:
> > https://github.com/llvm/llvm-project/commit/1784fe0532a69ead17793bced060a9bf9d232027
> > but can well be rolled back if too many buildbots fail, but should be
> > submitted again soon anyway.
> >
> > It was extensively tested and lots of bugs were fixed, but it's still
> > possible it will cause some issues just because of the size of the
> > change and OS/arch sensitivity.
> >
> > For a wide range of real programs it provides 20%-4x speedup on x86_64
> > and 20-40% memory consumption reduction.
>
> That are all good news!
>
> >
> > One issue that will come up with gcc is the use of the new
> > disable_sanitizer_instrumentation attribute in tests:
> > https://clang.llvm.org/docs/AttributeReference.html#disable-sanitizer-instrumentation
> > e.g.:
> > https://github.com/llvm/llvm-project/blob/1784fe0532a69ead17793bced060a9bf9d232027/compiler-rt/test/tsan/java_symbolization.cpp#L5
>
> Well, apparently the tsan tests (similarly to other Sanitizer) are not synchronized and we
> only have a small subset of test.
>
> Right now I'm working on the libsanitizer's merge from master and tsan.exp tests work fine.

Good. But I already reverted the change (some issues on Mac). Plan to
resubmit soon.

> > ThreadSanitizer is now more picky about recursing from runtime
> > callbacks back into runtime.
> > You may either disable these tests, or move callbacks into
> > non-instrumented files (though, will require forking tests), or
> > implement the attribute.
> > Some uses of the disable_sanitizer_instrumentation attribute were also
> > discussed in the Linux kernel context. KMSAN will use it and kernel
> > noinstr functions could use it, though currently noinstr functions are
> > post-processed with kernel's objtool, which nops any sanitizer
> > callbacks. The objtool approach will continue to work, so it's not
> > that the attribute is mandated.
> >
>
> Right now, we as GCC have no_sanitize ("sanitize_option") that can be used (or no_sanitize_* attributes).
>
> Can you please explain why did you invent the new flag?

Not sure about gcc, but in clang the old no_sanitize_thread attribute
disabled only part of instrumentation (only memory accesses, but not
atomics and function entry/exit). The new attribute disables all
instrumentation.

  reply	other threads:[~2021-11-22 19:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 15:22 Dmitry Vyukov
2021-11-22 18:30 ` Martin Liška
2021-11-22 19:00   ` Dmitry Vyukov [this message]
2021-11-22 19:07     ` Martin Liška
2021-11-22 19:54       ` Marco Elver
2021-11-22 19:20     ` Jakub Jelinek
2021-11-22 18:38 ` Martin Liška
2021-11-22 19:01   ` Dmitry Vyukov
2021-11-29 18:16     ` Martin Liška
2021-11-30  4:17       ` Dmitry Vyukov
2021-12-23 12:10         ` Martin Liška
2021-12-23 12:21           ` Dmitry Vyukov
2021-11-23 13:49 ` Florian Weimer
2021-11-23 13:51   ` Dmitry Vyukov
2021-11-23 13:59     ` Florian Weimer
2021-11-23 15:37       ` Dmitry Vyukov
2021-11-23 16:16         ` Florian Weimer
2021-11-23 16:52           ` Dmitry Vyukov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACT4Y+YxdB9BnzGEgKuyv0uBA_cmfHMCw2JVfXojVDKeuR3Vvg@mail.gmail.com \
    --to=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=gcc@gcc.gnu.org \
    --cc=glider@google.com \
    --cc=jakub@redhat.com \
    --cc=marxin@gcc.gnu.org \
    --cc=mliska@suse.cz \
    --cc=ro@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).