summaryrefslogtreecommitdiff
path: root/test/asan/TestCases/Windows
AgeCommit message (Collapse)Author
2017-11-17Enable PDB generation with lld in asan and cfi tests on Windows.Peter Collingbourne
PDB emission now works well enough that we can rely on it for these tests to pass. Differential Revision: https://reviews.llvm.org/D40188 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318546 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18[ubsan] Fix interface_symbols_windows testVitaly Buka
Summary: 1. Update ubsan_interface.inc to make the test happy. 2. Switch interface_symbols_linux and interface_symbols_darwin to C++ to import __ubsan_handle_dynamic_type_cache_miss 3. Switch interface_symbols_windows to C++ for consistency. Reviewers: rnk, zturner Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37986 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313551 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-30[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzerMatt Morehouse
Summary: - Don't sanitize __sancov_lowest_stack. - Don't instrument leaf functions. - Add CoverageStackDepth to Fuzzer and FuzzerNoLink. - Only enable on Linux. Reviewers: vitalybuka, kcc, george.karpenkov Reviewed By: kcc Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D37156 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312185 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-20[asan] Update unittest for changes in logging r308637Vitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308647 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-16[Sanitizers] Fix allocator OOM test on Windows.Alex Shlyapnikov
Summary: Point of failure is different after D34243, hence the change of the message. Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D34292 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@305580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03Revert my bad winasan coverage test fix and apply one that actually worksReid Kleckner
trace-pc doesn't work, but trace-pc-guard does. *shrug* git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302045 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03Speculative fix for WinASan after r301994Reid Kleckner
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302043 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24[asan] Fix Windows global dead stripping testsReid Kleckner
Pass /Gw to clang-cl which is equivalent to -fdata-sections. This is now necessary. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301272 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21[cfi] Run tests with and without lld and thinlto.Evgeniy Stepanov
Run tests in all configurations: (standalone, with devirtualization) * (gold, lld) * (lto, thinlto) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301016 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30[asan] Support line numbers in StackVarDescrKuba Mracek
When -fsanitize-address-use-after-scope is used, the instrumentation produces line numbers in stack frame descriptions. This patch make sure the ASan runtime supports this format (ParseFrameDescription needs to be able to parse "varname:line") and prepares lit tests to allow line numbers in ASan report output. Differential Revision: https://reviews.llvm.org/D31484 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299043 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-22Use lld-link /nopdb to suppress PDB generation when DWARF is requiredReid Kleckner
Fixes cfi/stats.cpp and asan/fuse-lld.cc on Windows. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@298545 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21[compiler-rt][asan] Add support for desallocation of unhandled pointersEtienne Bergeron
Summary: On windows 10, the ucrt DLL is performing allocations before the function hooking and there are multiple allocations not handled by Asan. When a free occur at the end of the process, asan is reporting desallocations not malloc-ed. Reviewers: rnk, kcc Reviewed By: rnk, kcc Subscribers: kcc, llvm-commits, kubamracek, chrisha, dberris Differential Revision: https://reviews.llvm.org/D25946 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295730 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-14[compiler-rt][asan|win] Force tls_init test to use dynamic runtimeEtienne Bergeron
Summary: There is no guarantee that the tls_init is executed on the static runtime (/MT). On windows 7, this unittest is failing. On windows 10, I believe it's working because of the new CRT. On ASAN side, it doesn't matter that the hook point is run or not. It must be run only if there is other tls_initializer that are registered. Reviewers: rnk, chrisha Reviewed By: rnk Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D29838 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295057 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-02[asan] Intercept SetUnhandledExceptionFilter.Marcos Pividori
In this diff I update the code for asan on Windows, so we can intercept SetUnhandledExceptionFilter and catch some exceptions depending on the result of IsHandledDeadlyException() (which depends on asan flags). This way we have the same behavior on Windows and Posix systems. On Posix, we intercept signal and sigaction, so user's code can only register signal handlers for signals that are not handled by asan. After this diff, the same happens on Windows, user's code can only register exception handlers for exceptions that are not handled by asan. Differential Revision: https://reviews.llvm.org/D29463 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293957 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31[sanitizer] Add list of symbols exported in sanitizers' interface.Marcos Pividori
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all the functions exported, with the macros: INTERFACE_FUNCTION() and INTERFACE_WEAK_FUNCTION(). So, when we need to define or repeat a procedure for each function in the sanitizer's interface, we can define the macros and include that header. In particular, these files are needed for Windows, in the nexts commits. Also, this files could replace the existing files: weak_symbols.txt for Apple. Instead of reading weak_symbols.txt to get the list of weak symbols, we could read the file sanitizer_interface.inc and consider all the symbols included with the macro INTERFACE_WEAK_FUNCTION(Name). In this commit, I only include these files to the sanitizers that work on Windows. We could do the same for the rest of the sanitizers when needed. I updated tests for: Linux, Darwin and Windows. If a new function is exported but is not present in the interface list, the tests "interface_symbols_[darwin|windows|linux].c" fail. Also, I remove the comments: "/* OPTIONAL */" which are not required any more, because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions. Differential Revision: https://reviews.llvm.org/D29148 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293682 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-29General definition for weak functionsMarcos Pividori
In this diff, I define a general macro for defining weak functions with a default implementation: "SANITIZER_INTERFACE_WEAK_DEF()". This way, we simplify the implementation for different platforms. For example, we cannot define weak functions on Windows, but we can use linker pragmas to create an alias to a default implementation. All of these implementation details are hidden in the new macro. Also, as I modify the name for exported weak symbols on Windows, I needed to temporarily disable "dll_host" test for asan, which checks the list of functions included in asan_win_dll_thunk. Differential Revision: https://reviews.llvm.org/D28596 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293419 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21[asan] Un-XFAIL Windows global dead stripping test casesReid Kleckner
Test update for r287576 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@287577 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17[asan] Create a .ASAN$G(A-Z) section for global registrationReid Kleckner
Summary: The expectation is that new instrumented code will add global variable metadata to the .ASAN$GL section, and we will use this new code to iterate over it. This technique seems to break when using incremental linking, which seems to align every global to a 256 byte boundary. Presumably this is so that it can incrementally cope with global changing size. Clang already passes -incremental:no as a linker flag when you invoke it to do the link step. The two tests added for this feature will fail until the LLVM instrumentation change in D26770 lands, so they are marked XFAIL for now. Reviewers: pcc, kcc, mehdi_amini, kubabrecka Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D26771 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@287246 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14Remove pwd to fix WinASan botReid Kleckner
It only slipped in while I was debugging the test case. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@286854 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14[asan/win] Delay load dbghelp.dll to delay ucrtbase.dll initializationReid Kleckner
Summary: ASan needs to initialize before ucrtbase.dll so that it can intercept all of its heap allocations. New versions of dbghelp.dll depend on ucrtbase.dll, which means both of those DLLs will initialize before the dynamic ASan runtime. By lazily loading dbghelp.dll with LoadLibrary, we avoid the issue. Eventually, I would like to remove our dbghelp.dll dependency in favor of always using llvm-symbolizer.exe, but this seems like an acceptable interim solution. Fixes PR30903 Reviewers: etienneb Subscribers: kubabrecka, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D26473 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@286848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11Add a test that uses coverage and printf from a DLLReid Kleckner
This test fails without LLVM r286615 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@286618 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08[asan/win] Add init hooks to .CRT$XLABReid Kleckner
Summary: User applications may register hooks in the .CRT$XL* callback list, which is called very early by the loader. This is very common in Chromium: https://cs.chromium.org/search/?q=CRT.XL&sq=package:chromium&type=cs This has flown under the radar for a long time because the loader appears to catch exceptions originating from these callbacks. It's a real problem when you're debugging an asan application, though, since it makes the program crash early. The solution is to add our own callback to this list, and sort it very early in the list like we do elsewhere. Also add a test with such an instrumented callback, and test that it gets called with asan. Reviewers: etienneb Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D26404 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@286290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02[asan] Add more dynamic CRT mode testsReid Kleckner
Only tests using %clang_cl_asan were using the dynamic CRT before this. The unit tests and lit tests using %clangxx_asan were using the static CRT. Many cross-platform tests fail with the dynamic CRT, so I had to add win32-(static|dynamic)-asan lit features. Also deletes some redundant tests in TestCases/Windows that started failing with this switch. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@285821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30[compiler-rt][asan] Disable a broken test on windows 64-bitsEtienne Bergeron
Summary: This test is broken on wndows 64-bit. The interception library is not able to hook on the memchr functions. Snippet of the function that is not hookable: ``` --- No source file ------------------------------------------------------------- 000007FEFA1A18CD CC int 3 000007FEFA1A18CE CC int 3 000007FEFA1A18CF CC int 3 --- f:\dd\vctools\crt\vcruntime\src\string\amd64_arm_arm64\memchr.c ------------ while ( cnt && (*(unsigned char *)buf != (unsigned char)chr) ) { 000007FEFA1A18D0 4D 85 C0 test r8,r8 000007FEFA1A18D3 74 0D je memchr+12h (07FEFA1A18E2h) 000007FEFA1A18D5 38 11 cmp byte ptr [rcx],dl 000007FEFA1A18D7 74 09 je memchr+12h (07FEFA1A18E2h) buf = (unsigned char *)buf + 1; 000007FEFA1A18D9 48 FF C1 inc rcx cnt--; 000007FEFA1A18DC 49 83 E8 01 sub r8,1 000007FEFA1A18E0 75 F3 jne memchr+5h (07FEFA1A18D5h) } ``` Reviewers: rnk Subscribers: kubabrecka, dberris, llvm-commits, chrisha Differential Revision: https://reviews.llvm.org/D25037 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282860 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30[compiler-rt][asan] Fix incorrect regexp breaking an asan unittest on win64Etienne Bergeron
Summary: On windows, the memcpy and memmove function can be the same. This is correcly detected when hooking, but it's not possible to report the right function name when doing symbolisation. The same fix was applied for the static asan unittest. We forgot to apply the fix for the dynamic asan tests. ``` lvm\projects\compiler-rt\test\asan/TestCases/Windows/.svn/text-base/intercept_memcpy.cc.svn-base:// CHECK-NEXT: __asan_{{.*}}mem{{.*}} ``` This patch is fixing this test (win64): ``` ddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memcpy_indirect.cc ``` Reviewers: rnk, vitalybuka Subscribers: llvm-commits, kubabrecka, chrisha, dberris Differential Revision: https://reviews.llvm.org/D25038 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282859 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05Fix two tests in Win64 ASanReid Kleckner
Go back to intercepting kernel32!RaiseException, and only go for ntdll!RtlRaiseException if that fails. Fixes throw_and_catch.cc test. Work around an issue in LLVM's win64 epilogues. We end up with an epilogue that looks like this, and it drives the Win64 unwinder crazy until stack overflow: call ill_cc!__asan_handle_no_return xor eax,eax add rsp,40h // epilogue starts pop rbp // CSR ud2 // Trap here ret // Ret? nop word ptr [rax+rax] sub rsp,28h // Next function Will file a PR soon. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05Fix dumping of process module list and test itReid Kleckner
I probably broke this a year ago in r243895. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02[asan] Intercept RtlRaiseException instead of kernel32!RaiseExceptionReid Kleckner
Summary: On my install of Windows 10, RaiseException is a tail call to kernelbase!RaiseException. Obviously, we fail to intercept that. Instead, try hooking at the ntdll!RtlRaiseException layer. It is unlikely that this layer will contain control flow. Intercepting at this level requires adding a decoding for 'LEA ESP, [ESP + 0xXXXXXXXX]', which is a really obscure way to write 'SUB ESP, 0xXXXXXXXX' that avoids clobbering EFLAGS. Reviewers: etienneb Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23046 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277518 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02Remove stale CHECK lines that should have been included in r277478Reid Kleckner
We no longer assign ids to unregistered threads. We don't have any stack trace for thread creation for these worker threads, so this shouldn't affect report quality much. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277514 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02[asan] Remove NtWaitForWorkViaWorkerFactory interceptorReid Kleckner
Summary: On Windows 10, this gets called after TLS has been torn down from NTDLL, and we crash attempting to return fake_tsd. This interceptor isn't needed after r242948 anyway, so let's remove it. The ASan runtime can now tolerate unregistered threads calling __asan_handle_no_return. Reviewers: vitalybuka, etienneb Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23044 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277478 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21[asan] Fix Win64 test portability issuesReid Kleckner
The OOM test should really only run on 32-bits, since it's hard to OOM on x64. The operator_array_new_with_dtor_left_oob tests need to account for the larger array cookie on x64 (8 bytes instead of 4). Use -std=c++14 in use-after-scope-capture.cc to avoid errors in the MSVC 2015 STL on Windows. The default there is C++14 anyway. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276332 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21Fix unsymbolize unittest. Adding win64 address.Etienne Bergeron
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21[compiler-rt] Fix interception of memcpy/memmove on win64Etienne Bergeron
Summary: This patch is fixing running interception unittests for memcpy/memmove on windows 64. Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: https://reviews.llvm.org/D22641 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276324 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21[compiler-rt] Fix broken SymInitialize unittestEtienne Bergeron
Summary: By adding the initialisation of the symbolisation library (DbgHelp) we are swapping the order in which both warnings are produced. We can't use CHECK-NEXT as the dbghelp warning is multiline. Reviewers: rnk Subscribers: kubabrecka, llvm-commits, wang0109, chrisha Differential Revision: https://reviews.llvm.org/D22586 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276228 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20fix flaky test on windows sanitizer botsEtienne Bergeron
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20Try to deflake Windows/dll_host.cc test by not using repeated echo appendingReid Kleckner
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[compiler-rt/asan] Disable irrelevant unittest on win64Etienne Bergeron
Summary: This test is allocating a 1gig chunk to make shadow allocation failed, but on 64-bits architecture the test is working. Reviewers: rnk Subscribers: kubabrecka, llvm-commits, wang0109, chrisha Differential Revision: https://reviews.llvm.org/D22553 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19[compiler-rt] Fix Asan imports/exports unittestEtienne Bergeron
Summary: Avoid mismatch between imports/exports for 32-bit and 64-bits version. The test is running grep over macros to detect which functions are intercepted. Unfortunately, exception handlers differ in 32-bit and 64-bit. This patch is removing the exception handlers from the test. Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: https://reviews.llvm.org/D22484 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275982 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14[compiler-rt] Fix missing argument in asan unittestEtienne Bergeron
Summary: Both test have the same command-line. The second test is missing the /GS-. Keep in mind that /GS is on by default. Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: https://reviews.llvm.org/D22339 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275491 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04It really helps to not randomly delete one of the closing brackets. =/Chandler Carruth
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04Ok, now I know why I kept getting confused and not making progressChandler Carruth
fixing tis test. There are different configurations running, and they have subtly different backtraces. I didn't notice that the configs changed and so I kept occilating between the two. Now I've looked at two different configs at the same time, and so this should be much more likely to work. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04Update this test yet again, this time based on a nice consecutive pairChandler Carruth
of lines provided with the filecheck output from the previous run. I'll probably give up after this and get someone with a Windows build to help me out. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271784 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04I didn't actually get this right, but now I have frame #0 and frame #2.Chandler Carruth
This should fail on frame #1 and show what that should actually be. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04Amazingly, my guess was correct for the top two frames here. HopefullyChandler Carruth
with this, the Windows sanitizer bot will go green! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-04Temporary hack to this test to try and get the sanitizer-windows bot toChandler Carruth
show enough information for me to fix the patterns used here. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271779 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22[asan] Relax strdup test check linesReid Kleckner
On the buildbot, strdup appears as frame 1 instead of frame 0. Either is an acceptable user experience. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264016 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22[asan] Intercept strdup on WindowsReid Kleckner
Some unit tests were failing because we didn't intercept strdup. It turns out it works just fine on 2013 and 2015 with a small patch to the interception logic. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-22Fix coverage-related asan tests for VS 2015Reid Kleckner
printf is an inline function in VS 2015, giving these tests an unexpected extra point of coverage. This change works around that by avoiding printf. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264010 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-10[Windows] Fix UnmapOrDie and MmapAlignedOrDieReid Kleckner
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263160 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19[Windows] Simplify more tests now that Clang supports EHReid Kleckner
Remove TestCases/Windows/throw_catch.cc, since it is redundant with the portable test TestCases/throw_catch.cc. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261342 91177308-0d34-0410-b5e6-96231b3b80d8