Alexey Samsonov
45b6edbd1d
ASan: add new interface functions - __asan_(un)poison_stack_memory. Calls to these functions are inserted by the instrumentation pass in use-after-scope mode
...
llvm-svn: 169201
2012-12-04 01:38:15 +00:00
Alexey Samsonov
0d7755ccb5
[ASan] Add interceptor for swapcontext to fight with false positives in some of its use cases.
...
llvm-svn: 168508
2012-11-23 09:46:34 +00:00
Kostya Serebryany
734f1eb5f4
[asan/tsan] do not use __WORDSIZE macro, as it is glibc-private thing. Instead, define our own SANITIZER_WORDSIZE
...
llvm-svn: 168424
2012-11-21 12:38:58 +00:00
Alexey Samsonov
27a22688b9
[ASan] use raw Exit() to kill the program in case ASan finds an error while reporting the error in the same thread
...
llvm-svn: 168308
2012-11-19 11:22:22 +00:00
Alexander Potapenko
bcc00a4174
[ASan] Revert r168040 and r168043 and take a cleaner solution suggested by Kostya: return the known frame name for fake stack instead of looking it up.
...
llvm-svn: 168046
2012-11-15 15:24:42 +00:00
Alexander Potapenko
b34db9e883
[ASan] Poison the leftmost shadow byte with a special value so that we can find
...
the beginning of the fake frame when reporting an use-after-return error.
Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=126
llvm-svn: 168040
2012-11-15 13:40:44 +00:00
Kostya Serebryany
16205cd4fa
[asan] change the asan output slightly to avoid user confusion: a) add ':' after 'AddressSanitizer' and b) changed 'crashed' to 'SEGV'
...
llvm-svn: 165932
2012-10-15 13:04:58 +00:00
Alexey Samsonov
78c340d205
[ASan] Change __asan_set_on_error_callback to weak overridable __asan_on_error, so that ASan would call the latter even if it finds the error early (i.e. during module initialization)
...
llvm-svn: 165008
2012-10-02 14:06:39 +00:00
Alexey Samsonov
8661465edd
[ASan] Move printing descriptions of heap addresses in error report from allocator internals to asan_report.cc.
...
llvm-svn: 164112
2012-09-18 07:38:10 +00:00
Alexey Samsonov
3869b4b35a
[ASan] increase sleep time if ASan finds two bugs simultaneously to make sure full error report is printed
...
llvm-svn: 164018
2012-09-17 08:02:19 +00:00
Chandler Carruth
b156b56a28
Revert r163411 based on review discussion.
...
In code review, it looked like these warnings do not actually fire with
modern Clang or GCC. However, the pragma is flat out rejected by GCC in
many configurations (-Werror) so it ended up causing more problems than
it fixed.
Daniel agreed with reverting this, but I think didn't have time to get
to it.
llvm-svn: 163583
2012-09-11 01:13:51 +00:00
Daniel Dunbar
04ab17b0cd
[asan] Suppress some bogus -Winvalid-noreturn diagnostics.
...
llvm-svn: 163411
2012-09-07 19:57:20 +00:00
Alexey Samsonov
c402cb62fd
[ASan] Add print_full_thread_history runtime option (on by default) that prints all full thread creation paths for threads involved in ASan error report
...
llvm-svn: 163200
2012-09-05 07:37:15 +00:00
Kostya Serebryany
a57b4e823a
[asan] even more refactoring to move StackTrace to sanitizer_common
...
llvm-svn: 162754
2012-08-28 13:49:49 +00:00
Kostya Serebryany
6b0d775229
[asan] some renaming before we move StackTrace into sanitizer_common
...
llvm-svn: 162747
2012-08-28 11:54:30 +00:00
Kostya Serebryany
bb6f165952
[asan] get rid of AsanPrintf in favor of Printf from sanitizer_common
...
llvm-svn: 162746
2012-08-28 11:34:40 +00:00
Kostya Serebryany
676bcdb838
[asan] run-time part of the initialization order checker. Patch by Reid Watson with some bits from kcc. The sub-pass is off by default for now. On simple tests it works fine.
...
llvm-svn: 162278
2012-08-21 14:10:25 +00:00
Alexey Samsonov
f87ff74075
[ASan] Add __asan_set_on_error_callback() interface function that allows user to set a callback to be called right when ASan detects an error
...
llvm-svn: 161754
2012-08-13 11:23:40 +00:00
Alexey Samsonov
a72c7cf227
[ASan] If ASan finds second error report, wait for some time and die (instead of running in a busy loop) to make sure ASan won't hang if it finds error while reporting an error in the same thread
...
llvm-svn: 161749
2012-08-13 09:57:19 +00:00
Alexey Samsonov
b93df94238
[ASan] share code executed at the beginning/end of printing error reports
...
llvm-svn: 161666
2012-08-10 15:13:05 +00:00
Alexey Samsonov
f343eb7df4
[ASan] Move mac-specific error reports to asan_report.cc as well
...
llvm-svn: 161576
2012-08-09 12:15:40 +00:00
Alexey Samsonov
b53a670817
[ASan] Small fix to please tests on Windows, where stack unwinding using provided pc/bp works too bad
...
llvm-svn: 161575
2012-08-09 11:29:13 +00:00
Alexey Samsonov
f688412b8c
[ASan] Move __asan_report_error implementation to asan_report.cc
...
llvm-svn: 161574
2012-08-09 10:56:57 +00:00
Alexey Samsonov
65b9acf0af
[ASan] move code that describes globals to asan_report.cc
...
llvm-svn: 161572
2012-08-09 09:27:24 +00:00
Alexey Samsonov
4ce12349d6
[ASan] move some functions that describe addresses to asan_report.cc
...
llvm-svn: 161571
2012-08-09 09:06:52 +00:00
Alexey Samsonov
c0ff933d8b
[ASan] Move error reporting code away from file with interceptors
...
llvm-svn: 161570
2012-08-09 08:32:33 +00:00
Alexey Samsonov
b4b316fc5b
[ASan] Move error reports away from ASan allocator. Add new source file to CMakeLists as well
...
llvm-svn: 161569
2012-08-09 08:15:46 +00:00
Alexey Samsonov
aa05110a17
[ASan] Create new files asan_report.{h,cc} as a preparation for refactoring of ASan error reporting code.
...
Currently ASan reports many kinds of errors, and the code that actually prints error messages can
be found inside allocator, OS-specific files, interceptors code etc.
An example of maintenance troubles this situation causes:
There is currently an ASan interface function that registers
callback which should take the char buffer with error report printed by ASan.
This function is now broken, as one has to insert callback calls to all the places in
ASan code where the error reports are printed, surprisingly it is not only
"__asan_report_error" function...
llvm-svn: 161568
2012-08-09 07:40:58 +00:00