How to use GCC "TSan" Thread Sanitizer?

Solution Verified - Updated -

Issue

  • How to use GCC "TSan" Thread Sanitizer?
  • Compiling and linking with -fsanitize=thread prints an error:
/usr/bin/ld: cannot find /usr/lib64/libtsan.so.0.0.0
collect2: error: ld returned 1 exit status

Environment

  • Red Hat Enterprise Linux 7 and later
  • GCC G++ GNU C and C++ Compiler 4.8 and later
  • ThreadSanitizer (TSan)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content