public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* New ThreadSanitizer runtime (v3)
@ 2021-11-22 15:22 Dmitry Vyukov
  2021-11-22 18:30 ` Martin Liška
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Dmitry Vyukov @ 2021-11-22 15:22 UTC (permalink / raw)
  To: gcc
  Cc: ro, Jakub Jelinek, Martin Liška, Marco Elver, Alexander Potapenko

Hi gcc developers,

I wanted to give heads up regarding a significant re-design of the
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.

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
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.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-12-23 12:22 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22 15:22 New ThreadSanitizer runtime (v3) Dmitry Vyukov
2021-11-22 18:30 ` Martin Liška
2021-11-22 19:00   ` Dmitry Vyukov
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

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).