Commit Graph

890 Commits

Author SHA1 Message Date
Alexander Potapenko 40b48ccae2 Add support for "movsbl %sil,%ecx" (x86_64) and "movsbl $imm(%ebp), %edx" (i386) to our fork of mach_override.
This is an extended version of a patch by Rafael Avila de Espindola (rafael.espindola@gmail.com)

llvm-svn: 161116
2012-08-01 16:35:48 +00:00
Alexey Samsonov 139a7c0575 [Sanitizer] Make ASan/TSan sources depend on headers from interception library
llvm-svn: 161113
2012-08-01 14:55:49 +00:00
Alexey Samsonov cc7ea4269a [ASan] cleanup interceptors code - prefer ASAN_INTERCEPT_FUNCTION_NAME macro to _WIN32, __APPLE__ etc.
llvm-svn: 161109
2012-08-01 11:17:00 +00:00
Alexey Samsonov 7b2f36e96a First tiny move towards integrating AddressSanitizer regressions test into LLVM lit-based testing infrastructure.
The goal is to be able to run ASan tests by simply running "make check-asan" command from CMake build tree:
* tests should use fresh clang binary from current build tree.
* tests should use the same RUN-lines syntax as llvm/clang reg tests.

Next steps:
- restricting tests to machines where target is equal to host, i.e. where we can produce working binaries.
- moving AddressSanitizer unit tests to lit as well.

llvm-svn: 161050
2012-07-31 15:43:11 +00:00
Alexander Potapenko 8aae9557d6 Factor out the main() function.
llvm-svn: 161046
2012-07-31 13:51:26 +00:00
Alexey Samsonov 500e99639d [Sanitizer] Wrapper around llvm::DIContext from LLVM DebugInfo library. If a macro SANITIZER_USES_LLVM_LIBS is defined (by default it is not), then sanitizer runtime includes llvm headers and tries to use LLVM libs for in-process symbolization. To make it functional, we have to link with these LLVM libs - either pass them to linker from Clang driver, or link them into static ASan runtime when we build it.
llvm-svn: 161045
2012-07-31 11:51:26 +00:00
Alexey Samsonov 36d2dff143 [ASan] fix cmake build warning
llvm-svn: 160957
2012-07-30 10:18:31 +00:00
Alexey Samsonov a2e0cf4802 [TSan] delete trailing spaces
llvm-svn: 160955
2012-07-30 07:46:09 +00:00
Dmitry Vyukov 904d3f9c06 tsan: add ReleaseStore() function that merely copies vector clock rather than combines two clocks
fix clock setup for finalizer goroutine (Go runtime)

llvm-svn: 160918
2012-07-28 15:27:41 +00:00
Dmitry Vyukov 55253100be tsan: add missing include
llvm-svn: 160875
2012-07-27 18:13:03 +00:00
Dmitry Vyukov 4e94662db4 tsan: change event handling from single HandleEvent() to a set of separate functions (Go runtime)
llvm-svn: 160863
2012-07-27 14:00:39 +00:00
Dmitry Vyukov 536551d02d tasn: do not remember stack traces for sync objects for Go (they are not reported anyway)
llvm-svn: 160861
2012-07-27 13:21:33 +00:00
Dmitry Vyukov e91e9ac2a2 tsan: remove unnecessary and wrong include
llvm-svn: 160860
2012-07-27 13:21:01 +00:00
Kostya Serebryany 4c38790f70 [asan] ensure that asan_init is called in str[n]cmp. Bug found by Nick Kralevich (thanks)
llvm-svn: 160853
2012-07-27 07:09:49 +00:00
Dmitry Vyukov 65ec6684c2 tsan: make the runtime library name tsan-neutral for Go upstream
llvm-svn: 160797
2012-07-26 18:42:51 +00:00
Dmitry Vyukov 55b405ef42 tsan: allow environment to override OnReport() and OverrideFlags()
llvm-svn: 160728
2012-07-25 14:30:51 +00:00
Dmitry Vyukov dfc8e52400 tsan: suport for Go finalizers
llvm-svn: 160723
2012-07-25 13:16:35 +00:00
Dmitry Vyukov d654f06644 tsan: expect that Go symbolizer can return NULLs
llvm-svn: 160722
2012-07-25 11:50:37 +00:00
Alexey Samsonov 5062359502 cmake for compiler-rt: add a function to set output dirs for compiler runtimes equal to directory used by Clang driver. Use it for ASan runtime. Also, make sure that ASan unit tests depend on the ASan runtime.
llvm-svn: 160721
2012-07-25 11:15:00 +00:00
Kostya Serebryany bb0ade6daa [asan] don't return from a never-return function. fix a test that had a chain of bugs instead of just one
llvm-svn: 160719
2012-07-25 10:56:09 +00:00
Alexey Samsonov c145b02607 [ASan] fixup for r160712: provide a default definition for weak __asan_default_options()
llvm-svn: 160718
2012-07-25 10:40:57 +00:00
Alexander Potapenko 9bac1cedbc Make __asan_default_options a weak function that returns a const char*.
Users may define it to override the default ASan options.
This function has to be marked with __attribute__((no_address_safety_analysis)), because it is called before ASan is fully initialized.

Add an output test checking the __asan_default_options functionality.

