Sergey Matveev
9be70fbda9
[sanitizer] Introduce VReport and VPrintf macros and use them in sanitizer code.
...
Instead of "if (common_flags()->verbosity) Report(...)" we now have macros.
llvm-svn: 196497
2013-12-05 12:04:51 +00:00
Alexey Samsonov
4d369187ec
[Sanitizer] Print symbolized stack frame using a single Printf() call.
...
This reduces the number of "write" syscalls performed to print a single
stack frame description, and makes sanitizer output less intermixed with
program output. Also, add a number of unit tests.
llvm-svn: 194686
2013-11-14 09:41:24 +00:00
Dmitry Vyukov
4314e319ab
tsan: allow to override OnPrint() callback in Go runtime
...
llvm-svn: 192576
2013-10-14 09:52:40 +00:00
Timur Iskhodzhanov
eee13914e2
Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where SANITIZER_INTERFACE_ATTRIBUTE or SANITIZER_ATTRIBUTE_WEAK are used
...
llvm-svn: 188261
2013-08-13 11:42:45 +00:00
Sergey Matveev
9450108430
[sanitizer] Support padding with spaces in Printf.
...
llvm-svn: 185082
2013-06-27 15:30:44 +00:00
Dmitry Vyukov
e979c5467c
tsan: fix windows mingw build
...
llvm-svn: 183644
2013-06-10 10:02:02 +00:00
Timur Iskhodzhanov
cc61eefd4b
Fix MSVC W3 compiler warnings
...
llvm-svn: 182857
2013-05-29 14:11:44 +00:00
Peter Collingbourne
ffaf2eac4d
[nolibc] Move all platforms to internal_getpid.
...
Before, we had an unused internal_getpid function for Linux, and a
platform-independent GetPid function. To make the naming conventions
consistent for syscall-like functions, the GetPid syscall wrapper
in sanitizer_posix.cc is moved to sanitizer_mac.cc, and GetPid is
renamed to internal_getpid, bringing the Linux variant into use.
llvm-svn: 182132
2013-05-17 16:56:53 +00:00
Dmitry Vyukov
93b2cba03b
asan: fix windows build
...
llvm-svn: 180788
2013-04-30 13:30:29 +00:00
Dmitry Vyukov
e8fa45a02c
asan/tsan: fix printf(), on the second pass it prints garbage and crashes on random pointer dereference
...
llvm-svn: 180784
2013-04-30 12:27:48 +00:00
Alexey Samsonov
1a6cfb46e5
[Sanitizer] Rework r176802: share code between Printf and Report and simplify it a bit
...
llvm-svn: 179755
2013-04-18 13:18:23 +00:00
Alexey Samsonov
734aab4066
[Sanitizer] Use a common mutex to prevent mixing reports from different sanitizers. This fixes PR15516
...
llvm-svn: 178853
2013-04-05 07:30:29 +00:00
Alexey Samsonov
87c2a87b50
[Sanitizer] Fix OnPrint weak hook. Disable weak hooks for gotsan.
...
llvm-svn: 178640
2013-04-03 13:22:54 +00:00
Dmitry Vyukov
f3bc56bb6b
asan/tsan: change SANITIZER_GO to more general SANITIZER_SUPPORTS_WEAK_HOOKS
...
llvm-svn: 178009
2013-03-26 12:07:04 +00:00
Dmitry Vyukov
7886253fee
asan/tsan: add Printf/Report hook
...
The hook can be overriden in frontend to print to e.g. a file.
llvm-svn: 177864
2013-03-25 12:58:09 +00:00
Evgeniy Stepanov
24aad9c0cb
Break a >80 char line.
...
llvm-svn: 176937
2013-03-13 08:17:39 +00:00
Alexander Potapenko
1f78ad5da4
[ASan] Reduce the local buffer size in Report() not to fail the check enforced when building TSan runtime.
...
llvm-svn: 176804
2013-03-11 13:36:39 +00:00
Alexander Potapenko
18c916c6c5
[ASan] Try to use a small (512 bytes) stack-local buffer in Report() for short messages, fall back to MmapOrDie() in the case of a failure.
...
This shall eliminate most of the cryptic "ERROR: failed to mmap" messages caused by recursively calling MmapOrDie() from MmapOrDie().
llvm-svn: 176802
2013-03-11 11:47:43 +00:00
Richard Smith
54fc2370f9
Don't escape %s in printf usage message; it's not written by printf.
...
llvm-svn: 170413
2012-12-18 05:49:49 +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
3a3488e4e1
[Sanitizer] replace while with internal_memset to make sure compiler won't replace it with library memset
...
llvm-svn: 168422
2012-11-21 11:12:57 +00:00
Richard Smith
05dce7e644
-fsanitize=undefined: Switch to using sanitizer_common for output. This gets us much closer to not depending on any system headers.
...
llvm-svn: 167888
2012-11-13 23:42:05 +00:00
Alexey Samsonov
ad9d65feb8
[TSan] finally remove TsanPrintf in favor of Printf from sanitizer_common
...
llvm-svn: 167294
2012-11-02 12:17:51 +00:00
Kostya Serebryany
5b0a8f3f53
[asan] fix the va_arg usage
...
llvm-svn: 163879
2012-09-14 06:52:46 +00:00
Kostya Serebryany
45d849c4bd
[asan] add asan option log_path=PATH to let users redirect asan reports to a file PATH.PID instead of stderr
...
llvm-svn: 163872
2012-09-14 04:35:14 +00:00
Kostya Serebryany
d0d96bfb86
[asan/tsan] use InternalScopedBuffer instead of stack arrays. Use mmap inseted of InternalAlloc in InternalScopedBuffer
...
llvm-svn: 162834
2012-08-29 08:40:36 +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
Alexey Samsonov
e1cb524226
[Sanitizer] Renaming: SNPrintf -> internal_snprintf (and move it to sanitizer libc)
...
llvm-svn: 158710
2012-06-19 09:21:57 +00:00
Alexey Samsonov
40d5b772e5
[Sanitizer] Switch to common mmap/munmap routines in ASan run-time.
...
llvm-svn: 158078
2012-06-06 16:15:07 +00:00
Alexey Samsonov
51ae983718
[Sanitizer]: Introduce a common internal printf function. For now, also use tool-specific wrappers TsanPrintf (its output is controlled by TSan flags) and AsanPrintf (which copies its results to the ASan-private buffer). Supported formats: %[z]{d,u,x}, %s, %p. Re-write all format strings in TSan according to this format (this should have no effect on 64-bit platforms).
...
llvm-svn: 158065
2012-06-06 13:11:29 +00:00