In `GetGlobalSizeFromDescriptor` we use `dladdr` to get info on the the current address. `dladdr` returns 0 if it failed. During testing on Linux this returned 0 to indicate failure, and populated the `info` structure with a NULL pointer which was dereferenced later. This patch checks for `dladdr` returning 0, and in that case returns 0 from `GetGlobalSizeFromDescriptor` to indicate failure of identifying the address. This occurs when `GetModuleNameAndOffsetForPC` succeeds for some address not in a dynamically loaded library. One example is when the found "module" is '[stack]' having come from parsing /proc/self/maps. Cherry-pick from 83ac18205ec69a00ac2be3b603bc3a61293fbe89. Differential Revision: https://reviews.llvm.org/D91344 |
||
|---|---|---|
| .. | ||
| asan | ||
| builtins | ||
| hwasan | ||
| include | ||
| interception | ||
| libbacktrace | ||
| lsan | ||
| sanitizer_common | ||
| tsan | ||
| ubsan | ||
| acinclude.m4 | ||
| aclocal.m4 | ||
| ChangeLog | ||
| config.h.in | ||
| configure | ||
| configure.ac | ||
| configure.tgt | ||
| HOWTO_MERGE | ||
| libsanitizer.spec.in | ||
| LICENSE.TXT | ||
| LOCAL_PATCHES | ||
| Makefile.am | ||
| Makefile.in | ||
| MERGE | ||
| merge.sh | ||
| README.gcc | ||
AddressSanitizer and ThreadSanitizer (https://github.com/google/sanitizers) are projects initially developed by Google Inc. Both tools consist of a compiler module and a run-time library. The sources of the run-time library for these projects are hosted at https://github.com/llvm/llvm-project in the following directories: compiler-rt/include/sanitizer compiler-rt/lib/sanitizer_common compiler-rt/lib/interception compiler-rt/lib/asan compiler-rt/lib/tsan compiler-rt/lib/lsan compiler-rt/lib/ubsan compiler-rt/lib/hwasan Trivial and urgent fixes (portability, build fixes, etc.) may go directly to the GCC tree. All non-trivial changes, functionality improvements, etc. should go through the upstream tree first and then be merged back to the GCC tree. The merges from upstream should be done with the aid of the merge.sh script; it will also update the file MERGE to contain the upstream revision we merged with.