This is the first of several planned PRs to upstream the changes to the ASan runtime which have been completed internally by Microsoft.We are shipping this and several other changes built on top of LLVM 9 in the Visual Studio toolset.et. Our intention is to upstream our changes,
and then move our development of ASan for Windows to LLVM latest/trunk.
This PR consists of three major changes.
- Drop the hook_rtl_allocators flag. All the Heap* functions are just thin wrappers for their Rtl* counterparts and directly hooking them makes everything more robust.
- Keep track of all the ASan allocated memory associated with each heap so that on RtlDestroyHeap We can free the memory appropriately.
- Heaps with flags we do not currently support with the ASan allocator get passed through to the real Rtl* functions. This is required for applications which require special heaps such as the CLR runtime which requires an executable memory heap. This is an area for future improvement.
There is no Unlock call here. Could this be the cause of the hang?