llvm-project/compiler-rt/test/msan
Evgenii Stepanov c5ea8e9138 Use-after-dtor detection for trivial base classes.
-fsanitize-memory-use-after-dtor detects memory access after a
subobject is destroyed but its memory is not yet deallocated.
This is done by poisoning each object memory near the end of its destructor.

Subobjects (members and base classes) do this in their respective
destructors, and the parent class does the same for its members with
trivial destructors.

Inexplicably, base classes with trivial destructors are not handled at
all. This change fixes this oversight by adding the base class poisoning logic
to the parent class destructor.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D119300
2022-03-16 18:20:27 -07:00
..
Linux [msan] Guard FP_XSTATE_MAGIC1 usage with SANITIZER_GLIBC 2022-02-04 10:15:11 -08:00
Unit [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.* 2019-06-27 20:56:04 +00:00
scandir_test_root
CMakeLists.txt Fix lld detection in standalone compiler-rt. 2019-10-24 14:46:10 -07:00
__strxfrm_l.cpp [compiler-rt] Fix compiler warnings and runtime errors in sanitizer RT strxfrm(_l) test cases. 2020-07-13 22:35:01 +00:00
alloca.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
allocator_mapping.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
backtrace.cpp [MSan] Enable for SystemZ 2020-04-16 12:15:01 +02:00
bsearch.cpp [msan] Add bsearch interceptor 2021-08-03 18:39:14 -07:00
c-strdup.c
chained_origin.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
chained_origin_empty_stack.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
chained_origin_limits.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
chained_origin_memcpy.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
chained_origin_memmove.cpp [MSan] Move origins for overlapped memory transfer 2021-01-21 02:11:26 +00:00
chained_origin_with_signals.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
check-handler.cpp sanitizer_common: deduplicate CheckFailed 2021-05-12 08:50:53 +02:00
check_mem_is_initialized.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
coverage-levels.cpp [compiler-rt][NFC]Fix Wdeprecated warnings for fsanitize-coverage 2020-05-27 02:37:30 +00:00
ctermid.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
cxa_atexit.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
death-callback.cpp [test] Fix unused FileCheck prefixes in compiler-rt 2021-02-01 22:32:13 -08:00
default_ignorelist.cpp [clang] accept -fsanitize-ignorelist= in addition to -fsanitize-blacklist= 2021-05-04 10:24:00 -04:00
dlerror.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
dlopen_executable.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
dso-origin.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
dtls_test.c [test] Detect glibc-2.27+ and XFAIL appropriate tests 2019-01-09 13:27:29 +00:00
dtor-base-access.cpp Use-after-dtor detection for trivial base classes. 2022-03-16 18:20:27 -07:00
dtor-bit-fields.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
dtor-derived-class.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
dtor-member.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
dtor-multiple-inheritance-nontrivial-class-members.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
dtor-multiple-inheritance.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
dtor-trivial-class-members.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
dtor-trivial.cpp
dtor-vtable-multiple-inheritance.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
dtor-vtable.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
errno.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
fgets_fputs.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
fork.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
fread_fwrite.cpp [compiler-rt] [test] Add missing %run to fread_fwrite MSAN test 2019-12-19 20:28:00 +01:00
fstat.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
fstat64.cpp [msan] Add interceptors for Linux 64-bit stat variants 2022-03-15 20:22:28 -07:00
fstatat64.cpp [msan] Add interceptors for Linux 64-bit stat variants 2022-03-15 20:22:28 -07:00
ftime.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
getaddrinfo-positive.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
getaddrinfo.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
getc_unlocked.c
getline.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
getloadavg.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
getutent.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
heap-origin.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
icmp_slt_allones.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
iconv.cpp [compiler-rt] [msan] Support POSIX iconv(3) on NetBSD 9.99.17+ 2019-11-04 01:08:53 +01:00
if_indextoname.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
ifaddrs.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
initgroups.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
inline.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
insertvalue_origin.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
interception_sigaction_test.cpp Fix sigaction interceptor to always correctly populate oldact 2020-08-12 10:11:56 -07:00
ioctl.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
ioctl_custom.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
libatomic.c [MSAN] Reintroduce libatomic load/store instrumentation 2020-08-14 20:31:10 +00:00
libatomic_load_exceptions.cpp [MSAN] Reintroduce libatomic load/store instrumentation 2020-08-14 20:31:10 +00:00
lit.cfg.py [MSan] Enable for SystemZ 2020-04-16 12:15:01 +02:00
lit.site.cfg.py.in [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.* 2019-06-27 20:56:04 +00:00
loop-scope.cpp msan, codegen, instcombine: Keep more lifetime markers used for msan 2019-08-26 22:15:50 +00:00
memcmp_test.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
mktime.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
mmap.cpp [MSan] Enable for SystemZ 2020-04-16 12:15:01 +02:00
mmap_below_shadow.cpp [MSan] Enable for SystemZ 2020-04-16 12:15:01 +02:00
msan_check_mem_is_initialized.cpp [msan] Print both shadow and user address 2021-10-07 17:56:46 -07:00
msan_copy_shadow.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
msan_dump_shadow.cpp [msan] Print both shadow and user address 2021-10-07 17:56:46 -07:00
msan_print_shadow.cpp [msan] Print both shadow and user address 2021-10-07 17:56:46 -07:00
msan_print_shadow2.cpp [msan] Print both shadow and user address 2021-10-07 17:56:46 -07:00
msan_print_shadow3.cpp [msan] Print both shadow and user address 2021-10-07 17:56:46 -07:00
mul_by_const.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
no_sanitize_memory.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
no_sanitize_memory_prop.cpp Mark test function as 'weak' to prevent interprocedural CSE. 2020-03-09 17:01:07 -07:00
noundef_analysis.cpp [msan] reflect the changed flag to the tests. 2022-01-16 20:48:05 +09:00
origin-store-long.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
param_tls_limit.cpp [compiler-rt] NFC: Fix trivial typo 2021-09-04 14:12:58 +05:30
poison_in_free.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
poison_in_signal.cpp [msan] Don't track origns in signal handlers 2021-08-05 13:53:20 -07:00
pr32842.c
preinit_array.cpp [msan] Disabled test failing on new GLIBC 2021-11-15 11:18:52 -08:00
print_stats.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
pthread_getattr_np_deadlock.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
pthread_getname_np.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
pthread_setcancelstate.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
qsort.cpp [msan] Fix underflow in qsort interceptor. 2020-01-06 16:12:52 -08:00
rand_r.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
readdir64.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
realloc-large-origin.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
realloc-origin.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
recover-dso.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
recover.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
report-demangling.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
scandir.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
scandir_null.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
scanf-allocate.cpp [msan] Support %ms in scanf. 2020-08-06 13:54:43 -07:00
scoped-interceptors.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
select.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
select_float_origin.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
select_origin.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
sem_getvalue.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
sigaction.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
sigaltstack.cpp [msan] Fix sigaltstack false positive. 2020-03-23 16:17:31 -07:00
signal_stress_test.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
sigwait.cpp test/msan/sigwait: Don't silently ignore assertion failures 2020-06-23 14:10:51 -07:00
sigwaitinfo.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
stack-origin.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
stack-origin2.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
stat64.cpp [msan] Add interceptors for Linux 64-bit stat variants 2022-03-15 20:22:28 -07:00
strcmp.c [msan][asan] Add runtime flag intercept_strcmp 2020-09-18 13:45:55 -07:00
strerror_r-non-gnu.c
strlen_of_shadow.cpp [MSan] Enable for SystemZ 2020-04-16 12:15:01 +02:00
strndup.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
strsignal.cpp [msan] strsignal interceptor 2022-02-17 18:13:35 -08:00
strxfrm.cpp [msan] Fix strxfrm test 2020-07-17 02:21:18 -07:00
sync_lock_set_and_test.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
test.h
textdomain.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
times.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
tls_reuse.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
tsearch.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
tzset.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
unaligned_read_origin.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
unpoison_param.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
unpoison_string.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
use-after-dtor.cpp Fix MSan test use-after-dtor.cpp under new pass manager 2020-05-08 09:12:41 -07:00
use-after-free.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
vararg.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
vector_cvt.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
vector_div.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
vector_select.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
wcsncpy.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00
wcsxfrm.cpp compiler-rt: Rename .cc file in test/msan to .cpp 2019-08-02 06:07:05 +00:00