Alexey Samsonov
ca37969c24
AddressSanitizer: don't include pthread.h and signal.h in interceptors on Mac
...
llvm-svn: 150683
2012-02-16 11:26:52 +00:00
Kostya Serebryany
10dbd68bd2
[asan] don't do AsanDie twice
...
llvm-svn: 150641
2012-02-16 00:40:18 +00:00
Alexey Samsonov
1e7e2370aa
AddressSanitizer: don't include pthread.h in asan_interceptors.cc on Linux
...
llvm-svn: 150573
2012-02-15 09:14:26 +00:00
Alexey Samsonov
278c25f241
AddressSanitizer: simplify IntervalsAreSeparate function
...
llvm-svn: 150569
2012-02-15 08:27:34 +00:00
Timur Iskhodzhanov
d2a9075de0
[ASan] Define an internal implementation of strchr to make stack OOB tests pass on Windows
...
llvm-svn: 150499
2012-02-14 19:33:04 +00:00
Evgeniy Stepanov
2ee5950dd0
[asan] Add lots of missing visibility attributes.
...
llvm-svn: 150479
2012-02-14 13:46:06 +00:00
Kostya Serebryany
fcd535ba6c
[asan] implement __asan_set_death_callback
...
llvm-svn: 150414
2012-02-13 21:24:29 +00:00
Alexander Potapenko
438447a7f3
Fix compilation on Mac.
...
llvm-svn: 150400
2012-02-13 17:14:31 +00:00
Alexander Potapenko
234d8c2168
Lint fix
...
llvm-svn: 150399
2012-02-13 17:11:19 +00:00
Alexander Potapenko
720aaefb8d
Move the non-trivial implementation of AsanShadowRangeIsAvailable to asan_mac.cc
...
to avoid crashes on Linux and Win.
llvm-svn: 150398
2012-02-13 17:09:40 +00:00
Alexander Potapenko
ef4521e239
Check whether the shadow memory range intersects with an existing mapping.
...
This should help to detect problems with ASLR or linker tricks early.
llvm-svn: 150391
2012-02-13 15:11:23 +00:00
Alexey Samsonov
ea308d876b
AddressSanitizer: re-enable lint for output tests
...
llvm-svn: 150386
2012-02-13 14:18:36 +00:00
Alexey Samsonov
54671b63be
AddressSanitizer: fix llvm headers in output tests
...
llvm-svn: 150385
2012-02-13 14:05:07 +00:00
Alexey Samsonov
633c8be0ae
AddressSanitizer: remove match_output.py, split expected output into OS-specific and OS-independent parts
...
llvm-svn: 150384
2012-02-13 13:59:24 +00:00
Evgeniy Stepanov
c5d845dc09
[asan] Add a missing include.
...
llvm-svn: 150382
2012-02-13 12:37:56 +00:00
Evgeniy Stepanov
450c123218
[asan] Add a missing return.
...
It is technically reachable on Android, where pthread_exit is not
marked noreturn.
llvm-svn: 150381
2012-02-13 12:36:44 +00:00
Alexey Samsonov
92a0b806a6
AddressSanitizer: Convert templates for output tests to FileCheck format and move them inside sources
...
llvm-svn: 150375
2012-02-13 12:21:58 +00:00
Evgeniy Stepanov
b25d0d2318
[asan] Return type of index() is char*.
...
This is important for Android, where we can't keep system headers
from leaking into asan_interceptors.cc.
llvm-svn: 150374
2012-02-13 12:12:32 +00:00
Evgeniy Stepanov
da7522b551
[asan] Disable signal&sigaction interceptors on Android.
...
llvm-svn: 150373
2012-02-13 12:04:36 +00:00
Evgeniy Stepanov
45fd36110b
[asan] Default visibility for __asan_handle_no_return.
...
llvm-svn: 150372
2012-02-13 11:55:24 +00:00
Evgeniy Stepanov
56ae29f92d
[asan] Fix a crash in GetCurrent() of an undead thread.
...
llvm-svn: 150371
2012-02-13 11:53:24 +00:00
Alexey Samsonov
6e6083f4b1
AddressSanitizer: fix path to FileCheck in makefiles
...
llvm-svn: 150368
2012-02-13 09:14:31 +00:00
Alexey Samsonov
b30df37ebf
AddressSanitizer: move output tests to a separate directory
...
llvm-svn: 150367
2012-02-13 08:50:21 +00:00
Alexey Samsonov
f9affd3a0c
AddressSanitizer: Use FileCheck instead of grep for pure C output tests
...
llvm-svn: 150366
2012-02-13 08:27:10 +00:00
Bob Wilson
e67004e2f1
Back out some changes that accidentally committed.
...
llvm-svn: 150254
2012-02-10 16:41:46 +00:00
Bob Wilson
ddd971564e
Revert r150232 since it breaks the build when there's no ARM assembler.
...
llvm-svn: 150253
2012-02-10 16:36:49 +00:00
Daniel Dunbar
d205200d41
make/clang_darwin: Tweak CheckArches function to force the integrated-as and use
...
the stub SDK to try and ensure we always pick up the right archs when they
should be able to be used.
- Also, warn when we drop an architecture.
llvm-svn: 150232
2012-02-10 06:00:35 +00:00
Timur Iskhodzhanov
7ce3e5bb8e
[asan] The first version of the RTL for Windows, reviewed at http://codereview.appspot.com/5647052
...
llvm-svn: 150185
2012-02-09 17:20:14 +00:00
Timur Iskhodzhanov
bc9bb3f581
Test commit + fix an obvious typo
...
llvm-svn: 150184
2012-02-09 16:29:41 +00:00
Alexey Samsonov
9654367cbc
AddressSanitizer: move mach_override inside interception library
...
llvm-svn: 150171
2012-02-09 11:36:12 +00:00
Kostya Serebryany
0394da7bea
[asan] unpoison the stack before every noreturn call. Fixes asan issue 37. rt part
...
llvm-svn: 150101
2012-02-08 21:33:27 +00:00
Alexey Samsonov
8489f2a564
AddressSanitizer: start factoring out interception machinery
...
llvm-svn: 150083
2012-02-08 19:52:01 +00:00
Alexander Potapenko
1da11ec357
Move the _ReturnAddress definition out of the __asan:: namespace
...
Patch by Timur Iskhodzhanov (timurrrr@google.com )
llvm-svn: 150075
2012-02-08 14:14:18 +00:00
Alexey Samsonov
e725478e2f
AddressSanitizer: replace all "real_X" calls with "REAL(X)"
...
llvm-svn: 150073
2012-02-08 13:45:31 +00:00
Alexander Potapenko
42cdb7e640
Typo fix: s/SNPrint/SNPrintf
...
llvm-svn: 150069
2012-02-08 11:45:09 +00:00
Kostya Serebryany
9716914b2d
[asan] better warning messages for double-free bugs (provide allocation/deallocation stack traces)
...
llvm-svn: 150027
2012-02-08 00:42:29 +00:00
Kostya Serebryany
f98fc08bc7
[asan] GET_CALLER_PC macro for Win. Patch by timurrrr@google.com
...
llvm-svn: 149994
2012-02-07 18:23:54 +00:00
Kostya Serebryany
d61255638f
[asan] print 'ALL TESTS PASSED' in makefile when running tests (convenience)
...
llvm-svn: 149990
2012-02-07 17:36:07 +00:00
Kostya Serebryany
614b53de1b
[asan] don't crash if /proc/self/maps has enormous size (linux)
...
llvm-svn: 149944
2012-02-07 00:47:35 +00:00
Kostya Serebryany
b5eb5a7a05
[asan] make sure the AsanThread object is destroyed if pthread_exit is called
...
llvm-svn: 149940
2012-02-07 00:27:15 +00:00
Kostya Serebryany
546ba363ea
[asan] use raw syscalls for open/close on linux to avoid being intercepted
...
llvm-svn: 149892
2012-02-06 19:23:38 +00:00
Kostya Serebryany
9ff28d661d
[asan] The first version of Windows malloc interceptors, patch by timurrrr@google.com
...
llvm-svn: 149875
2012-02-06 17:56:38 +00:00
Nick Kledzik
686f0d17a6
On Apple platforms, wire up compilerrt_abort() to log file and function info
...
llvm-svn: 149723
2012-02-03 23:53:40 +00:00
Nick Kledzik
a2b846c000
Remove __attribute__((weak)) on function prototype. It has a different meaning on prototypes then it does on definitions. It is not needed on the prototype and causes build failures for static codegen
...
llvm-svn: 149720
2012-02-03 23:10:55 +00:00
Alexey Samsonov
f9fef3d275
AddressSanitizer: simplify RoundUpToPowerOfTwo/clz; add a couple of CHECKs for real_X calls. Patch by timurrrr@google.com
...
llvm-svn: 149687
2012-02-03 08:50:16 +00:00
Alexey Samsonov
23e3b90319
AddressSanitizer: Replace __attribute__ with macro (for Win compatibility). Patch by timurrrr@google.com
...
llvm-svn: 149686
2012-02-03 08:37:19 +00:00
Alexey Samsonov
15965f9c3d
AddressSanitizer: Add macro for definition/declaration of interceptors
...
llvm-svn: 149602
2012-02-02 10:39:40 +00:00
Alexander Potapenko
c97434ecaf
Disable wrapping memcpy() on Mac OS Lion, where it
...
actually falls back to memmove.
In this case we still need to initialize real_memcpy, so we set it to
real_memmove
We check for MACOS_VERSION_SNOW_LEOPARD, because currently only Snow
Leopard and Lion are supported.
llvm-svn: 149492
2012-02-01 10:07:52 +00:00
Alexander Potapenko
f504602a0f
Disables testing memcpy() on Mac OS 10.7,
...
where memcpy() in fact aliases memmove() and thus calling it with
overlapping parameters is not an error.
llvm-svn: 149491
2012-02-01 09:47:40 +00:00
Kostya Serebryany
9160b5059b
[asan] fix the wrong __WORDSIZE definition on Win x64, add ASAN_INTERFACE_FUNCTION_ATTRIBUTE. Patch by timurrrr@google.com
...
llvm-svn: 149395
2012-01-31 18:13:50 +00:00