[lsan] On Fuchsia, don't use atexit hook for leak checks
authorRoland McGrath <mcgrathr@google.com>
Wed, 23 Sep 2020 01:02:56 +0000 (18:02 -0700)
committerRoland McGrath <mcgrathr@google.com>
Wed, 23 Sep 2020 18:10:58 +0000 (11:10 -0700)
commit0caad9fe441d5ee562e96d8b30b5574b492a933a
tree4ceab14e1da413bba311abcb0ec2591d11b28255
parent5281ba1994bdd21309d694c44e43ed825294221c
[lsan] On Fuchsia, don't use atexit hook for leak checks

Fuchsia's system libraries are instrumented and use the lsan
allocator for internal purposes.  So leak checking needs to run
after all atexit hooks and after the system libraries' internal
exit-time hooks.  The <zircon/sanitizer.h> hook API calls the
__sanitizer_process_exit_hook function at exactly the right time.

Reviewed By: vitalybuka, phosek

Differential Revision: https://reviews.llvm.org/D86171
compiler-rt/lib/asan/asan_fuchsia.cpp
compiler-rt/lib/asan/asan_internal.h
compiler-rt/lib/asan/asan_posix.cpp
compiler-rt/lib/asan/asan_rtl.cpp
compiler-rt/lib/asan/asan_win.cpp
compiler-rt/lib/lsan/lsan.cpp
compiler-rt/lib/lsan/lsan.h
compiler-rt/lib/lsan/lsan_common_fuchsia.cpp
compiler-rt/lib/lsan/lsan_fuchsia.cpp
compiler-rt/lib/lsan/lsan_posix.cpp