MemorySanitizer checks for uninitialized memory and variable usage. It instruments each instruction to update 'shadow' memory which indicates which bits are 'poisoned', and inserts tests for dereferencing pointers and conditional branching which makes use of not fully initialized data. The instrumentation is done by the llvm::MemorySanitizerLegacyPass. Functions must opt-in to the instrumentation with the 'SanitizeMemory' attribute. MemorySanitizer relies on several TLS variables for storing the shadow value of function parameters and return values. The JIT makes calls to __emutls_get_address() to obtain the address off these variables, passing it the address of a __emutls_v.* control structure unique to the TLS variable. We replace the former with our own function through the symbol resolver, and the latter are represented by enum values, to allow obtaining the real TLS variable's address in C++ code. This is enabled behind a REACTOR_ENABLE_MEMORY_SANITIZER_INSTRUMENTATION flag. For now, only enable CMake builds. Bug: b/155148722 Change-Id: I6d755244589c9b0de19a283f9dff5d8a3bf6f24b Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49829 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| PowerVR_Examples @ 409c9d54 | ||
| SPIRV-Headers | Loading commit data... | |
| SPIRV-Tools | Loading commit data... | |
| angle | Loading commit data... | |
| astc-encoder | Loading commit data... | |
| benchmark @ e5ea03ce | ||
| boost | Loading commit data... | |
| cppdap @ 1fd23dda | ||
| glslang @ 81112685 | ||
| googletest @ 8ffb7e5c | ||
| json @ ed554144 | ||
| libbacktrace | Loading commit data... | |
| llvm-10.0 | Loading commit data... | |
| llvm-subzero | Loading commit data... | |
| marl | Loading commit data... | |
| stlport-cpp11-extension | Loading commit data... | |
| subzero | Loading commit data... | |
| .clang-format | Loading commit data... | |
| update-llvm-10.sh | Loading commit data... | |
| update-marl.sh | Loading commit data... | |
| update-spirvheaders.sh | Loading commit data... | |
| update-spirvtools.sh | Loading commit data... |