hanchenye-llvm-project/compiler-rt/lib
Kamil Rytarowski 4a282024db Correct atexit(3) support in MSan/NetBSD
Summary:
The NetBSD specific implementation of cxa_atexit() does not
preserve the 2nd argument if dso is equal to NULL.

Changes:

 - Split paths of handling intercepted __cxa_atexit() and atexit(3).
   This affects all supported Operating Systems.
 - Add a local stack-like structure to hold the __cxa_atexit() context.
   atexit(3) is documented in the C standard as calling callback from the
   earliest to the oldest entry. This path also fixes potential ABI
   problem of passing an argument to a function from the atexit(3)
   callback mechanism.
 - Allow usage of global vars with ctors in interceptors.
   This allows to use Vector without automatic cleaning up the structures.

This code has been modeled after TSan implementation for the same functions.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc

Reviewed By: vitalybuka

Subscribers: delcypher, devnexen, llvm-commits, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D40714

llvm-svn: 346579
2018-11-10 02:17:32 +00:00
..
BlocksRuntime
asan Re-land r343606 "[winasan] Unpoison the stack in NtTerminateThread" 2018-11-09 22:06:59 +00:00
builtins Compile and test i128 math builtins for Win64 2018-11-01 00:00:03 +00:00
cfi Unbreak linux cfi build 2018-10-01 18:14:02 +00:00
dfsan [dfsan] Fix build after r346262 2018-11-06 20:42:19 +00:00
esan Esan for FreeBSD, forgotten file. 2018-10-04 21:07:21 +00:00
fuzzer [fuzzer] Read files as binary 2018-11-06 23:25:25 +00:00
hwasan [hwasan] Add entire report to abort message on Android. 2018-11-09 21:54:03 +00:00
interception [interception] Switch to _type suffix instead of _f, NFC. 2018-10-22 20:54:48 +00:00
lsan [sanitizer] Fix mallopt interceptor. 2018-10-25 22:15:44 +00:00
msan Correct atexit(3) support in MSan/NetBSD 2018-11-10 02:17:32 +00:00
profile [GCOV] Close file mapping handle on Windows, so flushed gcda files can be removed while the process is in execution 2018-11-07 09:38:26 +00:00
safestack SafeStack: Fix thread liveness check on *BSD 2018-08-28 18:30:03 +00:00
sanitizer_common Introduce `sanitizer_malloc_introspect_t` for Darwin which is a sub-class of Darwin's `malloc_introspection_t` and use it when setting up the malloc zone. 2018-11-08 17:50:34 +00:00
scudo [sanitizer] Fix mallopt interceptor. 2018-10-25 22:15:44 +00:00
stats [CMake] Add compiler-rt header files to the list of sources for targets 2018-07-10 13:00:17 +00:00
tsan [sanitizer] Use "fast mmap" kernel flag for shadow memory on macOS 10.13.4+ 2018-11-06 19:55:19 +00:00
ubsan [compiler-rt][ubsan] Implicit Conversion Sanitizer - integer sign change - compiler-rt part 2018-10-30 21:58:54 +00:00
ubsan_minimal [ubsan-minimal] update comments in CMakeLists.txt 2018-10-30 01:20:12 +00:00
xray [XRay] Add a test for function id encoding/decoding (NFC) 2018-11-09 07:43:30 +00:00
CMakeLists.txt [cmake] Add a separate CMake var to control profile runtime 2017-10-02 05:03:55 +00:00