llvm-svn: 160712
2012-07-25 09:18:43 +00:00
Dmitry Vyukov bcf0b7002b tsan: align report style with Go internal format
llvm-svn: 160672
2012-07-24 12:29:43 +00:00
Alexey Samsonov 65d842ae51 Revert r160669 (except for compile flag updates)
llvm-svn: 160671
2012-07-24 12:11:38 +00:00
Dmitry Vyukov 69bee8d8f6 tsan: output goroutine creation stack
llvm-svn: 160670
2012-07-24 12:03:47 +00:00
Alexey Samsonov 3397013606 [ASan] hacking cmake build: after generating asan runtime, copy it to the Clang lib directory where Clang driver expects to find it.
llvm-svn: 160669
2012-07-24 11:49:55 +00:00
Alexey Samsonov 96b9393f2d [ASan] Support for cmake build of ASan unittests in 32-bit LLVM build. Currently, to run ASan unit tests both for 32- and 64 bits one has to maintain two distinct LLVM builds. In a bright future, we'd like to use a single build for this
llvm-svn: 160666
2012-07-24 08:26:19 +00:00
Alexander Potapenko 51e6488b31 Intercept CFAllocator for each thread in the program.
Test that child threads use the ASan allocator, that allocated memory can be passed to another thread and deallocated on it.
This should fix http://code.google.com/p/address-sanitizer/issues/detail?id=81

llvm-svn: 160630
2012-07-23 14:07:58 +00:00
Alexey Samsonov 37d5134f38 [ASan] minor fixes to silence cmake build warnings
llvm-svn: 160624
2012-07-23 09:11:58 +00:00
Alexander Potapenko 7f3e84c9fd For wild addresses in the shadow or shadow gap areas print an error message instead of crashing on a check.
Add AddressSanitizer.MemsetWildAddressTest that makes sure a proper error message is printed.

llvm-svn: 160620
2012-07-23 08:22:27 +00:00
Alexey Samsonov 3735faa108 [ASan] subtract one from PCs in ASan error reports (as they originally contain return addresses). Make output tests stricter.
llvm-svn: 160508
2012-07-19 15:07:26 +00:00
Kostya Serebryany 7a32f8dcb8 [tsan] fix lint
llvm-svn: 160504
2012-07-19 12:22:04 +00:00
Kostya Serebryany a415df6539 [tsan] minor fixes in tsan allocator and its testlib. Now runs fine with chrome
llvm-svn: 160503
2012-07-19 12:15:33 +00:00
Alexander Potapenko 628b349b17 Suppress the stderr output from atos.
llvm-svn: 160502
2012-07-19 12:01:07 +00:00
Alexey Samsonov 7acdc1738f [Sanitizer] When obtaining the data for loaded modules, add address ranges of loadable segments only. Looks like address range of PT_TLS segment may intersect with loadable segments of other modules.
llvm-svn: 160498
2012-07-19 07:51:20 +00:00
Kostya Serebryany ab34919413 [tsan] minor enhancements in the new tsan allocator and a test malloc replacement library that can be linked to any program to replace malloc (tested on spec2006)
llvm-svn: 160436
2012-07-18 16:04:55 +00:00
Alexey Samsonov c6d97c0ad1 [TSan] fix confusing error message in CheckFailed
llvm-svn: 160435
2012-07-18 14:37:22 +00:00
Alexey Samsonov 4dbfad627e [Sanitizer] add missing unit test for flag parsing (forgot to run svn add before)
llvm-svn: 160428
2012-07-18 06:29:18 +00:00
Alexey Samsonov 93ca829c2d [TSan] cleanup header comments
llvm-svn: 160359
2012-07-17 09:39:59 +00:00
Kostya Serebryany 78713bc574 [asan] get rid of the last operator new call in asan rtl
llvm-svn: 160347
2012-07-17 07:20:13 +00:00
Dmitry Vyukov f2bc464f37 tsan: add platform suffix to Go runtime library
llvm-svn: 160304
2012-07-16 18:25:43 +00:00
Dmitry Vyukov 3abd096370 tsan: treat malloc() as memory access in Go
llvm-svn: 160289
2012-07-16 16:55:01 +00:00
Dmitry Vyukov 5bfac97ff9 tsan: use dynamic shadow stack for Go
llvm-svn: 160288
2012-07-16 16:44:47 +00:00
Dmitry Vyukov dc36d69b6a tsan: increase number of dead threads for Go
llvm-svn: 160283
2012-07-16 16:03:16 +00:00
Dmitry Vyukov 9270eaf1f2 tsan: Go runtime: support goroutine end event
llvm-svn: 160282
2012-07-16 16:01:08 +00:00
Dmitry Vyukov 5e5e36712b tsan: fix build
llvm-svn: 160267
2012-07-16 13:25:47 +00:00
Dmitry Vyukov c40c00767c tsan: port Go runtime to Darwin
llvm-svn: 160266
2012-07-16 13:02:40 +00:00
Alexey Samsonov d77fbba74a [Sanitizer] implement straightforward nlogn sorting, as qsort() may call malloc, which leads to deadlock in ASan allocator
llvm-svn: 160262
2012-07-16 11:27:17 +00:00
Dmitry Vyukov 263efd8f05 tsan: allow to pass CFLAGS to Go runtime build script
llvm-svn: 160259
2012-07-16 10:36:39 +00:00
Dmitry Vyukov 2dac24a42b tsan: add missing test for Go runtime
llvm-svn: 160258
2012-07-16 10:34:57 +00:00