Eric Fiselier
909deebfc8
[compiler-rt] Make the MSAN wmemset intercepter call wmemset instead of memset. Fixes PR 21579
...
Summary:
Exactly what the title says. I've tested this change against the libc++ test failures and it solves all of them. The check-msan rule also still passes.
I'm not sure why it called memset originally.
I can add tests if requested but currently there are no tests involving wide chars and they are a c++11 features.
Reviewers: kcc, eugenis
Reviewed By: eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6352
llvm-svn: 222673
2014-11-24 18:17:04 +00:00
Alexey Samsonov
de13018874
[MSan] [MIPS] Adding support for MIPS64 (patch by Mohit Bhakkad).
...
Reviewed at http://reviews.llvm.org/D5906
llvm-svn: 222388
2014-11-19 21:42:33 +00:00
Evgeniy Stepanov
7555f5ed1f
[msan] Remove MSanDR and supporting code.
...
MSanDR is a dynamic instrumentation tool that can instrument the code
(prebuilt libraries and such) that could not be instrumented at compile time.
This code is unused (to the best of our knowledge) and unmaintained, and
starting to bit-rot.
llvm-svn: 222232
2014-11-18 10:33:15 +00:00
Alexey Samsonov
4925fd4b05
Fix -Wcast-qual warnings in sanitizers
...
llvm-svn: 221936
2014-11-13 22:40:59 +00:00
Yury Gribov
ecfa592671
Removed r221896, it seems to break build in various ways.
...
llvm-svn: 221912
2014-11-13 19:37:30 +00:00
Yury Gribov
17072ef348
[ASan] Add process basename to log name and error message to simplify analysis of sanitized systems logs.
...
Reviewed at http://reviews.llvm.org/D5724
llvm-svn: 221896
2014-11-13 16:01:23 +00:00
Richard Trieu
b6b141d601
delete => delete[] for arrays.
...
llvm-svn: 221769
2014-11-12 04:19:57 +00:00
Alexey Samsonov
e853b4f2e4
[Sanitizer] Return code that calculates hash for stacktrace back to StackDepot implementation
...
llvm-svn: 220663
2014-10-27 03:10:27 +00:00
Alexey Samsonov
3741ab82ba
Change StackDepot interface to use StackTrace more extensively
...
llvm-svn: 220637
2014-10-26 06:23:07 +00:00
Alexey Samsonov
9c85927012
[Sanitizer] Make StackTrace a lightweight reference to array of PCs, and
...
introduce a BufferedStackTrace class, which owns this array.
Summary:
This change splits __sanitizer::StackTrace class into a lightweight
__sanitizer::StackTrace, which doesn't own array of PCs, and BufferedStackTrace,
which owns it. This would allow us to simplify the interface of StackDepot,
and eventually merge __sanitizer::StackTrace with __tsan::StackTrace.
Test Plan: regression test suite.
Reviewers: kcc, dvyukov
Reviewed By: dvyukov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5985
llvm-svn: 220635
2014-10-26 03:35:14 +00:00
Evgeniy Stepanov
35eb265421
[msan] Handle param-tls overflow.
...
ParamTLS (shadow for function arguments) is of limited size. This change
makes all arguments that do not fit unpoisoned, and avoids writing
past the end of a TLS buffer.
llvm-svn: 220351
2014-10-22 00:12:40 +00:00
Kuba Brecka
14c0c5901d
[compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, let's rename it to append_list_if
...
Doing s/append_if/append_list_if/, no functional change.
http://reviews.llvm.org/D5739
llvm-svn: 219860
2014-10-15 22:47:54 +00:00
Evgeniy Stepanov
bb91e02efd
[msan] Make origin tracking fork-safe.
...
Chained origins make plain memory stores async-signal-unsafe.
We already disable it inside signal handlers.
This change grabs all origin-related locks before fork() and releases
them after fork() to avoid a deadlock in the child process.
llvm-svn: 217140
2014-09-04 10:36:14 +00:00
Evgeniy Stepanov
f1741f52ad
[msan] Fix origin_history_per_stack_limit=0 behavior.
...
It disables the per-stack limit.
llvm-svn: 217030
2014-09-03 12:15:59 +00:00
Kostya Serebryany
74bd6bc9f9
[sanitizer] move mlock interceptor from asan/tsan/msan to common; no functionality change intended
...
llvm-svn: 216407
2014-08-25 20:57:59 +00:00
Alexey Samsonov
5a32f79af3
[MSan] Disable coredump for 64-bit binaries.
...
llvm-svn: 215482
2014-08-12 22:37:47 +00:00
Alexey Samsonov
b9ec65cd4d
[Sanitizer] Kill deprecated allocator interfaces in ASan, MSan and TSan in favor of
...
a unified interface in <sanitizer/allocator_interface.h>.
llvm-svn: 215469
2014-08-12 20:28:20 +00:00
Evgeniy Stepanov
37e069c2ac
[msan] Fix fcvt interceptor.
...
fcvt() result can be heap-allocated and must be unpoisoned.
llvm-svn: 215106
2014-08-07 12:45:55 +00:00
Alexey Samsonov
1440105338
[Sanitizer] Simplify Symbolizer creation interface.
...
Get rid of Symbolizer::Init(path_to_external) in favor of
thread-safe Symbolizer::GetOrInit(), and use the latter version
everywhere. Implicitly depend on the value of external_symbolizer_path
runtime flag instead of passing it around manually.
No functionality change.
llvm-svn: 214005
2014-07-26 01:37:23 +00:00
Alexey Samsonov
d6906e4ffe
[MSan] Fix strncpy interceptor
...
llvm-svn: 213590
2014-07-22 00:10:08 +00:00
Evgeniy Stepanov
465466e80c
[msan] Stop demangling function name in the stack origin report.
...
This was done by calling __cxa_demangle directly, which is bad
when c++abi library is instrumented. The following line always
contains the demangled name (when running with a symbolizer) anyway.
llvm-svn: 212929
2014-07-14 09:35:27 +00:00
Evgeniy Stepanov
9c62621c4b
[msan] A comment for the chained-origin-depot hash function.
...
llvm-svn: 212801
2014-07-11 09:09:37 +00:00
Evgeniy Stepanov
db298121e0
[msan] Use real memset/memcpy/memmove in interceptors.
...
Our versions are not exactly as fast as libc's, and
MSan uses them heavily (even compared to other sanitizers).
This will break if libc version of mem* are instrumented,
but they never are, and if they are, we should be able
to fix it on libc side.
llvm-svn: 212799
2014-07-11 08:57:57 +00:00
Evgeniy Stepanov
8fc7e1fb13
[msan] Fix performance issue in fast_memset.
...
Fast path was never triggered when called from __msan_poison.
llvm-svn: 212715
2014-07-10 12:45:56 +00:00
Evgeniy Stepanov
c2c435f95d
[msan] Switch chained origins hash to murmur2.
...
llvm-svn: 212704
2014-07-10 11:02:33 +00:00
Evgeniy Stepanov
eb893a1fd6
[msan] Fix out of bounds access in origin copying.
...
llvm-svn: 212534
2014-07-08 14:15:23 +00:00
Alexey Samsonov
91bb8e0e3a
Generalize sanitizer allocator public interface.
...
Introduce new public header <sanitizer/allocator_interface.h> and a set
of functions __sanitizer_get_ownership(), __sanitizer_malloc_hook() etc.
that will eventually replace their tool-specific equivalents
(__asan_get_ownership(), __msan_get_ownership() etc.). Tool-specific
functions are now deprecated and implemented as stubs redirecting
to __sanitizer_ versions (which are implemented differently in each tool).
Replace all uses of __xsan_ versions with __sanitizer_ versions in unit
and lit tests.
llvm-svn: 212469
2014-07-07 17:39:31 +00:00
Evgeniy Stepanov
f0831ee8d2
[msan] Increase hash table size for chained origins.
...
llvm-svn: 212448
2014-07-07 10:45:15 +00:00
Evgeniy Stepanov
037f77092e
[msan] Better hash function for chained origins.
...
llvm-svn: 212440
2014-07-07 08:31:55 +00:00
Evgeniy Stepanov
50498e114f
[msan] Reformat one source file.
...
llvm-svn: 212329
2014-07-04 10:07:39 +00:00
Kostya Serebryany
7c163a44aa
[sanitizer] support c11 aligned_alloc, Linux only for now
...
llvm-svn: 212322
2014-07-04 07:30:34 +00:00
Alexey Samsonov
e3a401a12b
[MSan] Fixup r212082: enable tests for _mm_ intrinsics if and only if the
...
unit test source file is compiled with Clang.
llvm-svn: 212121
2014-07-01 19:58:41 +00:00
Alexey Samsonov
c0fda339e2
Add the way to disable MSan unit tests for _mm_* intrinsics
...
llvm-svn: 212082
2014-07-01 01:38:52 +00:00
Evgeniy Stepanov
4e2d5edb0c
[msan] Limit stack origin chain length.
...
Stack origins were created with unlimited length by mistake.
llvm-svn: 212036
2014-06-30 11:22:42 +00:00
Evgeniy Stepanov
c935ca8c3c
[msan] Add store_context_size= flag.
...
A new flag to control stack trace size for store event (in
track-origins=2 mode) independently of malloc_context_size.
llvm-svn: 211896
2014-06-27 12:48:01 +00:00
Evgeniy Stepanov
7d3c68a9cf
[msan] Fix truncated stack trace in chained origin reports.
...
This is a leftover from the times when the next (chained) origin id
was stored as the last frame of a stack trace.
llvm-svn: 211878
2014-06-27 07:32:08 +00:00
Evgeniy Stepanov
b163f0276f
[msan] Fix bad interaction between with-calls mode and chained origin tracking.
...
Origin history should only be recorded for uninitialized values, because it is
meaningless otherwise. This change moves __msan_chain_origin to the runtime
library side and makes it conditional on the corresponding shadow value.
Previous code was correct, but _very_ inefficient.
llvm-svn: 211700
2014-06-25 14:41:57 +00:00
Evgeniy Stepanov
7ad0bde843
[msan] Fix false positive on dynamic tls.
...
Use existing DTLS code in sanitizer_tls_get_addr.{h,cc} to unpoison DTLS
blocks both on allocation and deallocation.
https://code.google.com/p/memory-sanitizer/issues/detail?id=44
llvm-svn: 211683
2014-06-25 11:30:35 +00:00
Evgeniy Stepanov
8717fec9af
[msan] Fix origin copying.
...
Conditions for the first and the last origin value in range were wrong.
llvm-svn: 211585
2014-06-24 11:50:26 +00:00
Evgeniy Stepanov
ad8065f01a
[msan] Print stats even on successful run with atexit=1.
...
llvm-svn: 211574
2014-06-24 09:04:06 +00:00
Evgeniy Stepanov
4ea1647e8b
[msan] Handle X86 *.psad.* and *.pmadd.* intrinsics.
...
llvm-svn: 211156
2014-06-18 12:02:29 +00:00
Evgeniy Stepanov
9959915890
[msan] Intercept __strto*_internal.
...
This should fix strtoimax/strtoumax on newer glibc.
https://code.google.com/p/memory-sanitizer/issues/detail?id=36
llvm-svn: 210463
2014-06-09 10:41:22 +00:00
Evgeniy Stepanov
66c6a18d39
[msan] Add a test for mmx.packuswb.
...
llvm-svn: 210458
2014-06-09 08:58:41 +00:00
Evgeniy Stepanov
aaaf74f9fb
[msan] Simplify tests.
...
llvm-svn: 210457
2014-06-09 08:57:40 +00:00
Evgeniy Stepanov
ee98fb197b
[msan] Fix wrong endianness when printing shadow.
...
llvm-svn: 210335
2014-06-06 14:06:14 +00:00
Evgeniy Stepanov
3e810b01c3
[msan] Partial revert of r210331.
...
Bots did not like it.
llvm-svn: 210332
2014-06-06 13:35:25 +00:00
Evgeniy Stepanov
9438bf1f62
[msan] Better diagnostic for invalid origin id.
...
llvm-svn: 210331
2014-06-06 12:58:44 +00:00
Sergey Matveev
dcd9bba602
[sanitizer] Make LSan/MSan/TSan honor the "color" flag.
...
Based on a patch by Stephan Bergmann.
llvm-svn: 210199
2014-06-04 16:57:03 +00:00
Evgeniy Stepanov
d425a2b169
[msan] Handle x86 vector pack intrinsics.
...
llvm-svn: 210020
2014-06-02 12:31:44 +00:00
Dmitry Vyukov
5864ac39ee
tsan: do not use 64-bit atomics in allocator code
...
64-bit atomics make porting of asan to 32-bits platforms problematic.
llvm-svn: 209744
2014-05-28 15:22:12 +00:00
Evgeniy Stepanov
567e516015
[asancov] Write coverage directly to a memory-mapped file.
...
This way does not require a __sanitizer_cov_dump() call. That's
important on Android, where apps can be killed at arbitrary time.
We write raw PCs to disk instead of module offsets; we also write
memory layout to a separate file. This increases dump size by the
factor of 2 on 64-bit systems.
llvm-svn: 209653
2014-05-27 12:37:52 +00:00
Sergey Matveev
a531058d2b
[MSan] Implement __sanitizer_print_stack_trace().
...
llvm-svn: 209625
2014-05-26 13:08:08 +00:00
Evgeniy Stepanov
bce21acf25
[msan] Implement MSAN_OPTIONS=print_stats=1.
...
llvm-svn: 209287
2014-05-21 09:56:28 +00:00
Evgeniy Stepanov
208aae8ee0
[msan] Chained origins re-design.
...
Generalize StackDepot and create a new specialized instance of it to
efficiently (i.e. without duplicating stack trace data) store the
origin history tree.
This reduces memory usage for chained origins roughly by an order of
magnitude.
Most importantly, this new design allows us to put two limits on
stored history data (exposed in MSAN_OPTIONS) that help avoid
exponential growth in used memory on certain workloads.
See comments in lib/msan/msan_origin.h for more details.
llvm-svn: 209284
2014-05-21 09:02:13 +00:00
Alexey Samsonov
eacb4d8417
[CMake] Use ExternalProject to build MSan-ified version of libcxx for unit tests.
...
This change lets MSan rely on libcxx's own build system instead of manually
compiling its sources and setting up all the necessary compile flags. It would
also simplify compiling libcxx with another sanitizers (in particular, TSan).
The tricky part is to make sure libcxx is reconfigured/rebuilt when Clang or
MSan runtime library is changed. "clobber" step used in this patch works well
for me, but it's possible it would break for other configurations - will
watch the buildbots.
llvm-svn: 208451
2014-05-09 22:11:03 +00:00
Evgeniy Stepanov
c5e51926dc
[msan] Intercept strxfrm.
...
llvm-svn: 208303
2014-05-08 12:04:01 +00:00
Evgeniy Stepanov
ac030ffb69
[msan] Switch to common printf interceptors.
...
Format string parsing is disabled by default.
This is not expected to meaningfully change the tool behavior.
With this change, check_printf flag could be used to evaluate printf format
string parsing in MSan.
llvm-svn: 208295
2014-05-08 09:50:59 +00:00
Alexey Samsonov
2fccdfbe70
[MSan] Fixup for r206983: MsanThread may be unavailable in signal handler: signals may be raised while thread is being destroyed
...
llvm-svn: 208250
2014-05-07 21:23:12 +00:00
Evgeniy Stepanov
7d46040ff2
[sanitizer] Replace a macro with a function.
...
llvm-svn: 208207
2014-05-07 13:24:28 +00:00
Evgeniy Stepanov
8dd62dc3be
[msan] Fix __msan_check_mem_is_initialized and prettify its output.
...
llvm-svn: 208195
2014-05-07 11:50:14 +00:00
Evgeniy Stepanov
fe250b0014
[msan] Prettify __msan_print_shadow.
...
Makes __msan_print_shadow output much more readable, adds origin info.
llvm-svn: 207622
2014-04-30 09:50:30 +00:00
Evgeniy Stepanov
5a7c364343
[msan] Disable chained origins in signal handlers.
...
StackDepot is not async-signal-safe; storing a new origin to it can deadlock.
llvm-svn: 206983
2014-04-23 14:01:57 +00:00
Evgeniy Stepanov
474011d55d
[msan] Add missing quotes.
...
llvm-svn: 206589
2014-04-18 13:03:54 +00:00
Evgeniy Stepanov
191ebd874f
[msan] Run msan_test in the new with-calls mode.
...
llvm-svn: 206587
2014-04-18 12:19:28 +00:00
Evgeniy Stepanov
83477cb93b
[msan] Missing declarations for the new interface functions.
...
llvm-svn: 206586
2014-04-18 12:18:00 +00:00
Evgeniy Stepanov
8f41674719
[msan] Add new MSan callbacks for instrumentation-with-calls mode.
...
llvm-svn: 206584
2014-04-18 12:15:24 +00:00
Evgeniy Stepanov
9ce9a6cdf6
[msan] Intercept wcsftime().
...
llvm-svn: 206179
2014-04-14 14:59:42 +00:00
Evgeniy Stepanov
d326c81117
[msan] mprotect() more memory to detect user code outside of application range.
...
llvm-svn: 206028
2014-04-11 12:04:29 +00:00
Evgeniy Stepanov
f653cda269
[msan] Introduce MsanThread. Move thread-local allocator cache out of TLS.
...
This reduces .tbss from 109K down to almost nothing.
llvm-svn: 205618
2014-04-04 09:47:41 +00:00
Evgeniy Stepanov
2dcb5c0a2c
[msan] Kill __msan_print_param_shadow.
...
It does not do what it's name says, and what it actually does is hard to
describe, and is not useful at all.
llvm-svn: 205415
2014-04-02 11:55:24 +00:00
Evgeniy Stepanov
80cb930c09
[msan] Add __msan_check_mem_is_initialized.
...
An assert()-like function that checks that a memory range is fully initialized.
llvm-svn: 205413
2014-04-02 11:50:42 +00:00
Evgeniy Stepanov
a55fcd35e9
[msan] Precise origin handling in __unaligned_(load|store)*.
...
llvm-svn: 205412
2014-04-02 11:06:35 +00:00
Evgeniy Stepanov
8dbf3faa16
[msan] clang-format several unit tests
...
llvm-svn: 205410
2014-04-02 09:17:55 +00:00
Evgeniy Stepanov
3c95744de8
[msan] Remove an extra top frame from track-origins=2 reports.
...
llvm-svn: 205192
2014-03-31 14:18:55 +00:00
Alexey Samsonov
78a8435fd6
[CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.
...
Soon there will be an option to build compiler-rt parts as shared libraries
on Linux. Extracted from http://llvm-reviews.chandlerc.com/D3042
by Yuri Gribov.
llvm-svn: 205183
2014-03-31 13:45:36 +00:00
Evgeniy Stepanov
86a4d2c32b
[sanitizer] Intercept fgetpwent / fgetgrent.
...
These interceptors require deep unpoisoning of return values.
While at it, we do the same for all other pw/gr interceptors to
reduce dependency on libc implementation details.
llvm-svn: 205004
2014-03-28 13:03:55 +00:00
Evgeniy Stepanov
74e77756ef
[sanitizer] Intercept getpwent/getgrent.
...
llvm-svn: 205000
2014-03-28 10:56:07 +00:00
Evgeniy Stepanov
89602651e8
[msan] Implement __msan_set_death_callback.
...
llvm-svn: 204926
2014-03-27 14:04:58 +00:00
Evgeniy Stepanov
9dcd5a353a
[msan] Intercept several malloc-related functions.
...
llvm-svn: 204923
2014-03-27 13:29:29 +00:00
Rafael Espindola
5e46070516
Avoid aliases to weak aliases in interceptors.
...
The interceptors had code that after macro expansion ended up looking like
extern "C" void memalign()
__attribute__((weak, alias("__interceptor_memalign")));
extern "C" void __interceptor_memalign() {}
extern "C" void __interceptor___libc_memalign()
__attribute__((alias("memalign")));
That is,
* __interceptor_memalign is a function
* memalign is a weak alias to __interceptor_memalign
* __interceptor___libc_memalign is an alias to memalign
Both gcc and clang produce assembly that look like
__interceptor_memalign:
...
.weak memalign
memalign = __interceptor_memalign
.globl __interceptor___libc_memalign
__interceptor___libc_memalign = memalign
What it means in the end is that we have 3 symbols pointing to the
same position in the file, one of which is weak:
8: 0000000000000000 1 FUNC GLOBAL DEFAULT 1
__interceptor_memalign
9: 0000000000000000 1 FUNC WEAK DEFAULT 1 memalign
10: 0000000000000000 1 FUNC GLOBAL DEFAULT 1
__interceptor___libc_memalign
In particular, note that __interceptor___libc_memalign will always
point to __interceptor_memalign, even if we do link in a strong symbol
for memalign. In fact, the above code produces exactly the same binary
as
extern "C" void memalign()
__attribute__((weak, alias("__interceptor_memalign")));
extern "C" void __interceptor_memalign() {}
extern "C" void __interceptor___libc_memalign()
__attribute__((alias("__interceptor_memalign")));
If nothing else, this patch makes it more obvious what is going on.
llvm-svn: 204823
2014-03-26 15:48:59 +00:00
Evgeniy Stepanov
1382fabd97
[msan] Enable SelectPartial test.
...
Fixed in r204716.
llvm-svn: 204717
2014-03-25 13:09:14 +00:00
Evgeniy Stepanov
517ff05ffb
[msan] Fix compiler warning in msan_test.cc.
...
llvm-svn: 204708
2014-03-25 10:03:39 +00:00
Evgeniy Stepanov
90384ad60e
[msan] A disabled test for inexact "select" instrumentation.
...
llvm-svn: 204707
2014-03-25 09:36:15 +00:00
Alexey Samsonov
c41ca6d31a
[CMake] Rename the variable
...
llvm-svn: 204602
2014-03-24 13:29:20 +00:00
Alexey Samsonov
1847401332
[CMake] Respect CMAKE_CXX_FLAGS in custom clang_compile commands
...
llvm-svn: 204593
2014-03-24 09:42:12 +00:00
Alexey Samsonov
8c956460d3
Make MSan unittest -Werror=sign-compare clean
...
llvm-svn: 204592
2014-03-24 09:41:11 +00:00
Sergey Matveev
fa76f3b3a5
[MSan] Add __msan_unpoison_string() to the public interface.
...
Using __msan_unpoison() on null-terminated strings is awkward because
strlen() can't be called on a poisoned string. This case warrants a special
interface function.
llvm-svn: 204448
2014-03-21 10:12:17 +00:00
Alexander Potapenko
1296436cbf
[libsanitizer] Introduce flag descriptions.
...
Extend ParseFlag to accept the |description| parameter, add dummy values for all existing flags.
As the flags are parsed their descriptions are stored in a global linked list.
The tool can later call __sanitizer::PrintFlagDescriptions() to dump all the flag names and their descriptions.
Add the 'help' flag and make ASan, TSan and MSan print the flags if 'help' is set to 1.
llvm-svn: 204339
2014-03-20 12:52:52 +00:00
Alexey Samsonov
17703c1092
[CMake] Build sanitizer unit tests with -std=c++11
...
llvm-svn: 204234
2014-03-19 13:57:33 +00:00
Evgeniy Stepanov
412d973980
[msan] Origin tracking with history, compiler-rt part.
...
Compiler-rt part of MSan implementation of advanced origin tracking,
when we record not only creation point, but all locations where
an uninitialized value was stored to memory, too.
llvm-svn: 204152
2014-03-18 13:45:19 +00:00
Evgeniy Stepanov
9fa9a49853
[msan] Test for aggregates passing through ellipsis.
...
llvm-svn: 203795
2014-03-13 13:18:15 +00:00
Alexey Samsonov
32956d651a
[CMake] Make append_if semantics similar to those used in LLVM
...
llvm-svn: 203773
2014-03-13 09:31:36 +00:00
Evgeniy Stepanov
72a9d25060
[sanitizer] Simplify interceptors with user callbacks.
...
Get rid of the context argument in UNPOISON_PARAM and INITIALIZE_RANGE.
Get rid of all the thread-local contexts in interceptors.
llvm-svn: 203119
2014-03-06 13:26:09 +00:00
Alexey Samsonov
6dece3c99f
Add common interceptors for memchr/memrchr
...
llvm-svn: 202972
2014-03-05 13:25:32 +00:00
Alexey Samsonov
d964e7cd81
[CMake] Test for libdl and libpthread presence
...
llvm-svn: 202847
2014-03-04 13:28:21 +00:00
Evgeniy Stepanov
f7abc8dff6
[msan] Tests for X86 SIMD bitshift intrinsic support.
...
llvm-svn: 202713
2014-03-03 13:52:36 +00:00
Joerg Sonnenberger
9d09e2fe90
Reapply r201910. MSVC gets __func__ defined explicitly, even though it
...
can't build anything here.
llvm-svn: 202297
2014-02-26 20:33:22 +00:00
Kostya Serebryany
cf5d8e4f29
AdjustStackSizeLinux() is used in Lsan, Tsan and Msan non-Linux-specific code so it seems it should have more generic name and moved to a common scope.
...
Renamed to AdjustStackSize.
Patch by Viktor Kutuzov.
llvm-svn: 202011
2014-02-24 08:53:26 +00:00
Reid Kleckner
324eee45a7
Revert "Replace __FUNCTION__ with __func__, the latter being standard C99/C++11."
...
This reverts commit r201910.
While __func__ may be standard in C++11, it was only recently added to
MSVC in 2013 CTP, and LLVM supports MSVC 2012. __FUNCTION__ may not be
standard, but it's *very* portable.
llvm-svn: 201916
2014-02-22 00:37:45 +00:00
Joerg Sonnenberger
b15779f307
Replace __FUNCTION__ with __func__, the latter being standard C99/C++11.
...
llvm-svn: 201910
2014-02-21 23:55:15 +00:00
Alexey Samsonov
11705b2f10
[CMake] break dependency between unit tests and runtimes in standalone build
...
llvm-svn: 201778
2014-02-20 12:03:56 +00:00
Alexey Samsonov
cd8535a96d
[CMake] Introduce COMPILER_RT_INCLUDE_TESTS option
...
llvm-svn: 201666
2014-02-19 11:18:47 +00:00
Alexey Samsonov
63a4af7346
[CMake] Add top-level target for each compiler-rt library, and add 'compiler-rt' target encompassing them all.
...
llvm-svn: 201556
2014-02-18 09:33:45 +00:00
Alexey Samsonov
878a9a5de2
[CMake] Check for -fPIE and -ffreestanding flags for consistency
...
llvm-svn: 201549
2014-02-18 08:07:09 +00:00
Alexey Samsonov
b73db72a17
[CMake] Simplify setting compile flag disabling RTTI
...
llvm-svn: 201547
2014-02-18 07:52:40 +00:00
Alexey Samsonov
8434e60f7e
Move MSan lit-tests under test/msan
...
llvm-svn: 201412
2014-02-14 13:02:58 +00:00
Evgeniy Stepanov
a21280307f
[sanitizer] Fix getpwuid_r (and similar) interceptors missing one of the arguments.
...
llvm-svn: 201410
2014-02-14 12:32:15 +00:00
Evgeniy Stepanov
05938a23f5
[sanitizer] Use mmap to zero-fill large shadow regions.
...
This is covered by existing ASan test.
This does not change anything for TSan by default (but provides a flag to
change the threshold size).
Based on a patch by florent.bruneau here:
https://code.google.com/p/address-sanitizer/issues/detail?id=256
llvm-svn: 201400
2014-02-14 11:41:26 +00:00
Alexey Samsonov
81a2b466e9
Move shared configs for lit test suites to test/ and unittests/ directories
...
llvm-svn: 201399
2014-02-14 11:00:07 +00:00
Evgeniy Stepanov
fb74ea80dc
[msan] Replicate mmap-below-shadow check in mmap64 interceptor.
...
llvm-svn: 201397
2014-02-14 09:49:29 +00:00
Evgeniy Stepanov
769d46f373
[sanitizer] Use system unwinder in signal handlers on Android.
...
Because of the way Bionic sets up signal stack frames, libc unwinder is unable
to step through it, resulting in broken SEGV stack traces.
Luckily, libcorkscrew.so on Android implements an unwinder that can start with
a signal context, thus sidestepping the issue.
llvm-svn: 201151
2014-02-11 13:38:57 +00:00
Evgeniy Stepanov
791a7e1603
[msan] Return EINVAL instead of crashing from mmap of an invalid address.
...
llvm-svn: 201074
2014-02-10 09:37:03 +00:00
Nick Lewycky
af2064f7ab
Add throw() specifiers to more redeclarations of operator delete and operator delete[].
...
llvm-svn: 201016
2014-02-08 01:42:08 +00:00
Sergey Matveev
4a03fa4f60
[sanitizer] Intercept if_indextoname() and if_nametoindex().
...
llvm-svn: 200945
2014-02-06 20:39:33 +00:00
Sergey Matveev
544d07f861
[sanitizer] One does not simply intercept getifaddrs().
...
Upgrade the interceptor, and attempt to fix the Android build.
llvm-svn: 200936
2014-02-06 18:48:23 +00:00
Sergey Matveev
07802a090a
[sanitizer] Intercept getifaddrs().
...
llvm-svn: 200926
2014-02-06 17:42:36 +00:00
Sergey Matveev
0c62992d6e
[sanitizer] Intercept getresuid and getresgid.
...
llvm-svn: 200925
2014-02-06 15:12:56 +00:00
Sergey Matveev
c5c84a1d86
[sanitizer] Implement ioctl decoding.
...
When an unknown ioctl is encountered, try to guess the parameter size from the
request id.
llvm-svn: 200872
2014-02-05 19:35:24 +00:00
Evgeniy Stepanov
04e841c047
[msan] Fix a typo.
...
Spotted by Keno Fischer.
llvm-svn: 200682
2014-02-03 07:27:01 +00:00
Sergey Matveev
c18b36625e
[sanitizer] Partial revert of recent ioctl changes.
...
Some build environments are missing the required headers.
This reverts r200544, r200547, r200551. This does not revert the change that
introduced READWRITE ioctl type.
llvm-svn: 200567
2014-01-31 19:19:45 +00:00
Sergey Matveev
dffda4cfec
[sanitizer] Attempt to fix Android build.
...
llvm-svn: 200547
2014-01-31 14:28:32 +00:00
Sergey Matveev
6b3397546e
[sanitizer] Support most ioctls from /usr/include/sound/.
...
llvm-svn: 200544
2014-01-31 14:02:21 +00:00
Alexander Potapenko
d5802fe548
Make signal-related functions use __sanitizer_* structures instead of __sanitizer_kernel_* ones.
...
Also rename internal_sigaction() into internal_sigaction_norestorer(), as this function doesn't fully
implement the sigaction() functionality on Linux.
This change is a part of refactoring intended to have common signal handling behavior in all tools.
llvm-svn: 200535
2014-01-31 11:29:51 +00:00
Sergey Matveev
be68311660
[msan] Intercept *getxattr and *listxattr.
...
llvm-svn: 200464
2014-01-30 12:21:12 +00:00
Sergey Matveev
1394f2da85
[msan] Rewrite strto* interceptors and add a few more.
...
Express the strto* interceptors though macros. This removes a lot of
duplicate code and fixes a couple of copypasto bugs (where "res" was declared of
a different type than the actual return type). Also, add a few more interceptors
for strto*_l.
llvm-svn: 200316
2014-01-28 13:45:58 +00:00
Evgeniy Stepanov
0b09c623c1
[msan] Replace assert() with GTest ASSERT_* in msan_test.
...
llvm-svn: 200293
2014-01-28 08:51:39 +00:00
Evgeniy Stepanov
067f54718f
[msan] Disable mmap outside of application address range.
...
llvm-svn: 200200
2014-01-27 09:12:22 +00:00
Kostya Serebryany
e402b431c0
[msan] add __libc_memalign interceptor; add a regression test for the existing bug with dtls support in msan
...
llvm-svn: 199980
2014-01-24 09:14:11 +00:00
Evgeniy Stepanov
b1fa81047a
[msan] Fix GCC warnings.
...
warning: ISO C99 requires rest arguments to be used [enabled by default]
INTERCEPTOR(char *, dlerror) {
warning: invoking macro INTERCEPTOR argument 3: empty macro arguments are undefined in ISO C90 and ISO C++98 [enabled by default]
llvm-svn: 199873
2014-01-23 08:43:12 +00:00
Alexey Samsonov
00cd273c46
Sanitize printf functions.
...
Intercept and sanitize arguments passed to printf functions in ASan and TSan
(don't do this in MSan for now). The checks are controlled by runtime flag
(off by default for now).
Patch http://llvm-reviews.chandlerc.com/D2480 by Yuri Gribov!
llvm-svn: 199729
2014-01-21 11:58:33 +00:00
Evgeniy Stepanov
3ee789cbbb
[msan] Temporarily disable two tests that are failing with new glibc.
...
llvm-svn: 198919
2014-01-10 07:34:16 +00:00
Alexey Samsonov
6322e036aa
[Sanitizer] Replace Symbolizer::IsAvailable and Symbolizer::IsExternalAvailable with Symbolizer::CanReturnFileLineInfo.
...
Remove now redundant checks in symbolizer initialization in TSan and MSan.
llvm-svn: 198000
2013-12-25 07:09:44 +00:00
Evgeniy Stepanov
09021e02bc
[msan] Add missing visibility attribute to MSan new/delete interceptors.
...
llvm-svn: 197809
2013-12-20 13:18:07 +00:00
Evgeniy Stepanov
42cebb00da
[sanitizer] Use the new sanitizer_interception.h header in all interceptors.
...
llvm-svn: 197808
2013-12-20 13:17:31 +00:00
Evgeniy Stepanov
66297cac72
[msan] Wrap indirect calls to REAL(x) in interceptors.
...
llvm-svn: 197806
2013-12-20 12:20:15 +00:00
Evgeniy Stepanov
61628196e4
[msan] Replace wrap_indirect_calls runtime flag with an interface method.
...
llvm-svn: 197799
2013-12-20 11:05:19 +00:00
Alexey Samsonov
f2c7659cf8
[ASan] Get rid of ASan-specific functions for printing stack traces
...
llvm-svn: 197672
2013-12-19 11:25:05 +00:00
Evgeniy Stepanov
a164bf5e89
[msan] Disable DynamoRio detection.
...
This code is not robust enough and triggers when simply linking with
libdynamorio.so, without any code translation at all. Disabling it is safe
(i.e. we may unpoison too much memory and see false negatives, but never false
positives).
llvm-svn: 197568
2013-12-18 13:25:45 +00:00
Evgeniy Stepanov
cb98c5f6f0
[msan] Relax gethostbyname_r test condition.
...
Apparently, its return value depends on the glibc version.
llvm-svn: 197390
2013-12-16 15:01:31 +00:00
Evgeniy Stepanov
43fc44007d
[msan] Fix gethostbyname_r and similar interceptors.
...
*h_errno is written not on success, but on failure.
In fact, it seems like it can be written even when return value signals
success, so we just unpoison it in all cases.
llvm-svn: 197383
2013-12-16 13:24:33 +00:00
Evgeniy Stepanov
3158ec4002
[msan] Fix strncat interceptor, add missing tests.
...
llvm-svn: 197244
2013-12-13 16:31:59 +00:00
Evgeniy Stepanov
879c552dd9
[msan] Wrap indirect calls from sanitizer rtl when running under DR.
...
llvm-svn: 197226
2013-12-13 13:13:46 +00:00
Evgeniy Stepanov
c8ccef49cc
[msan] Add a check for recursive __msan_init.
...
llvm-svn: 197218
2013-12-13 09:11:14 +00:00
Evgeniy Stepanov
86d8fb5ba1
[msan] Clean stack and TLS shadow on thread exit.
...
llvm-svn: 197156
2013-12-12 13:48:47 +00:00
Evgeniy Stepanov
cd07898cf8
[msan] Get stack limits with pthread_create interceptor.
...
Before we did it lazily on the first stack unwind in the thread.
It resulted in deadlock when the unwind was caused by memory allocation
inside pthread_getattr_np:
pthread_getattr_np <<< not reentable
GetThreadStackTopAndBottom
__interceptor_realloc
pthread_getattr_np
llvm-svn: 197026
2013-12-11 10:55:42 +00:00
Evgeniy Stepanov
67bbf967b0
[msan] Allow strlen() (and similar functions) of shadow memory.
...
llvm-svn: 196572
2013-12-06 09:19:07 +00:00
Alexey Samsonov
2d42b1d693
Run TSan/MSan lit tests only on 64-bit platforms
...
llvm-svn: 196501
2013-12-05 12:53:36 +00:00
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
Evgeniy Stepanov
c0378e72d1
[sanitizer] Intercept textdomain.
...
Patch by Alexander Taran.
llvm-svn: 196098
2013-12-02 13:43:26 +00:00
Evgeniy Stepanov
b56c5cd95e
[sanitizer] Intercept times.
...
llvm-svn: 195918
2013-11-28 14:41:22 +00:00
Evgeniy Stepanov
9c1f8323ae
[sanitizer] Intercept iconv.
...
llvm-svn: 195917
2013-11-28 14:14:48 +00:00
Evgeniy Stepanov
b76b687628
[sanitizer] Intercept __xpg_strerror_r.
...
llvm-svn: 195839
2013-11-27 12:29:10 +00:00
Dmitry Vyukov
7bd319cc08
tsan: fix flags parsing
...
- running_on_valgrind was not parsed in some contexts
- refactor code a bit
- add comprehensive tests for flags parsing
llvm-svn: 195831
2013-11-27 09:54:10 +00:00
Dmitry Vyukov
ee882ba4a1
tsan: support synchronization by means of linux aio
...
http://llvm-reviews.chandlerc.com/D2269
llvm-svn: 195830
2013-11-27 09:10:47 +00:00
Evgeniy Stepanov
1bdf5c93e1
[msan] Test for r195349.
...
llvm-svn: 195350
2013-11-21 12:01:07 +00:00
Evgeniy Stepanov
0958ecca7e
[msan] Tweak io_submit syscall hook.
...
llvm-svn: 195246
2013-11-20 13:04:23 +00:00
Evgeniy Stepanov
584fd96e9e
[msan] Unpoison memory that is returned to the OS and flush its shadow.
...
llvm-svn: 195244
2013-11-20 12:51:14 +00:00
Evgeniy Stepanov
bfb2016c83
[msan] Fix origin tracking in unaligned load/store.
...
llvm-svn: 195130
2013-11-19 14:47:56 +00:00
Evgeniy Stepanov
5912fa4c4b
[msan] A test for r194697.
...
llvm-svn: 194699
2013-11-14 12:31:18 +00:00
Alexey Samsonov
6345150992
[Sanitizer] Specify a default value for each common runtime flag
...
llvm-svn: 194479
2013-11-12 13:59:08 +00:00
Evgeniy Stepanov
5a29068b97
[msan] One more test for r194374.
...
llvm-svn: 194375
2013-11-11 13:38:24 +00:00
Evgeniy Stepanov
b69699eb58
[sanitizer] Warn if interception fails.
...
This includes a clang-format pass over common interceptors.
llvm-svn: 194372
2013-11-11 11:28:30 +00:00
Evgeniy Stepanov
bfdb9b2ec6
[msan] Sanity check for non-PIE.
...
llvm-svn: 194370
2013-11-11 09:27:20 +00:00
Alexey Samsonov
b3d939902a
[Sanitizer] Make StackTrace::Unwind the only public way to unwind a stack trace.
...
llvm-svn: 194196
2013-11-07 07:28:33 +00:00
Evgeniy Stepanov
1c8c3fe4b4
[msan] Fix a very unfortunate typo in origin copying.
...
It was causing randomly missing origins.
llvm-svn: 194036
2013-11-05 01:24:38 +00:00
Evgeniy Stepanov
a6b5eec757
[sanitizer] Intercept strptime.
...
llvm-svn: 193903
2013-11-02 01:01:35 +00:00
Evgeniy Stepanov
365bd0c88c
[msan] Intercept memccpy.
...
llvm-svn: 193897
2013-11-01 23:49:48 +00:00
Alexey Samsonov
5dc6cff06a
[Sanitizer] Unify summary reporting across all sanitizers.
...
This change unifies the summary printing across sanitizers:
now each tool uses specific version of ReportErrorSummary() method,
which deals with symbolization of the top frame and formatting a
summary message. This change modifies the summary line for ASan+LSan mode:
now the summary mentions "AddressSanitizer" instead of "LeakSanitizer".
llvm-svn: 193864
2013-11-01 17:02:14 +00:00
Evgeniy Stepanov
170d70be68
[msan] Check that address is an app region before printing shadow.
...
llvm-svn: 193863
2013-11-01 15:53:25 +00:00
Evgeniy Stepanov
2335879ff1
[sanitizer] Enhance io_submti syscall handler.
...
llvm-svn: 193848
2013-11-01 01:20:39 +00:00
Alexey Samsonov
4708c5912b
Consistently use StackTrace::PrintStack in ASan, LSan and MSan
...
llvm-svn: 193834
2013-11-01 00:19:46 +00:00
Alexey Samsonov
627e2c0dd7
[Sanitizer] Add Symbolizer::AddHooks() and use it in TSan and MSan.
...
Summary:
TSan and MSan need to know if interceptor was called by the
user code or by the symbolizer and use pre- and post-symbolization hooks
for that. Make Symbolizer class responsible for calling these hooks instead.
This would ensure the hooks are only called when necessary (during
in-process symbolization, they are not needed for out-of-process) and
save specific sanitizers from tracing all places in the code where symbolization
will be performed.
Reviewers: eugenis, dvyukov
Reviewed By: eugenis
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2067
llvm-svn: 193807
2013-10-31 21:44:07 +00:00
Evgeniy Stepanov
13322c6eda
[msan] Intercept dlerror.
...
llvm-svn: 193760
2013-10-31 16:58:44 +00:00
Evgeniy Stepanov
a7add488ae
[msan] Disable mlock/mlockall to work around a linux kernel bug.
...
The same logic is present in ASan and TSan.
llvm-svn: 193755
2013-10-31 15:51:22 +00:00
Evgeniy Stepanov
1cb37c4ee5
[sanitizer] Intercept getline, getdelim.
...
llvm-svn: 193730
2013-10-31 01:17:41 +00:00
Evgeniy Stepanov
0bd1f00ec6
[sanitizer] Intercept drand48_r, lrand48_r.
...
llvm-svn: 193655
2013-10-29 22:25:27 +00:00
Evgeniy Stepanov
bf60342d47
[sanitizer] Intercept sincos, remquo, lgamma, lgamma_r.
...
llvm-svn: 193645
2013-10-29 19:49:35 +00:00
Evgeniy Stepanov
477f8b73a5
[sanitizer] Ptrace syscall handler.
...
llvm-svn: 193633
2013-10-29 17:59:45 +00:00
Dmitry Vyukov
3e8432ee6c
tsan/asan: support pthread_setname_np to set thread names
...
llvm-svn: 193602
2013-10-29 10:30:39 +00:00
Alexey Samsonov
a687d2593f
[Sanitizer] Simplify StackTrace::PrintStack interface: prefer common flags to turn on/off the symbolization
...
llvm-svn: 193587
2013-10-29 05:31:25 +00:00
Evgeniy Stepanov
451c8de2d8
[msan] Intercept shmat.
...
llvm-svn: 193581
2013-10-29 02:48:49 +00:00
Evgeniy Stepanov
d828208713
[msan] Fix a typo and enable poison_in_free flag.
...
llvm-svn: 193529
2013-10-28 18:53:37 +00:00
Dmitry Vyukov
cf7259c094
asan/msan: separate different report blocks with new lines
...
this makes the reports consistent with tsan, and much more readable.
llvm-svn: 193520
2013-10-28 13:05:32 +00:00
Peter Collingbourne
791e65dcfb
Overhaul the symbolizer interface.
...
This moves away from creating the symbolizer object and initializing the
external symbolizer as separate steps. Those steps now always take place
together.
Sanitizers with a legacy requirement to specify their own symbolizer path
should use InitSymbolizer to initialize the symbolizer with the desired
path, and GetSymbolizer to access the symbolizer. Sanitizers with no
such requirement (e.g. UBSan) can use GetOrInitSymbolizer with no need for
initialization.
The symbolizer interface has been made thread-safe (as far as I can
tell) by protecting its member functions with mutexes.
Finally, the symbolizer interface no longer relies on weak externals, the
introduction of which was probably a mistake on my part.
Differential Revision: http://llvm-reviews.chandlerc.com/D1985
llvm-svn: 193448
2013-10-25 23:03:29 +00:00
Evgeniy Stepanov
94042e1ff2
[sanitizer] Intercept tmpnam, tmpnam_r, tempnam.
...
llvm-svn: 193415
2013-10-25 15:51:48 +00:00
Evgeniy Stepanov
2acb2470f9
[sanitizer] Remove pthread_attr_getstackaddr interceptor.
...
The function is deprecated.
llvm-svn: 193409
2013-10-25 14:27:00 +00:00
Evgeniy Stepanov
07507ffab4
[msan] Zerofill initstate_r buffer in random_r test.
...
llvm-svn: 193406
2013-10-25 13:03:20 +00:00
Evgeniy Stepanov
c2b6cb0747
[sanitizer] Intercept pthread_attr_get*.
...
llvm-svn: 193405
2013-10-25 13:01:31 +00:00
Evgeniy Stepanov
ced9fede02
[msan] Separate access and origin blocks in msan reports with an extra whiteline.
...
llvm-svn: 193401
2013-10-25 11:17:54 +00:00
Evgeniy Stepanov
be9cdbb58c
[sanitizer] Intercept random_r.
...
llvm-svn: 193396
2013-10-25 08:58:13 +00:00
Evgeniy Stepanov
f312b480e2
[sanitizer] Intercept shmctl.
...
llvm-svn: 193348
2013-10-24 14:47:34 +00:00
Evgeniy Stepanov
7edb87a92c
[msan] Unpoison errno in common interceptors.
...
llvm-svn: 193343
2013-10-24 13:20:34 +00:00
Evgeniy Stepanov
d280ee48e8
[msan] Fix invalid origin copying.
...
Origin copying may destroy valid origin info. This is caused by
__msan_copy_origin widening the address range to the nearest 4-byte aligned
addresses both on the left and on the right. If the target buffer is
uninitialized and the source is fully initialized, this will result in
overriding valid origin of target buffer with stale (possibly 0) origin of the
source buffer.
With this change the widened origin is copied only if corresponding shadow
values are non zero.
llvm-svn: 193338
2013-10-24 11:56:03 +00:00
Evgeniy Stepanov
f2fd459a5b
[msan] Change wording in the invalid origin message.
...
llvm-svn: 193335
2013-10-24 11:52:48 +00:00
Evgeniy Stepanov
3e6064f9d2
[sanitizer] Intercept ether_* functions.
...
llvm-svn: 193241
2013-10-23 13:57:47 +00:00
Evgeniy Stepanov
2794c47243
[msan] Drain allocator cache when leaving thread.
...
llvm-svn: 193163
2013-10-22 14:31:30 +00:00
Evgeniy Stepanov
0229c09d43
[sanitizer] Intercept initgroups.
...
llvm-svn: 193158
2013-10-22 12:24:48 +00:00
Evgeniy Stepanov
3cb9df042e
[sanitizer] Move statfs/fstatfs to common interceptors and add statvfs/fstatvfs.
...
llvm-svn: 192965
2013-10-18 11:14:16 +00:00
Evgeniy Stepanov
70d5abfba2
[sanitizer] Intercept getmntent, getmntent_r.
...
llvm-svn: 192959
2013-10-18 09:41:43 +00:00
Evgeniy Stepanov
4bbf273173
[sanitizer] Fix unpoisoning of msghdr::msg_name in recvmsg interceptor.
...
llvm-svn: 192886
2013-10-17 11:32:30 +00:00
Alexey Samsonov
bc7c87a8cb
[Sanitizer] Move pthread_cond_signal and pthread_cond_broadcast to common interceptors
...
llvm-svn: 192876
2013-10-17 09:24:03 +00:00
Evgeniy Stepanov
8df08225e5
[msan] Handle origins in __sanitizer_unaligned_(load|store)*.
...
llvm-svn: 192776
2013-10-16 08:25:13 +00:00
Alexey Samsonov
edecc38395
Make some pthread_mutex_* and pthread_cond_* interceptors common.
...
Reviewers: eugenis, dvyukov
Reviewed By: dvyukov
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1937
llvm-svn: 192774
2013-10-16 08:20:31 +00:00
Dmitry Vyukov
7502a3a90c
tsan: use verbosity flag in sanitizer_common code directly
...
now it's available from common_flags()
llvm-svn: 192705
2013-10-15 14:12:26 +00:00
Dmitry Vyukov
52ca74ec61
tsan: move verbosity flag to CommonFlags
...
llvm-svn: 192701
2013-10-15 13:28:51 +00:00
Evgeniy Stepanov
7a2bbc30a2
[msan] Remove CallocOverflow test.
...
This behaviour depends on MSAN_OPTIONS.
All interesting combinations are covered by lit_tests/allocator_returns_null.cc.
llvm-svn: 192691
2013-10-15 12:20:16 +00:00
Evgeniy Stepanov
113c646c56
[msan] Implement allocator_may_return_null=1 in MemorySanitizer.
...
llvm-svn: 192687
2013-10-15 11:33:48 +00:00
Evgeniy Stepanov
251d1e5d21
[msan] Test for r192599.
...
llvm-svn: 192600
2013-10-14 15:17:05 +00:00
Evgeniy Stepanov
7d7768e032
[msan] Remove a long-outdated comment.
...
llvm-svn: 192592
2013-10-14 13:30:40 +00:00
Evgeniy Stepanov
7aacd9c172
[msan] Intercept strto(d|f|ld)_l and glibc-specific __strto(d|f|ld)_l.
...
llvm-svn: 192583
2013-10-14 11:52:40 +00:00
Evgeniy Stepanov
054d533d8d
[msan] Regression test for r192575.
...
llvm-svn: 192577
2013-10-14 09:53:39 +00:00
Alexey Samsonov
9d8385453b
[Sanitizer] Simplify StackTrace::FastUnwindStack interface and fix a bug with one-frame stack traces
...
llvm-svn: 192428
2013-10-11 09:58:30 +00:00
Alexey Samsonov
f2b811a618
Refactor the usage of strip_path_prefix option and make it more consistent across sanitizers
...
llvm-svn: 191943
2013-10-04 08:55:03 +00:00
Dmitry Vyukov
19a1302046
asan/msan: fix "unused function 'OnExit'" warning
...
llvm-svn: 191904
2013-10-03 15:43:59 +00:00
Dmitry Vyukov
fdfb2ade8f
asan/msan/tsan: move _exit interceptor to common interceptors
...
llvm-svn: 191903
2013-10-03 15:22:29 +00:00
Dmitry Vyukov
83ebd022d7
tsan: fix false positive in localtime()
...
llvm-svn: 191899
2013-10-03 14:12:09 +00:00
Evgeniy Stepanov
c907a60ffb
[sanitizer] Fix localtime and gmtime interceptors to clean tm->tm_zone.
...
llvm-svn: 191827
2013-10-02 14:30:03 +00:00
Dmitry Vyukov
af335eddfe
msan: fix compiler warnings about unused variables
...
llvm-svn: 191821
2013-10-02 14:02:08 +00:00
Evgeniy Stepanov
01781722b6
[sanitizer] Intercept backtrace, backtrace_symbols.
...
llvm-svn: 191516
2013-09-27 12:40:23 +00:00
Evgeniy Stepanov
022235cf04
[msan] Unpoison argument shadow for C++ module destructors.
...
Fixes PR17377.
llvm-svn: 191508
2013-09-27 11:32:21 +00:00
Evgeniy Stepanov
8f27f6b549
[sanitizer] A bunch of libc interceptors.
...
sigwait
sigwaitinfo
sigtimedwait
sigemptyset
sigfillset
sigpending
sigprocmask
llvm-svn: 191374
2013-09-25 14:47:43 +00:00
Evgeniy Stepanov
2761ee0409
[sanitizer] Intercept wordexp.
...
llvm-svn: 191305
2013-09-24 14:38:22 +00:00
Evgeniy Stepanov
46901f613b
[msan] Test for atomic handling in MSan.
...
llvm-svn: 191288
2013-09-24 11:21:16 +00:00
Evgeniy Stepanov
ce72b2c20b
[msan] Fix a WTF in r191196.
...
llvm-svn: 191197
2013-09-23 13:34:26 +00:00
Evgeniy Stepanov
f497bfee76
[msan] Allow nested symbolizer and loader scopes.
...
llvm-svn: 191196
2013-09-23 13:26:31 +00:00
Alexey Samsonov
786ee9b1ad
[MSan] Fix -Wempty-body warning
...
llvm-svn: 190994
2013-09-19 08:35:16 +00:00
Evgeniy Stepanov
08d649c024
[msan] Check return value of main: compiler-rt tests.
...
llvm-svn: 190783
2013-09-16 13:25:26 +00:00
Evgeniy Stepanov
65562f5281
[msan] Fix origin of deallocated memory.
...
MSan poisons deallocated memory but it used to give it an invalid origin value,
resulting in confusing reports. This change associates deallocation stack trace
with such memory.
Note that MSan does not have quarantine, and use-after-free detection is very
limited.
llvm-svn: 190781
2013-09-16 11:03:31 +00:00
Evgeniy Stepanov
0da35401ce
[msan] Add source file:line to stack origin reports.
...
Test.
llvm-svn: 190690
2013-09-13 12:55:07 +00:00
Evgeniy Stepanov
ac5ac34cf7
[msan] Add source file:line to stack origin reports.
...
Runtime library part.
llvm-svn: 190686
2013-09-13 12:49:13 +00:00
Evgeniy Stepanov
9be91e970e
[msan] Intercept tzset.
...
llvm-svn: 190682
2013-09-13 11:27:38 +00:00
Alexey Samsonov
7a36e6126b
[Sanitizer] Refactor symbolization interface: use class instead of several functions. Move some code around to get rid of extra source files
...
llvm-svn: 190410
2013-09-10 14:36:16 +00:00
Evgeniy Stepanov
df96e863de
[msan] bool -> int to make msan_interface.h C-compatible.
...
llvm-svn: 190402
2013-09-10 11:04:37 +00:00
Evgeniy Stepanov
842fa3f80d
[msan] Intercept fstatat / fstatat64.
...
llvm-svn: 190306
2013-09-09 13:40:41 +00:00
Evgeniy Stepanov
5c1035e7fa
[sanitizer] A bunch of linux system call handlers.
...
llvm-svn: 190157
2013-09-06 14:20:01 +00:00
Kostya Serebryany
6c5b034d7b
[msan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)
...
llvm-svn: 190132
2013-09-06 10:58:55 +00:00
Sergey Matveev
b9d34443f2
[lsan] Colorize LSan reports.
...
llvm-svn: 189804
2013-09-03 13:31:03 +00:00
Alexey Samsonov
5b5c99d219
ASan, LSan, MSan: try to find llvm-symbolizer binary in PATH if it is not provided. Now we don't need to explicitly set the location of llvm-symbolizer in lit test configs.
...
llvm-svn: 189801
2013-09-03 13:22:51 +00:00
Evgeniy Stepanov
499d480be5
[msan] Another regression test for r189786.
...
llvm-svn: 189787
2013-09-03 10:08:14 +00:00
Evgeniy Stepanov
f9ddb43975
[msan] A regression test for r189785.
...
llvm-svn: 189786
2013-09-03 10:05:45 +00:00
Evgeniy Stepanov
e3eaa7bb35
[msan] Intercept memalign, valloc, pvalloc.
...
PR17039
llvm-svn: 189750
2013-09-02 09:24:53 +00:00
Alexey Samsonov
ef643ce471
[sanitizer] fix code style
...
llvm-svn: 189474
2013-08-28 11:26:09 +00:00
Evgeniy Stepanov
4f961de94e
[msan] Remove extra backup/restore calls.
...
llvm-svn: 189461
2013-08-28 09:17:47 +00:00
Alexey Samsonov
0803953cea
Generate list of symbols exported from sanitizer runtimes only on 64-bit Unix
...
llvm-svn: 189454
2013-08-28 08:07:04 +00:00
Alexey Samsonov
acab30e927
Properly generate lists of exported symbols for sanitizer runtimes
...
This change adds a Python script that is invoked for
the just-built sanitizer runtime to generate the list of exported symbols
passed to the linker. By default, it contains interceptors and sanitizer
interface functions, but can be extended with tool-specific lists.
llvm-svn: 189356
2013-08-27 15:08:02 +00:00
Evgeniy Stepanov
cb22c67a21
[msan] Save/restore va_arg_overflow_tls in signal handlers.
...
llvm-svn: 189351
2013-08-27 14:08:15 +00:00
Evgeniy Stepanov
c41798152f
[msan] Unpoison all TLS shadow when leaving a signal handler.
...
llvm-svn: 189343
2013-08-27 12:59:39 +00:00
Evgeniy Stepanov
bb25af5f7b
[msan] Fix a data race in signal/sigaction interceptors.
...
llvm-svn: 189342
2013-08-27 11:34:05 +00:00
Evgeniy Stepanov
82185980c4
[msan] A test for ppoll() interceptor.
...
llvm-svn: 189339
2013-08-27 11:10:20 +00:00
Evgeniy Stepanov
a40a058ff1
[sanitizer] Simplify sigaction and sigset_t handling.
...
llvm-svn: 189338
2013-08-27 11:10:04 +00:00
Evgeniy Stepanov
0d13c707d5
[msan] Extend VAArgTLSOverwrite test.
...
This test now covers LLVM r189104.
llvm-svn: 189105
2013-08-23 12:13:18 +00:00
Dmitry Vyukov
97f0eae0a5
tsan/msan: add halt_on_error flag
...
If halt_on_error==true, program terminates after reporting first error.
llvm-svn: 188279
2013-08-13 15:33:00 +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
Evgeniy Stepanov
64cace0687
[sanitizer] Intercept poll/ppoll.
...
llvm-svn: 188177
2013-08-12 13:19:53 +00:00
Evgeniy Stepanov
98c39a184e
[sanitizer] Intercept getgroups.
...
llvm-svn: 188167
2013-08-12 11:01:40 +00:00
Daniel Dunbar
bc5dbc435e
[tests] Update to use lit_config and lit package, as appropriate.
...
llvm-svn: 188116
2013-08-09 22:14:01 +00:00
Evgeniy Stepanov
564215d949
[sanitizer] Intercept scandir/scandir64.
...
llvm-svn: 187982
2013-08-08 13:57:15 +00:00
Evgeniy Stepanov
233455cba8
[sanitizer] Intercept strerror and strerror_r.
...
llvm-svn: 187978
2013-08-08 11:44:05 +00:00
Evgeniy Stepanov
7ea4795ed3
[sanitizer] ASan/MSan tests for r187967.
...
r187967: Disable inlining between sanitized and non-sanitized functions.
llvm-svn: 187971
2013-08-08 09:23:19 +00:00
Evgeniy Stepanov
04b7bff1fe
[sanitizer] Intercept sched_getaffinity.
...
Re-applying with a more reliable test case.
llvm-svn: 187876
2013-08-07 09:10:16 +00:00
David Blaikie
787e2b6499
Revert "[sanitizer] Intercept sched_getaffinity."
...
This reverts commit r187788.
The test case is unreliable (as the test may be run in a situation in
which it has no affinity with cpu0). This can be recommitted with a more
reliable test - possibly using CPU_COUNT != 0 instead (I wasn't entirely
sure that a process was guaranteed to have at least one affinity, though
it seems reasonable, or I'd have made the change myself).
llvm-svn: 187841
2013-08-07 00:37:26 +00:00
Evgeniy Stepanov
03c0281a17
[sanitizer] Fix NULL arg handling in setitimer/getitimer interceptors.
...
llvm-svn: 187789
2013-08-06 09:54:33 +00:00
Evgeniy Stepanov
9f05e5e533
[sanitizer] Intercept sched_getaffinity.
...
llvm-svn: 187788
2013-08-06 09:29:01 +00:00
Evgeniy Stepanov
44b77c26e4
[msan] Allocator statistics interface and malloc hooks.
...
llvm-svn: 187653
2013-08-02 14:26:58 +00:00
Evgeniy Stepanov
90daaf9132
[msan] Fix unused function warning in the tests.
...
llvm-svn: 187648
2013-08-02 09:09:02 +00:00
Evgeniy Stepanov
5dbedf6c2a
[msan] Intercept setenv, putenv.
...
llvm-svn: 187575
2013-08-01 11:14:14 +00:00
Evgeniy Stepanov
1ea380f693
[msan] Fix msan tests with pipefail option.
...
llvm-svn: 187485
2013-07-31 09:14:55 +00:00
Evgeniy Stepanov
9fbd981f99
[sanitizer] read() syscall hook.
...
llvm-svn: 187414
2013-07-30 13:04:43 +00:00
Evgeniy Stepanov
807e131261
[msan] Intercept pthread_join.
...
llvm-svn: 187413
2013-07-30 12:54:34 +00:00
Evgeniy Stepanov
da9fd25603
[msan] Intercept confstr.
...
llvm-svn: 187412
2013-07-30 12:46:59 +00:00
Peter Collingbourne
9058c07c95
Move UnpoisonMappedDSO to sanitizer_common.
...
This is so DFSan will be able to use it.
Differential Revision: http://llvm-reviews.chandlerc.com/D1206
llvm-svn: 187372
2013-07-29 19:09:49 +00:00
Chandler Carruth
d45abe12a6
Turn off pipefail on msan tests to match the other sanitizers until
...
someone can go through and update the RUN lines appropriately for the
new pipefail behavior.
llvm-svn: 187298
2013-07-27 10:30:39 +00:00
Hans Wennborg
2e304b6ffd
Use --driver-mode=g++ instead of -ccc-cxx; required after Clang r186605
...
llvm-svn: 186607
2013-07-18 20:48:50 +00:00
Alexey Samsonov
9916aa2d95
[Sanitizer] move strcpy and strncpy to common interceptors
...
llvm-svn: 186408
2013-07-16 12:51:53 +00:00
Timur Iskhodzhanov
d7eb67774e
Fix check_lint warnings in sanitizers' runtime libraries
...
llvm-svn: 186328
2013-07-15 16:11:39 +00:00
Alexey Samsonov
fde429ba69
[Sanitizer] Revert some parts of r186109 related to mbstowcs-and-friends interceptors
...
llvm-svn: 186155
2013-07-12 11:59:58 +00:00
Evgeniy Stepanov
9240838655
[sanitizer] More checks in mbstowcs-like interceptors.
...
llvm-svn: 186004
2013-07-10 14:17:46 +00:00
Evgeniy Stepanov
123fdb3413
[sanitizer] Fix handling of edge cases in mbstowcs-like interceptors.
...
llvm-svn: 186002
2013-07-10 14:01:51 +00:00
Evgeniy Stepanov
7160fb6511
[sanitizer] Update glob64 interceptor to handle GLOB_ALTDIRFUNC as well.
...
llvm-svn: 185935
2013-07-09 12:34:25 +00:00
Evgeniy Stepanov
faba61a7bc
[sanitizer] Support GLOB_ALTDIRFUNC in glob interceptor.
...
llvm-svn: 185932
2013-07-09 12:07:59 +00:00
Evgeniy Stepanov
77ef78a0a5
[sanitizer] Intercept realpath and canonicalize_file_name.
...
Handle realpath(path, NULL) form.
llvm-svn: 185921
2013-07-09 09:53:37 +00:00
Evgeniy Stepanov
f7f252d025
[sanitizer] Syscall handlers for clock_gettime and clock_getres.
...
llvm-svn: 185913
2013-07-09 08:54:59 +00:00
Evgeniy Stepanov
628d727749
[msan] Intercept pthread_key_create.
...
llvm-svn: 185693
2013-07-05 12:31:07 +00:00
Evgeniy Stepanov
717e0cd2a7
[sanitizer] Intercept tcgetattr.
...
llvm-svn: 185626
2013-07-04 14:03:31 +00:00
Evgeniy Stepanov
db615c186f
[sanitizer] More interceptors.
...
bcopy
strtoimax, strtoumax
mbstowcs, mbsrtowcs, mbsnrtowcs
wcstombs, wcsrtombs, wcsnrtombs
llvm-svn: 185624
2013-07-04 13:19:41 +00:00
Evgeniy Stepanov
aa23bd83e5
[msan] Intercept mempcpy, wmempcpy.
...
llvm-svn: 185431
2013-07-02 14:49:24 +00:00
Evgeniy Stepanov
69a387e6ae
[sanitizer] Fix GLOB_NOMATCH behaviour and refactor the interceptor a bit.
...
llvm-svn: 185428
2013-07-02 14:08:52 +00:00
Evgeniy Stepanov
165d759a6a
[sanitizer] Intercept mbtowc, mbrtowc, get_current_dir_name.
...
Move getcwd to common interceptors.
llvm-svn: 185424
2013-07-02 13:34:44 +00:00
Evgeniy Stepanov
1df4dfe87a
[sanitizer] Intercept setlocale.
...
llvm-svn: 185416
2013-07-02 09:23:45 +00:00
Evgeniy Stepanov
654688bed5
[msan] Intercept stpcpy.
...
llvm-svn: 185340
2013-07-01 15:19:37 +00:00
Evgeniy Stepanov
8a4e24ea8b
[sanitizer] Intercept getnameinfo.
...
llvm-svn: 185338
2013-07-01 13:51:31 +00:00
Alexey Samsonov
e71f37c1cd
Define the path to llvm-symbolizer tool in a common config to reduce copy-paste
...
llvm-svn: 185286
2013-06-30 14:47:38 +00:00
Evgeniy Stepanov
dec0f76c14
[sanitizer] Intercept ptrace.
...
llvm-svn: 185142
2013-06-28 11:02:43 +00:00
Evgeniy Stepanov
f5cae53057
[msan] Optionally disable 2 tests (dlopen & gethostbyname).
...
llvm-svn: 185076
2013-06-27 13:21:00 +00:00
Alexey Samsonov
ed4594b76a
[MSan] Rename __msan_unpoision_param to __msan::UnpoisonParam - it shouldn't be in interface
...
llvm-svn: 185062
2013-06-27 07:50:56 +00:00
Evgeniy Stepanov
06d6c25141
[sanitizer] readdir and readdir_r interceptors.
...
llvm-svn: 184950
2013-06-26 15:00:53 +00:00
Evgeniy Stepanov
982d56abb8
[sanitizer] Move log_path to common flag and use it in MSan.
...
llvm-svn: 184836
2013-06-25 13:50:44 +00:00
Evgeniy Stepanov
60d964d4f2
[sanitizer] Intercept sysinfo.
...
llvm-svn: 184739
2013-06-24 14:25:33 +00:00
Evgeniy Stepanov
02a7460d12
[sanitizer] Intercept inet_aton.
...
llvm-svn: 184735
2013-06-24 13:56:14 +00:00
Evgeniy Stepanov
830550ce4c
[msan] Unpoison param-tls in signal handler wrapper.
...
This an entry point from uninstrumented code.
llvm-svn: 184734
2013-06-24 13:48:42 +00:00
Evgeniy Stepanov
0e8053af08
[sanitizer] Intercept readv, preadv, writev, pwritev.
...
llvm-svn: 184717
2013-06-24 10:43:23 +00:00
Evgeniy Stepanov
b58b72e151
[msan] Intercept (v)asprintf.
...
llvm-svn: 184545
2013-06-21 13:32:26 +00:00
Evgeniy Stepanov
ae4e1ec4e6
[msan] Add keep_going runtime flag.
...
llvm-svn: 184542
2013-06-21 12:37:58 +00:00
Alexey Samsonov
dd489a4e15
[MSan] don't add msan unit tests to check-msan command if libcxx is not checked out
...
llvm-svn: 183641
2013-06-10 09:09:40 +00:00
Evgeniy Stepanov
cead69d4a3
[sanitizer] Handle SIOCGIFCONF ioctl.
...
llvm-svn: 183529
2013-06-07 15:49:38 +00:00
Evgeniy Stepanov
0b1f41b6f4
[sanitizer] ioctl interceptor.
...
ASan: disabled by default
MSan: enabled by default
TSan: disabled
llvm-svn: 183517
2013-06-07 13:00:47 +00:00
Alexey Samsonov
f6630ecee9
Simplify lit configs for asan/lsan/msan unit tests
...
llvm-svn: 183410
2013-06-06 13:48:20 +00:00
Alexey Samsonov
e3bf521b7c
Remove a bunch of copy-paste: use common config for sanitizer lit/unit tests
...
llvm-svn: 183407
2013-06-06 13:28:37 +00:00
Evgeniy Stepanov
56050e8f69
[sanitizer] Fix __sanitizer_unaligned_* to work with unaligned data types.
...
llvm-svn: 183224
2013-06-04 13:49:10 +00:00
Evgeniy Stepanov
53c8c13bf1
[msan] Implement __sanitizer_unaligned_*.
...
llvm-svn: 183221
2013-06-04 13:08:36 +00:00
Evgeniy Stepanov
4717d2d494
[msan] Fix gcc build of msan runtime.
...
llvm-svn: 182999
2013-05-31 13:04:07 +00:00
Evgeniy Stepanov
96284becf4
[msan] Handle mixed track-origins and keep-going settings (compiler-rt part).
...
Before this change, each module defined a weak_odr global __msan_track_origins
with a value of 1 if origin tracking is enabled, 0 if disabled. If there are
modules with different values, any of them may win. If 0 wins, and there is at
least one module with 1, the program will most likely crash.
With this change, __msan_track_origins is only emitted if origin tracking is
on. Then runtime library detects if there is at least one module with origin
tracking, and enables runtime support for it.
llvm-svn: 182996
2013-05-31 12:04:08 +00:00
Evgeniy Stepanov
677003140c
[sanitizer] Fix getaddrinfo interceptor to use the actual returned sockaddr size.
...
llvm-svn: 182852
2013-05-29 12:33:31 +00:00
Evgeniy Stepanov
fc708db4c1
[sanitizer] Intercept getpeername.
...
llvm-svn: 182844
2013-05-29 11:49:25 +00:00
Evgeniy Stepanov
a4d08c4e87
[sanitizer] Move TSan and MSan recvmsg interceptors to common.
...
llvm-svn: 182843
2013-05-29 11:30:00 +00:00
Evgeniy Stepanov
f28217ad0e
[sanitizer] modf/modff/modfl interceptors.
...
llvm-svn: 182838
2013-05-29 10:03:11 +00:00
Alexey Samsonov
c30e2d6b3a
Make InternalAlloc/InternalFree in sanitizer runtimes libc-free by switching to a custom allocator.
...
llvm-svn: 182836
2013-05-29 09:15:39 +00:00
Evgeniy Stepanov
08f662845d
[sanitizer] Share TSan accept & accept4 interceptors with other sanitizers.
...
llvm-svn: 182835
2013-05-29 09:09:58 +00:00
Evgeniy Stepanov
40d7ed5d1e
[sanitizer] Improve getaddrinfo interceptor.
...
llvm-svn: 182775
2013-05-28 14:34:37 +00:00
Evgeniy Stepanov
dd0780f81c
[msan] Change report header to be more alike to ASan and TSan.
...
llvm-svn: 182774
2013-05-28 14:27:30 +00:00
Alexey Samsonov
9c2bcf8c15
Improve support for compiler-rt tests in CMake build.
...
Now compiler-rt tests run correctly if compiler-rt is checked out into
arbitrary directory (not necessarily projects/compiler-rt).
Patch by Greg Fitzgerald!
llvm-svn: 182726
2013-05-27 09:35:24 +00:00
Evgeniy Stepanov
a343d1d881
[msan] Fix line >80 chars.
...
llvm-svn: 182578
2013-05-23 11:51:47 +00:00
Evgeniy Stepanov
b978627cb8
[sanitizer] Intercept getsockopt.
...
llvm-svn: 182574
2013-05-23 11:38:08 +00:00
Evgeniy Stepanov
ab25369d04
[sanitizer] Interceptors for gethostbyname and friends.
...
llvm-svn: 182573
2013-05-23 11:10:23 +00:00
Evgeniy Stepanov
97aea34b54
[msan] Intercept getsockname.
...
llvm-svn: 182475
2013-05-22 13:46:22 +00:00
Evgeniy Stepanov
bfd2122b20
[msan] getaddrinfo & nested interceptor support.
...
Multiple connected changes:
- Ignore reads from nested interceptors.
- Check shadow on reads from common interceptors.
- getaddrinfo interceptor.
llvm-svn: 182466
2013-05-22 12:50:26 +00:00
Alexey Samsonov
b99085b0b8
[MSan] Add empty default blacklist for MSan
...
llvm-svn: 182382
2013-05-21 13:55:56 +00:00
Evgeniy Stepanov
1d2f22825d
[msan] Replace GetArgv hack with something that is slightly better.
...
llvm-svn: 182359
2013-05-21 08:56:22 +00:00
Evgeniy Stepanov
970be35808
[sanitizer] Intercept pthread_getschedparam.
...
llvm-svn: 182353
2013-05-21 08:12:08 +00:00
Peter Collingbourne
6d4a7d3723
[nolibc] Begin moving sanitizer_common's libc-dependent code to a separate library
...
Introduce a new object library, RTSanitizerCommonLibc, which will contain
the subset of sanitizer_common with libc dependencies. RTSanitizerCommon
contains the remainder of sanitizer_common, and is intended to have no
libc dependencies. Begin moving code to RTSanitizerCommonLibc, starting
with sanitizer_common.cc, whose libc-dependent portion is moved to
sanitizer_common_libcdep.cc, the first member of the new library.
This split affects the CMake build only. The makefile build continues
to produce the full sanitizer_common library.
llvm-svn: 182118
2013-05-17 16:17:19 +00:00
Evgeniy Stepanov
ff6728f2f8
[msan] Unpoison dlpi_name in dl_iterate_phdr interceptor.
...
llvm-svn: 182093
2013-05-17 12:51:13 +00:00
Evgeniy Stepanov
87c6ec7cfe
[msan] Intercept dl_iterate_phdr.
...
llvm-svn: 182004
2013-05-16 13:00:25 +00:00
Evgeniy Stepanov
f1efb256f6
Add sanitizer syscall hooks to the tool's export lists.
...
llvm-svn: 181790
2013-05-14 13:55:21 +00:00
Sergey Matveev
6eff11e714
[msan] Common flags in MSan.
...
llvm-svn: 181194
2013-05-06 13:15:14 +00:00
Evgeniy Stepanov
44b75efab4
[sanitizer] Intercept inet_pton and inet_ntop.
...
llvm-svn: 180107
2013-04-23 14:05:15 +00:00
Alexey Samsonov
34093f0de8
[MSan] Make a few interface functions accept 'const void *' instead of 'void*'
...
llvm-svn: 180102
2013-04-23 13:34:19 +00:00
Evgeniy Stepanov
455abf4872
[msan] Unpoison the result of posix_memalign.
...
llvm-svn: 180101
2013-04-23 13:27:36 +00:00
Evgeniy Stepanov
3076ba0a08
[sanitizer] Intercept getgrnam{_r}, getgrgid{_r}.
...
llvm-svn: 180091
2013-04-23 12:01:20 +00:00
Evgeniy Stepanov
0cd7cf8217
[msan] Allow clock_getres(, 0).
...
llvm-svn: 180090
2013-04-23 11:48:31 +00:00
Evgeniy Stepanov
d1dae90bf2
[msan] Fix gcc build of msan_test.
...
llvm-svn: 179594
2013-04-16 14:09:47 +00:00
Evgeniy Stepanov
b0d786798c
[msan] Fix sigaction test.
...
Restore SIGPROF handler to the original state after the test.
llvm-svn: 179524
2013-04-15 13:35:05 +00:00
Evgeniy Stepanov
7332acac4c
[msan] Really disable replacement new and delete.
...
llvm-svn: 179522
2013-04-15 12:41:52 +00:00
Alexey Samsonov
e48866969e
[MSan] Demangle function name in description of stack origin
...
llvm-svn: 179368
2013-04-12 07:27:30 +00:00
Alexey Samsonov
1a345ad502
[MSan] don't build tests with -fPIE/-pie, as these flags are implied by -fsanitize=memory now
...
llvm-svn: 179366
2013-04-12 07:14:04 +00:00
Alexey Samsonov
9f3938e271
Explicitly list all sanitizer headers in CMake build rules. Make sure sanitizer lit_tests depend on fresh headers.
...
llvm-svn: 179293
2013-04-11 15:49:52 +00:00
Evgeniy Stepanov
f5523116e9
[sanitizer] Syscall hooks.
...
Pre- and post- hooks for linux syscalls. Not wired into anything, but exposed
through public interface.
llvm-svn: 179288
2013-04-11 14:37:04 +00:00
Evgeniy Stepanov
460067823b
[sanitizer] Interceptors for wait*.
...
llvm-svn: 179096
2013-04-09 14:34:59 +00:00
Evgeniy Stepanov
69967c2835
[msan] Intercept glob() with tests.
...
llvm-svn: 179091
2013-04-09 11:35:13 +00:00
Evgeniy Stepanov
b4eac2f810
[msan] Interceptors for pipe2 and socketpair.
...
llvm-svn: 179022
2013-04-08 13:45:12 +00:00
Evgeniy Stepanov
7ba7207f1d
[msan] Intercept time().
...
llvm-svn: 179002
2013-04-08 08:25:22 +00:00