summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/msan/msan.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* [sanitizer] Switch flag parsing to LowLevelAlloc.Evgeniy Stepanov2015-01-191-2/+2
| | | | | | | | | InternalAlloc is quite complex and its behavior may depend on the values of flags. As such, it should not be used while parsing flags. Sadly, LowLevelAlloc does not support deallocation of memory. llvm-svn: 226453
* [sanitizer] Flag parser rewrite.Evgeniy Stepanov2015-01-151-16/+34
| | | | | | | The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. llvm-svn: 226169
* [Sanitizer] Change the runtime flag representation.Alexey Samsonov2015-01-071-58/+42
| | | | | | | | | | | This mirrors r225239 to all the rest sanitizers: ASan, DFSan, LSan, MSan, TSan, UBSan. Now the runtime flag type, name, default value and description is located in the single place in the .inc file. llvm-svn: 225327
* Revert "Revert r224736: "[Sanitizer] Make CommonFlags immutable after ↵Alexey Samsonov2015-01-021-7/+11
| | | | | | | | | | | | | | | | initialization."" Fix test failures by introducing CommonFlags::CopyFrom() to make sure compiler doesn't insert memcpy() calls into runtime code. Original commit message: Protect CommonFlags singleton by adding const qualifier to common_flags() accessor. The only ways to modify the flags are SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and OverrideCommonFlags() functions, which are only supposed to be called during initialization. llvm-svn: 225088
* Revert r224736: "[Sanitizer] Make CommonFlags immutable after initialization."Chandler Carruth2015-01-021-10/+7
| | | | | | | | | | We've got some internal users that either aren't compatible with this or have found a bug with it. Either way, this is an isolated cleanup and so I'm reverting it to un-block folks while we investigate. Alexey and I will be working on fixing everything up so this can be re-committed soon. Sorry for the noise and any inconvenience. llvm-svn: 225079
* [asan] Allow enabling coverage at activation.Evgeniy Stepanov2014-12-261-4/+1
| | | | | | | | This is a re-commit of r224838 + r224839, previously reverted in r224850. Test failures were likely (still can not reproduce) caused by two lit tests using the same name for an intermediate build target. llvm-svn: 224853
* Revert r224838, r224839.Evgeniy Stepanov2014-12-261-1/+4
| | | | | | Flaky failures on the build bots. llvm-svn: 224850
* [asan] Allow enabling coverage at activation.Evgeniy Stepanov2014-12-251-4/+1
| | | | llvm-svn: 224838
* [Sanitizer] Make CommonFlags immutable after initialization.Alexey Samsonov2014-12-221-7/+10
| | | | | | | | | | | | | | | | | | | Summary: Protect CommonFlags singleton by adding const qualifier to common_flags() accessor. The only ways to modify the flags are SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and OverrideCommonFlags() functions, which are only supposed to be called during initialization. Test Plan: regression test suite Reviewers: kcc, eugenis, glider Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6741 llvm-svn: 224736
* [Sanitizer] Refactor CommonFlags interface. NFC.Alexey Samsonov2014-12-191-4/+6
| | | | | | | | | | Add CommonFlags::SetDefaults() and CommonFlags::ParseFromString(), so that this object can be easily tested. Enforce that ParseCommonFlagsFromString() and SetCommonFlagsDefaults() work only with singleton CommonFlags, shared across all sanitizer runtimes. llvm-svn: 224617
* [msan] allow -fsanitize-coverage=N together with -fsanitize=memory, ↵Kostya Serebryany2014-12-031-0/+5
| | | | | | compiler-rt part llvm-svn: 223314
* [msan] Change the way origin ids are built.Evgeniy Stepanov2014-12-031-30/+7
| | | | | | | | | | | | | | | | | | Previously, all origin ids were "chained" origins, i.e values of ChainedOriginDepot. This added a level of indirection for simple stack and heap allocation, which were represented as chains of length 1. This costs both RAM and CPU, but provides a joined 2**29 origin id space. It also made function (any instrumented function) entry non-async-signal-safe, but that does not really matter because memory stores in track-origins=2 mode are not async-signal-safe anyway. With this change, the type of the origin is encoded in origin id. See comment in msan_origin.h for more details. This reduces chained and stack origin id range to 2**28 each, but leaves extra 2**31 for heap origins. This change should not have any user-visible effects. llvm-svn: 223233
* [Msan] Generalize mapping facilities to add FreeBSD supportViktor Kutuzov2014-11-281-2/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D6387 llvm-svn: 222919
* [msan] Remove MSanDR and supporting code.Evgeniy Stepanov2014-11-181-52/+2
| | | | | | | | | | 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
* Fix -Wcast-qual warnings in sanitizersAlexey Samsonov2014-11-131-3/+3
| | | | llvm-svn: 221936
* Change StackDepot interface to use StackTrace more extensivelyAlexey Samsonov2014-10-261-1/+1
| | | | llvm-svn: 220637
* [Sanitizer] Make StackTrace a lightweight reference to array of PCs, andAlexey Samsonov2014-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* [msan] Handle param-tls overflow.Evgeniy Stepanov2014-10-221-4/+4
| | | | | | | | 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
* [msan] Fix origin_history_per_stack_limit=0 behavior.Evgeniy Stepanov2014-09-031-4/+7
| | | | | | It disables the per-stack limit. llvm-svn: 217030
* [MSan] Disable coredump for 64-bit binaries.Alexey Samsonov2014-08-121-0/+1
| | | | llvm-svn: 215482
* [Sanitizer] Simplify Symbolizer creation interface.Alexey Samsonov2014-07-261-2/+1
| | | | | | | | | | | 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
* [msan] Limit stack origin chain length.Evgeniy Stepanov2014-06-301-1/+1
| | | | | | Stack origins were created with unlimited length by mistake. llvm-svn: 212036
* [msan] Add store_context_size= flag.Evgeniy Stepanov2014-06-271-0/+3
| | | | | | | A new flag to control stack trace size for store event (in track-origins=2 mode) independently of malloc_context_size. llvm-svn: 211896
* [msan] Fix bad interaction between with-calls mode and chained origin tracking.Evgeniy Stepanov2014-06-251-1/+9
| | | | | | | | | | 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
* [msan] Fix false positive on dynamic tls.Evgeniy Stepanov2014-06-251-0/+1
| | | | | | | | | 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
* [msan] Print stats even on successful run with atexit=1.Evgeniy Stepanov2014-06-241-0/+2
| | | | llvm-svn: 211574
* [msan] Fix wrong endianness when printing shadow.Evgeniy Stepanov2014-06-061-0/+4
| | | | llvm-svn: 210335
* [msan] Better diagnostic for invalid origin id.Evgeniy Stepanov2014-06-061-6/+2
| | | | llvm-svn: 210331
* [MSan] Implement __sanitizer_print_stack_trace().Sergey Matveev2014-05-261-6/+10
| | | | llvm-svn: 209625
* [msan] Implement MSAN_OPTIONS=print_stats=1.Evgeniy Stepanov2014-05-211-0/+6
| | | | llvm-svn: 209287
* [msan] Chained origins re-design.Evgeniy Stepanov2014-05-211-18/+57
| | | | | | | | | | | | | | | | | 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
* [msan] Switch to common printf interceptors.Evgeniy Stepanov2014-05-081-0/+2
| | | | | | | | | 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
* [MSan] Fixup for r206983: MsanThread may be unavailable in signal handler: ↵Alexey Samsonov2014-05-071-1/+2
| | | | | | signals may be raised while thread is being destroyed llvm-svn: 208250
* [msan] Fix __msan_check_mem_is_initialized and prettify its output.Evgeniy Stepanov2014-05-071-1/+2
| | | | llvm-svn: 208195
* [msan] Prettify __msan_print_shadow.Evgeniy Stepanov2014-04-301-7/+10
| | | | | | Makes __msan_print_shadow output much more readable, adds origin info. llvm-svn: 207622
* [msan] Disable chained origins in signal handlers.Evgeniy Stepanov2014-04-231-0/+2
| | | | | | StackDepot is not async-signal-safe; storing a new origin to it can deadlock. llvm-svn: 206983
* [msan] Add new MSan callbacks for instrumentation-with-calls mode.Evgeniy Stepanov2014-04-181-0/+28
| | | | llvm-svn: 206584
* [msan] mprotect() more memory to detect user code outside of application range.Evgeniy Stepanov2014-04-111-3/+2
| | | | llvm-svn: 206028
* [msan] Introduce MsanThread. Move thread-local allocator cache out of TLS.Evgeniy Stepanov2014-04-041-10/+11
| | | | | | This reduces .tbss from 109K down to almost nothing. llvm-svn: 205618
* [msan] Kill __msan_print_param_shadow.Evgeniy Stepanov2014-04-021-7/+0
| | | | | | | 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
* [msan] Add __msan_check_mem_is_initialized.Evgeniy Stepanov2014-04-021-0/+16
| | | | | | An assert()-like function that checks that a memory range is fully initialized. llvm-svn: 205413
* [msan] Precise origin handling in __unaligned_(load|store)*.Evgeniy Stepanov2014-04-021-12/+15
| | | | llvm-svn: 205412
* [msan] Remove an extra top frame from track-origins=2 reports.Evgeniy Stepanov2014-03-311-1/+3
| | | | llvm-svn: 205192
* [msan] Implement __msan_set_death_callback.Evgeniy Stepanov2014-03-271-0/+6
| | | | llvm-svn: 204926
* [libsanitizer] Introduce flag descriptions.Alexander Potapenko2014-03-201-9/+10
| | | | | | | | | 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
* [msan] Origin tracking with history, compiler-rt part.Evgeniy Stepanov2014-03-181-0/+13
| | | | | | | | 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
* [sanitizer] Use system unwinder in signal handlers on Android.Evgeniy Stepanov2014-02-111-2/+2
| | | | | | | | | | 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
* [msan] Fix a typo.Evgeniy Stepanov2014-02-031-1/+2
| | | | | | Spotted by Keno Fischer. llvm-svn: 200682
* [Sanitizer] Replace Symbolizer::IsAvailable and ↵Alexey Samsonov2013-12-251-6/+1
| | | | | | | | Symbolizer::IsExternalAvailable with Symbolizer::CanReturnFileLineInfo. Remove now redundant checks in symbolizer initialization in TSan and MSan. llvm-svn: 198000
* [sanitizer] Use the new sanitizer_interception.h header in all interceptors.Evgeniy Stepanov2013-12-201-1/+0
| | | | llvm-svn: 197808
OpenPOWER on IntegriCloud