summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_win.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* [sanitizer] Fix Mac build.Evgeniy Stepanov2015-07-281-0/+4
| | | | llvm-svn: 243480
* UBSan: Enable runtime library tests on Windows, and get most tests passing.Peter Collingbourne2015-07-021-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically: - Disable int128 tests on Windows, as MSVC cl.exe does not support int128, so we might not have been able to build the runtime with int128 support. - XFAIL the vptr tests as we lack Microsoft ABI support. - XFAIL enum.cpp as UBSan fails to add the correct instrumentation code for some reason. - Modify certain tests that build executables multiple times to use unique names for each executable. This works around a race condition observed on Windows. - Implement IsAccessibleMemoryRange for Windows to fix the last misaligned.cpp test. - Introduce a substitution for testing crashes on Windows using KillTheDoctor. Differential Revision: http://reviews.llvm.org/D10864 llvm-svn: 241303
* [ASan] Fix Darwin and Windows builds.Yury Gribov2015-06-041-5/+0
| | | | llvm-svn: 239027
* [ASan] Make binary name reader cross-platform.Yury Gribov2015-06-041-0/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D10213 llvm-svn: 239020
* Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.Evgeniy Stepanov2015-05-291-2/+4
| | | | | | | | | | | | | | | | | | This is done by creating a named shared memory region, unlinking it and setting up a private (i.e. copy-on-write) mapping of that instead of a regular anonymous mapping. I've experimented with regular (sparse) files, but they can not be scaled to the size of MSan shadow mapping, at least on Linux/X86_64 and ext3 fs. Controlled by a common flag, decorate_proc_maps, disabled by default. This patch has a few shortcomings: * not all mappings are annotated, especially in TSan. * our handling of memset() of shadow via mmap() puts small anonymous mappings inside larger named mappings, which looks ugly and can, in theory, hit the mapping number limit. llvm-svn: 238621
* [ASan/Win] Initialize sandbox-related stuff when asked toTimur Iskhodzhanov2015-04-231-2/+3
| | | | llvm-svn: 235591
* [ASan/Win] Don't forget to set *last_error if OpenFile failsTimur Iskhodzhanov2015-04-231-0/+2
| | | | llvm-svn: 235590
* Split Mprotect into MmapNoAccess and MprotectNoAccess to be more portableTimur Iskhodzhanov2015-04-101-1/+7
| | | | | | | On Windows, we have to know if a memory to be protected is mapped or not. On POSIX, Mprotect was semantically different from mprotect most people know. llvm-svn: 234602
* [ASan/Win] Add more support for file operationsTimur Iskhodzhanov2015-04-091-48/+21
| | | | llvm-svn: 234494
* Use RenameFile instead of internal_rename in non-POSIX codeTimur Iskhodzhanov2015-04-091-4/+4
| | | | llvm-svn: 234490
* Use WriteToFile instead of internal_write in non-POSIX codeTimur Iskhodzhanov2015-04-091-11/+20
| | | | llvm-svn: 234487
* Use ReadFromFile instead of internal_read in non-POSIX codeTimur Iskhodzhanov2015-04-091-4/+5
| | | | llvm-svn: 234485
* Move more POSIX-specific functions to sanitizer_posix.hTimur Iskhodzhanov2015-04-091-24/+0
| | | | llvm-svn: 234482
* Introduce CloseFile to be used instead of internal_close on non-POSIXTimur Iskhodzhanov2015-04-091-2/+2
| | | | llvm-svn: 234481
* [Sanitizer RT] Get rid of internal_isattyTimur Iskhodzhanov2015-04-081-4/+5
| | | | llvm-svn: 234423
* Move some POSIX-specific functions from sanitizer_libc.h to a new ↵Timur Iskhodzhanov2015-04-081-17/+0
| | | | | | sanitizer_posix.h llvm-svn: 234418
* [Sanitizers] Make OpenFile more portableTimur Iskhodzhanov2015-04-081-2/+2
| | | | llvm-svn: 234410
* Minor follow-up fix to r234150Timur Iskhodzhanov2015-04-061-1/+1
| | | | llvm-svn: 234151
* [ASan] Unify handling of loaded modules between POSIX and WindowsTimur Iskhodzhanov2015-04-061-49/+68
| | | | | | Reviewed at http://reviews.llvm.org/D8805 llvm-svn: 234150
* [ASan/Win] Minor improvements towards enabling coverageTimur Iskhodzhanov2015-04-021-1/+18
| | | | llvm-svn: 233918
* [ASan/Win] UnmapOrDie should not fail on zero address / sizeTimur Iskhodzhanov2015-03-311-0/+3
| | | | llvm-svn: 233707
* [ASan] Distinguish between read, write and read-write file access modes in ↵Alexander Potapenko2015-03-231-1/+1
| | | | | | | | OpenFile. This is to fix mapping coverage files into memory on OSX. llvm-svn: 232936
* asan: fix windows build after commit 230978Dmitry Vyukov2015-03-021-0/+17
| | | | llvm-svn: 230980
* [compiler-rt] Allow suppression file to be relative to the location of the ↵Anna Zaks2015-02-271-0/+13
| | | | | | | | | | executable The ASanified executable could be launched from different locations. When we cannot find the suppression file relative to the current directory, try to see if the specified path is relative to the location of the executable. llvm-svn: 230723
* tsan: exclude DumpProcessMap on windowsDmitry Vyukov2015-02-161-0/+2
| | | | | | | The function uses EnumProcessModules, which requires psapi.lib, which is not linked with tsan on windows. llvm-svn: 229390
* [ASan/Win] NFC, just minor simplification of the codeTimur Iskhodzhanov2015-02-101-2/+2
| | | | llvm-svn: 228702
* [ASan] Add use_madv_dontdump flag.Yury Gribov2015-02-031-1/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D7294 llvm-svn: 227959
* [ASan/Win] Add some diagnostics to help investigate Mprotect failuresTimur Iskhodzhanov2015-02-021-3/+8
| | | | llvm-svn: 227803
* [sanitizer] Fix windows build.Evgeniy Stepanov2015-01-221-2/+2
| | | | llvm-svn: 226825
* [asan] use MADV_NOHUGEPAGE for shadow to reduce the actual memory usageKostya Serebryany2015-01-211-0/+4
| | | | llvm-svn: 226636
* Follow-up to r224987: fix a lint warningTimur Iskhodzhanov2014-12-301-1/+1
| | | | llvm-svn: 224988
* [ASan/Win] Sort the list of modules when we fail to reserve the shadow ↵Timur Iskhodzhanov2014-12-301-20/+53
| | | | | | memory range llvm-svn: 224987
* Escape ? to silence GCC warning about trigraphs.Daniel Jasper2014-12-261-1/+1
| | | | llvm-svn: 224863
* [ASan/Win] Add basic support for MemoryRangeIsAvailable and DumpProcessMap ↵Timur Iskhodzhanov2014-12-261-3/+42
| | | | | | to make it easier to debug startup shadow mapping failures llvm-svn: 224856
* [ASan/Win] Suppress error messaging when Abort() is calledTimur Iskhodzhanov2014-12-261-2/+3
| | | | | | This will prevent ASan bots from hanging / timing out llvm-svn: 224852
* Fix Win build after r224353: void function returning zero.Hans Wennborg2014-12-161-1/+1
| | | | llvm-svn: 224366
* [asan] new flag: hard_rss_limit_mbKostya Serebryany2014-12-161-0/+3
| | | | llvm-svn: 224353
* [Sanitizer] Fix report_path functionality:Alexey Samsonov2014-12-111-9/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: - Make sure mmap() is never called inside RawWrite function. - Wrap a bunch of standalone globals in a ReportFile object. - Make sure accesses to these globals are thread-safe. - Fix report_path functionality on Windows, where __sanitizer_set_report_path() would break program. I've started this yak shaving in order to make "CommonFlags::mmap_limit_mb" immutable. Currently we drop this flag to zero before printing an error message. Test Plan: regression test suite Reviewers: kcc, glider Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6595 llvm-svn: 224031
* [asan] move GetRSS from tsan to sanitizer_commonKostya Serebryany2014-12-091-0/+4
| | | | llvm-svn: 223730
* Removed r221896, it seems to break build in various ways.Yury Gribov2014-11-131-7/+0
| | | | llvm-svn: 221912
* [ASan] Add process basename to log name and error message to simplify ↵Yury Gribov2014-11-131-0/+7
| | | | | | | | analysis of sanitized systems logs. Reviewed at http://reviews.llvm.org/D5724 llvm-svn: 221896
* Try to fix the Windows build after r220637Hans Wennborg2014-10-261-1/+1
| | | | llvm-svn: 220643
* [Sanitizer] Make StackTrace a lightweight reference to array of PCs, andAlexey Samsonov2014-10-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | introduce a BufferedStackTrace class, which owns this array. Summary: This change splits __sanitizer::StackTrace class into a lightweight __sanitizer::StackTrace, which doesn't own array of PCs, and BufferedStackTrace, which owns it. This would allow us to simplify the interface of StackDepot, and eventually merge __sanitizer::StackTrace with __tsan::StackTrace. Test Plan: regression test suite. Reviewers: kcc, dvyukov Reviewed By: dvyukov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5985 llvm-svn: 220635
* PR20721: Don't let UBSan print inaccessible memoryAlexey Samsonov2014-09-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: UBSan needs to check if memory snippet it's going to print resides in addressable memory. Similar check might be helpful in ASan with dump_instruction_bytes option (see http://reviews.llvm.org/D5167). Instead of scanning /proc/self/maps manually, delegate this check to the OS kernel: try to write this memory in a syscall and assume that memory is inaccessible if the syscall failed (e.g. with EFAULT). Fixes PR20721. Test Plan: compiler-rt test suite Reviewers: eugenis, glider Reviewed By: glider Subscribers: emaste, ygribov, llvm-commits, glider, rsmith Differential Revision: http://reviews.llvm.org/D5253 llvm-svn: 217971
* tsan: unbreak windows buildDmitry Vyukov2014-09-011-0/+4
| | | | | | | | | | | | | | Currently it fails with: # Testing race detector. race_windows_amd64.syso:gotsan.cc:(.text+0x4d89): undefined reference to `__imp_SymGetModuleBase64' race_windows_amd64.syso:gotsan.cc:(.text+0x4d90): undefined reference to `__imp_SymFunctionTableAccess64' race_windows_amd64.syso:gotsan.cc:(.text+0x4dd8): undefined reference to `__imp_StackWalk64' x86_64-w64-mingw32/bin/ld.exe: race_windows_amd64.syso : bad reloc address 0x10 in section `.data' collect2.exe: error: ld returned 1 exit status llvm-svn: 216875
* [TSan] Share the code the setup code calling getrlim/setrlim with ↵Alexey Samsonov2014-08-121-1/+9
| | | | | | sanitizer_common llvm-svn: 215481
* [ASan/Win] Catch NULL derefs and page faultsTimur Iskhodzhanov2014-07-111-3/+27
| | | | | | Reviewed at http://reviews.llvm.org/D4471 llvm-svn: 212807
* [asan] Add a few stubs to fix windows build.Evgeniy Stepanov2014-05-281-0/+12
| | | | llvm-svn: 209717
* [sanitizer] Support sandboxing in sanitizer coverage.Sergey Matveev2014-05-191-1/+2
| | | | | | | | | | | Summary: Sandboxed code may now pass additional arguments to __sanitizer_sandbox_on_notify() to force all coverage data to be dumped to a single file (the default is one file per module). The user may supply a file or socket to write to. The latter option can be used to broker out the file writing functionality. If -1 is passed, we pre-open a file. llvm-svn: 209121
* [ASan/Win] Don't crash when ASAN_OPTIONS have disable_core=1Timur Iskhodzhanov2014-05-061-1/+1
| | | | | | Reviewed at http://reviews.llvm.org/D3610 llvm-svn: 208070
OpenPOWER on IntegriCloud