llvm-capstone/compiler-rt/test
Dan Liew 8efc3ccaf8 [Darwin] Fix a bug where the symbolizer would examine the wrong process.
Summary:
Previously `AtosSymbolizer` would set the PID to examine in the
constructor which is called early on during sanitizer init. This can
lead to incorrect behaviour in the case of a fork() because if the
symbolizer is launched in the child it will be told examine the parent
process rather than the child.

To fix this the PID is determined just before the symbolizer is
launched.

A test case is included that triggers the buggy behaviour that existed
prior to this patch. The test observes the PID that `atos` was called
on. It also examines the symbolized stacktrace. Prior to this patch
`atos` failed to symbolize the stacktrace giving output that looked
like...

```
  #0 0x100fc3bb5 in __sanitizer_print_stack_trace asan_stack.cpp:86
  #1 0x10490dd36 in PrintStack+0x56 (/path/to/print-stack-trace-in-code-loaded-after-fork.cpp.tmp_shared_lib.dylib:x86_64+0xd36)
  #2 0x100f6f986 in main+0x4a6 (/path/to/print-stack-trace-in-code-loaded-after-fork.cpp.tmp_loader:x86_64+0x100001986)
  #3 0x7fff714f1cc8 in start+0x0 (/usr/lib/system/libdyld.dylib:x86_64+0x1acc8)
```

After this patch stackframes `#1` and `#2` are fully symbolized.

This patch is also a pre-requisite refactor for rdar://problem/58789439.

Reviewers: kubamracek, yln

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D77623
2020-04-13 13:36:29 -07:00
..
asan [ASan] Fix issue where system log buffer was not cleared after reporting an issue. 2020-03-26 10:56:17 -07:00
BlocksRuntime
builtins [compiler-rt] [builtins] Fix logb / logbl tests 2020-02-20 10:16:03 +00:00
cfi [cfi][test] cross-dso/stats.cpp: don't assume the order of static constructors 2020-01-08 15:50:51 -08:00
crt Fix include guard and properly order __deregister_frame_info. 2019-11-12 14:54:41 -08:00
dfsan [DFSan] Add __dfsan_cmp_callback. 2020-02-28 15:49:44 -08:00
fuzzer [libFuzzer] Fix denominator in the "inputs have DFT" log line. 2020-02-19 11:05:14 -08:00
gwp_asan [GWP-ASan] Crash Handler API. 2020-02-05 15:39:17 -08:00
hwasan [compiler-rt] libhwasan interceptor ABI intercept longjmp/setjmp 2019-10-30 14:04:40 +00:00
interception
lsan [compiler-rt] [test] Disable ASLR on LSAN+ASAN tests on NetBSD 2019-12-18 17:21:14 +01:00
msan [msan] Fix sigaltstack false positive. 2020-03-23 16:17:31 -07:00
profile Fix simultaneous .gcda creation 2020-04-01 10:29:50 +09:00
safestack
sanitizer_common [Darwin] Fix a bug where the symbolizer would examine the wrong process. 2020-04-13 13:36:29 -07:00
scudo [Scudo] [GWP-ASan] Add GWP-ASan to Scudo Standalone. 2019-12-13 09:09:41 -08:00
shadowcallstack
tsan [TSAN] Fix infinite loop on targets where char is unsigned 2020-04-11 07:12:47 -05:00
ubsan Port ubsan nullability.c test to Windows 2020-03-03 13:18:58 -08:00
ubsan_minimal [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour 2019-10-10 09:25:02 +00:00
xray [compiler-rt] [test] Disable MPROTECT for XRay tests on NetBSD 2019-12-20 22:08:01 +01:00
.clang-format
CMakeLists.txt [compiler-rt] Disable fuzzer large.test when LLVM_ENABLE_EXPENSIVE_CHECKS=ON 2019-12-03 14:37:37 -08:00
lit.common.cfg.py Only add darwin_log_cmd lit shell test feature when the log can be queried. 2020-03-27 11:24:50 -07:00
lit.common.configured.in Revert abb00753 "build: reduce CMake handling for zlib" (PR44780) 2020-03-03 11:03:09 +01:00