**Related:** #117925 **About this PR:** This PR performs 3 small but related fixes for ASan users on Windows: 1. It ensures that the `allocator_may_return_null` flag is honored when set through the user function `__asan_default_options`. For more details, please see: #117925 2. It adds a missing `AllocatorMayReturnNull()` check inside `InternalAlloc` that's needed to avoid error'ing out when the allocator _correctly_ returns `null` when `allocator_may_return_null` is set. 3. In `sanitizer_win`'s `ReturnNullptrOnOOMOrDie`, it allows returning `null` when the last error is set to `ERROR_INVALID_PARAMETER` which may be set by `VirtualAlloc` on WIndows when attempting to allocate exceedingly large memory. I've added test cases that should cover these new behaviors. Happy to take on any feedback as well. Thank you :-) --------- Co-authored-by: David Justo <dajusto@microsoft.com>
AddressSanitizer RT
================================
This directory contains sources of the AddressSanitizer (ASan) runtime library.
Directory structure:
README.txt : This file.
Makefile.mk : File for make-based build.
CMakeLists.txt : File for cmake-based build.
asan_*.{cc,h} : Sources of the asan runtime library.
scripts/* : Helper scripts.
tests/* : ASan unit tests.
Also ASan runtime needs the following libraries:
lib/interception/ : Machinery used to intercept function calls.
lib/sanitizer_common/ : Code shared between various sanitizers.
ASan runtime currently also embeds part of LeakSanitizer runtime for
leak detection (lib/lsan/lsan_common.{cc,h}).
ASan runtime can only be built by CMake. You can run ASan tests
from the root of your CMake build tree:
make check-asan
For more instructions see:
https://github.com/google/sanitizers/wiki/AddressSanitizerHowToBuild