Commit Graph

375 Commits

Author SHA1 Message Date
Alexey Samsonov 01da1055d3 [ASan] simplify ASAN_INTERCEPT_* definitions
llvm-svn: 153378
2012-03-24 09:47:56 +00:00
Alexey Samsonov 78481835ae [ASan] use ASAN_INTERCEPT_STRNLEN instead of defined(__APPLE__)
llvm-svn: 153377
2012-03-24 09:10:50 +00:00
Alexey Samsonov c8efe828a9 [ASan] add interceptor for strtoll
llvm-svn: 153376
2012-03-24 08:39:14 +00:00
Timur Iskhodzhanov 99cc6235bc [ASan/tests] Make 'noinline' and a bunch of other stuff portable
llvm-svn: 153333
2012-03-23 13:10:59 +00:00
Timur Iskhodzhanov f392910965 [ASan] replace '#if ... or ...' with '#if ... || ...'
llvm-svn: 153332
2012-03-23 12:21:47 +00:00
Timur Iskhodzhanov 72859836ab [ASan] Add a few more malloc-related interceptors for Windows
llvm-svn: 153327
2012-03-23 11:33:02 +00:00
Alexander Potapenko 83a689887e Handle two-byte short jumps in the relocated code.
After the instructions are moved to the branch island, fixupInstructions() expands every 2-byte ja/je instruction with a 1-byte offset into a 6-byte ja/je with 32-bit offset. The offset is fixed to point to the original function.

llvm-svn: 153249
2012-03-22 11:29:53 +00:00
Kostya Serebryany 3f56851f5c [asan] extend the test for long double bug
llvm-svn: 153190
2012-03-21 15:29:28 +00:00
Alexey Samsonov b8a047261c [asan] one more try to remove pthread.h from asan_interceptors.cc
llvm-svn: 153188
2012-03-21 15:02:39 +00:00
Alexey Samsonov 9113f3e000 [asan] add missing declarations from string.h and remove this header
llvm-svn: 153187
2012-03-21 14:33:15 +00:00
Alexey Samsonov abbcccc187 [asan] use extern declaraions of libc functions on Win and on Mac
llvm-svn: 153186
2012-03-21 14:22:28 +00:00
Alexey Samsonov ef50dfd6aa [asan]: remove signal.h system header from interceptors
llvm-svn: 153183
2012-03-21 13:44:39 +00:00
Alexey Samsonov 8ada45553d [asan]: substitute extern decls with system header in asan_mac.cc
llvm-svn: 153182
2012-03-21 13:00:04 +00:00
Alexey Samsonov 9ce04b0c36 [asan] merge mac-specific interceptors into one function
llvm-svn: 153180
2012-03-21 12:42:00 +00:00
Alexey Samsonov 5f7048b396 [asan]: remove asan_mac.h
llvm-svn: 153179
2012-03-21 12:29:54 +00:00
Alexey Samsonov 1d4145380e [asan]: start removing os-specific asan_mac.h - move inclusion of mac system header to asan_mac.cc
llvm-svn: 153178
2012-03-21 12:03:44 +00:00
Evgeniy Stepanov 823085a8f4 [asan] Support for %z to Printf()
At the moment, asan internal Printf() uses %l modifier for printing
values of size_t and related types. This works, because we control
both the implementation of Printf and all its uses, but can be a
little misleading.

This change adds support for %z to Printf(). All callers that print
sizes and pointers as integers are switched to %zu / %zx.

llvm-svn: 153177
2012-03-21 11:32:46 +00:00
Alexander Potapenko 1159250518 s/Printf/Report for libc interceptors (need this to debug the potential double interception)
llvm-svn: 153175
2012-03-21 09:33:05 +00:00
Alexey Samsonov 1479418407 [ASan] get rid of setjmp.h header in interceptors
llvm-svn: 153085
2012-03-20 11:40:09 +00:00
Alexey Samsonov c298b3674f [ASan]: remove GetMacosVersion from asan_mac.h header
llvm-svn: 153084
2012-03-20 10:54:40 +00:00
Alexey Samsonov cae79fbab9 [ASan]: re-enable noreturn attribute on posix
llvm-svn: 153082
2012-03-20 10:14:55 +00:00
Kostya Serebryany 74a908bb85 [asan] disable GetOwnershipStressTest on non-linux
llvm-svn: 152953
2012-03-16 22:15:22 +00:00
Kostya Serebryany af32a84b24 [asan] added an assert in InitializeAsanInterceptors (it should be run just once)
llvm-svn: 152945
2012-03-16 21:02:13 +00:00
Alexander Potapenko fa391a7df2 [ASan] Print the parsed ASAN_OPTIONS for verbosity>0.
Move the flags around slightly.

