This is an archive of the discontinued LLVM Phabricator instance.

Add __lsan::ScopedInterceptorDisabler for strerror(3)
ClosedPublic

Authored by krytarowski on Sep 8 2019, 4:37 PM.

Details

Summary

strerror(3) on NetBSD uses internally TSD with a destructor that is never
fired for exit(3). It's correctly called for pthread_exit(3) scenarios.

This is a case when a leak on exit(3) is expected, unavoidable and harmless.

Diff Detail

Repository
rL LLVM

Event Timeline

krytarowski created this revision.Sep 8 2019, 4:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 8 2019, 4:37 PM
  • restrict __lsan::ScopedInterceptorDisabler to ASan and LSan
vitalybuka added inline comments.Sep 11 2019, 11:08 AM
lib/asan/asan_interceptors.cpp
259

could you please add this into sanitizer_common/
#ifndef COMMON_INTERCEPTOR_STRERROR
#define COMMON_INTERCEPTOR_STRERROR() {}
#endif

and define in asan and msan
#if NETBSD
#define COMMON_INTERCEPTOR_STRERROR() __lsan::ScopedInterceptorDisabler;
#fi

krytarowski retitled this revision from Add __lsan::ScopedInterceptorDisabler for strerror(3)/NetBSD to Add __lsan::ScopedInterceptorDisabler for strerror(3).
  • apply changes from review
krytarowski marked an inline comment as done.Sep 16 2019, 5:39 PM
vitalybuka added inline comments.Sep 16 2019, 6:26 PM
lib/lsan/lsan_interceptors.cpp
348

Why this one can't use COMMON_INTERCEPTOR_STRERROR?

krytarowski marked an inline comment as done.Sep 17 2019, 4:38 PM
krytarowski added inline comments.
lib/lsan/lsan_interceptors.cpp
348

sanitizer_common_interceptors.inc is not included in LSan.

Including it exceeds this patch scope.

vitalybuka accepted this revision.Sep 20 2019, 3:48 PM
This revision is now accepted and ready to land.Sep 20 2019, 3:48 PM
This revision was automatically updated to reflect the committed changes.