Index: lib/sanitizer_common/sanitizer_libignore.cc =================================================================== --- lib/sanitizer_common/sanitizer_libignore.cc +++ lib/sanitizer_common/sanitizer_libignore.cc @@ -89,10 +89,9 @@ } } if (lib->loaded && !loaded) { - Report("%s: library '%s' that was matched against called_from_lib" + VReport(1, "%s: library '%s' that was matched against called_from_lib" " suppression '%s' is unloaded\n", SanitizerToolName, lib->name, lib->templ); - Die(); } } Index: test/tsan/Linux/unload-suppressed-lib.c =================================================================== --- /dev/null +++ test/tsan/Linux/unload-suppressed-lib.c @@ -0,0 +1,27 @@ +// RUN: %clang_tsan -O1 %s -o %t -DCODE && %clang_tsan -fPIC -shared -DLIB %s -o %t.so && echo "called_from_lib:%t.so" > %t.sup && env TSAN_OPTIONS="suppressions=%t.sup:$TSAN_OPTION" %run %t %t.so 2>&1 +// CHECK-NOT that was matched against called_from_lib suppression +// CHECK foo(42)= +// CHECK dlclose(lib)= + +#ifdef CODE + +#include +#include +int main(int argc, char** argv) +{ + void * lib = dlopen(argv[1], RTLD_LAZY); + int (*foo)(int) = dlsym(lib, "foo"); + int res = foo(42); + printf("foo(42)=%i\n", res); + res = dlclose(lib); + printf("dlclose(lib)=%i\n", res); +} + +#endif // library + +#ifdef LIB +int foo(int bar){ + return bar+1; +} +#endif +