llvm-svn: 152929
2012-03-16 16:38:31 +00:00
Kostya Serebryany e059c124a8 [asan] one more -Wnull-conversion fix
llvm-svn: 152773
2012-03-15 04:26:00 +00:00
Kostya Serebryany 54a3cac5c5 [asan] fix unwinding inside libc intercepors (asan issue #46)
llvm-svn: 152768
2012-03-15 01:36:00 +00:00
Kostya Serebryany fd2037162e [asan] performance optimization: make sure the check for poisoned shadow inside inteceptors is inlined
llvm-svn: 152767
2012-03-15 01:18:06 +00:00
Kostya Serebryany baf68ffcf8 [asan] fix -Wnull-conversion warnings
llvm-svn: 152747
2012-03-14 22:48:09 +00:00
Timur Iskhodzhanov d8d9fd66c6 [ASan] Undo NORETURN on POSIX as it's not clear how to do this cleanly yet
llvm-svn: 152631
2012-03-13 16:48:46 +00:00
Timur Iskhodzhanov f0b7595e08 [ASan] Fix build error on Linux; screen-reviewed by glider@google.com
llvm-svn: 152629
2012-03-13 16:29:25 +00:00
Timur Iskhodzhanov 70df757918 [ASan/Win] Eliminate a couple of FIXMEs, add NORETURN to CheckFailed/UNIMPLEMENTED
llvm-svn: 152628
2012-03-13 16:12:03 +00:00
Timur Iskhodzhanov cf526ff278 [ASan/Win] Fix wrong memmove,memcpy,memset interceptor definitons
llvm-svn: 152622
2012-03-13 10:42:34 +00:00
Alexey Samsonov 8b5f7c5aa2 AddressSanitizer: fix a couple of typos
llvm-svn: 152617
2012-03-13 06:46:32 +00:00
Kostya Serebryany b0712f8e68 [asan] output test for memcmp
llvm-svn: 152594
2012-03-13 01:04:06 +00:00
Timur Iskhodzhanov 2f48b870f3 [ASan] Add back the support for /MT; intercept statically-linked functions
llvm-svn: 152557
2012-03-12 11:45:09 +00:00
Timur Iskhodzhanov fead7f5aa5 [ASan] Use WriteFile instead of fwrite in AsanWrite
llvm-svn: 152540
2012-03-11 12:45:12 +00:00
Kostya Serebryany b0f9354168 [asan] use O(log(N)) algorithm instead of O(N) in __asan_get_ownership
llvm-svn: 152467
2012-03-10 01:30:01 +00:00
Kostya Serebryany 8aff411add [asan] add a (disabled) stress test for __asan_get_ownership
llvm-svn: 152362
2012-03-09 01:48:18 +00:00
Kostya Serebryany f7fc1d4859 [asan]: fix off-by-one error in stack unwinder (asan issue #44; reproduced thanks to 'csmith' fuzzer)
llvm-svn: 152347
2012-03-08 22:25:08 +00:00
Kostya Serebryany c7835f301e [asan] don't use dl_iterate_phdr on linux, go back to using /proc/self/maps. Hopefully fixes the problem reported by our mozilla friends.
llvm-svn: 152341
2012-03-08 21:19:07 +00:00
Timur Iskhodzhanov bc08fed082 [ASan] Fix lint warning
llvm-svn: 152226
2012-03-07 11:33:15 +00:00
Timur Iskhodzhanov d8dd07f2ff [ASan/Win] Intercept _msize, required for running SQLite
llvm-svn: 152224
2012-03-07 11:19:26 +00:00
Alexander Potapenko b780ad9117 Force __asan_handle_no_return into the binary built with ASan.
llvm-svn: 152117
2012-03-06 11:45:59 +00:00
Eli Friedman e781266905 Make sure to properly ifdef out an unused function on OSX < 10.6. PR12136. Patch from Jeremy Huddleston.
llvm-svn: 152085
2012-03-06 01:21:14 +00:00
Evgeniy Stepanov f485c3ccbd [asan] Add a negative test for memcpy of long double.
llvm-svn: 151888
2012-03-02 10:42:10 +00:00
Alexander Potapenko 8e9d772c5a Force __asan_set_death_callback into the resulting binary.
llvm-svn: 151808
2012-03-01 14:39:21 +00:00
Timur Iskhodzhanov 972720e564 [ASan] Replace CRT .dll malloc with our implementation at asan_init() time
llvm-svn: 151715
2012-02-29 11:43:03 +00:00
Alexander Potapenko 7e07f56811 Introduce __asan_set_error_report_callback() to allow the client program post-process the error reports.
If the callback is set, Report() and Printf() print the reports into a buffer (together with stderr), which is then passed to the client.

llvm-svn: 151528
2012-02-27 14:06:48 +00:00
Evgeniy Stepanov d84e16e6a3 Replace some #ifdef(s) with plain if(s).
llvm-svn: 151526
2012-02-27 13:07:29 +00:00
Alexey Samsonov a1a3a2ffc3 AddressSanitizer: add some checks to AsanChunkFifoList::PushList
llvm-svn: 151521
2012-02-27 09:06:10 +00:00