llvm-project/compiler-rt/lib
Reid Kleckner ad04914a53 [Windows] Fix UnmapOrDie and MmapAlignedOrDie
Now ASan can return virtual memory to the underlying OS. Portable
sanitizer runtime code needs to be aware that UnmapOrDie cannot unmap
part of previous mapping.

In particular, this required changing how we implement MmapAlignedOrDie
on Windows, which is what Allocator32 uses.

The new code first attempts to allocate memory of the given size, and if
it is appropriately aligned, returns early. If not, it frees the memory
and attempts to reserve size + alignment bytes. In this region there
must be an aligned address. We then free the oversized mapping and
request a new mapping at the aligned address immediately after. However,
a thread could allocate that virtual address in between our free and
allocation, so we have to retry if that allocation fails. The existing
thread creation stress test managed to trigger this condition, so the
code isn't totally untested.

Reviewers: samsonov

Differential Revision: http://reviews.llvm.org/D17431

llvm-svn: 263160
2016-03-10 20:47:26 +00:00
..
BlocksRuntime Move tests for BlocksRuntime and builtins to corresponding directories under test/ 2014-02-14 09:47:31 +00:00
asan sanitizer: Fix endianness checks for gcc 2016-03-09 23:39:40 +00:00
builtins Add ARM EHABI support to gcc_personality_v0. 2016-03-09 13:20:17 +00:00
cfi [CMake] Assign components and dependencies during add_compiler_rt_resource_file 2016-02-23 21:50:39 +00:00
dfsan [cmake] Address Samsonov's post-commit review of r262723 2016-03-05 10:01:04 +00:00
interception [cmake] Address Samsonov's post-commit review of r262723 2016-03-05 10:01:04 +00:00
lsan [cmake] Address Samsonov's post-commit review of r262723 2016-03-05 10:01:04 +00:00
msan [cmake] Address Samsonov's post-commit review of r262723 2016-03-05 10:01:04 +00:00
profile Fix test failure on darwin-i386 2016-03-09 21:45:37 +00:00
safestack [compiler-rt] [safestack] Enable for aarch64 2015-12-11 17:38:38 +00:00
sanitizer_common [Windows] Fix UnmapOrDie and MmapAlignedOrDie 2016-03-10 20:47:26 +00:00
stats [Sanitizer] Introduce ListOfModules object and use it to replace GetListOfModules(). 2016-02-22 18:52:51 +00:00
tsan [tsan] Add TSan debugger APIs 2016-03-10 17:00:29 +00:00
ubsan sanitizer: Fix endianness checks for gcc 2016-03-09 23:39:40 +00:00
CMakeLists.txt Introduce stats and stats_client libraries. 2016-01-16 00:31:29 +00:00
Makefile.mk Remove autoconf support for building runtime libraries. 2016-01-26 21:31:12 +00:00