summaryrefslogtreecommitdiff
path: root/lib/msan/msan_report.cc
AgeCommit message (Collapse)Author
2017-11-09[msan] Replace CommonSanitizerReportMutex with ScopedErrorReportLockVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@317842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[compiler-rt] Cleanup decoratorsVitaly Buka
Summary: Removed redundant End*() methods which defined same way. Removed redundant Warning() methods. Reviewers: eugenis Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37549 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312950 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-26[MSan] Endianness should not matter while printing a byteMohit K. Bhakkad
Reviewers: eugenis Subscribers: jaydeep, sagar, llvm-commits Differential Revision: http://reviews.llvm.org/D17264 Differential Revision: http://reviews.llvm.org/D17563 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261982 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31[Sanitizer] Be consistent about separating ==%PID== and logged data.Alexey Samsonov
See https://code.google.com/p/address-sanitizer/issues/detail?id=385. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@233720 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-22[msan] Better use-after-free reports.Evgeniy Stepanov
By attaching an extra integer tag to heap origins, we are able to distinguish between uninits - created by heap allocation, - created by heap deallocation (i.e. use-after-free), - created by __msan_allocated_memory call, - etc. See https://code.google.com/p/memory-sanitizer/issues/detail?id=35. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226821 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-20[asan] Allow changing verbosity in activation flags.Evgeniy Stepanov
This change removes some debug output in asan_flags.cc that was reading the verbosity level before all the flags were parsed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226566 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03[msan] Change the way origin ids are built.Evgeniy Stepanov
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223233 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-19[MSan] [MIPS] Adding support for MIPS64 (patch by Mohit Bhakkad).Alexey Samsonov
Reviewed at http://reviews.llvm.org/D5906 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222388 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-26[Sanitizer] Make StackTrace a lightweight reference to array of PCs, andAlexey Samsonov
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220635 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-14[msan] Stop demangling function name in the stack origin report.Evgeniy Stepanov
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212929 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-27[msan] Fix truncated stack trace in chained origin reports.Evgeniy Stepanov
This is a leftover from the times when the next (chained) origin id was stored as the last frame of a stack trace. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@211878 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-06[msan] Fix wrong endianness when printing shadow.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@210335 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-06[msan] Better diagnostic for invalid origin id.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@210331 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04[sanitizer] Make LSan/MSan/TSan honor the "color" flag.Sergey Matveev
Based on a patch by Stephan Bergmann. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@210199 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21[msan] Implement MSAN_OPTIONS=print_stats=1.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209287 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21[msan] Chained origins re-design.Evgeniy Stepanov
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209284 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-07[msan] Fix __msan_check_mem_is_initialized and prettify its output.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208195 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-30[msan] Prettify __msan_print_shadow.Evgeniy Stepanov
Makes __msan_print_shadow output much more readable, adds origin info. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207622 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18[msan] Origin tracking with history, compiler-rt part.Evgeniy Stepanov
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204152 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-19[ASan] Get rid of ASan-specific functions for printing stack tracesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197672 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05[sanitizer] Introduce VReport and VPrintf macros and use them in sanitizer code.Sergey Matveev
Instead of "if (common_flags()->verbosity) Report(...)" we now have macros. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196497 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-01[Sanitizer] Unify summary reporting across all sanitizers.Alexey Samsonov
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". git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193864 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-01Consistently use StackTrace::PrintStack in ASan, LSan and MSanAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193834 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31[Sanitizer] Add Symbolizer::AddHooks() and use it in TSan and MSan.Alexey Samsonov
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193807 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29[Sanitizer] Simplify StackTrace::PrintStack interface: prefer common flags ↵Alexey Samsonov
to turn on/off the symbolization git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193587 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-28asan/msan: separate different report blocks with new linesDmitry Vyukov
this makes the reports consistent with tsan, and much more readable. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193520 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-25Overhaul the symbolizer interface.Peter Collingbourne
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193448 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-25[msan] Separate access and origin blocks in msan reports with an extra ↵Evgeniy Stepanov
whiteline. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193401 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-15tsan: move verbosity flag to CommonFlagsDmitry Vyukov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192701 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04Refactor the usage of strip_path_prefix option and make it more consistent ↵Alexey Samsonov
across sanitizers git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191943 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13[msan] Add source file:line to stack origin reports.Evgeniy Stepanov
Runtime library part. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190686 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10[Sanitizer] Refactor symbolization interface: use class instead of several ↵Alexey Samsonov
functions. Move some code around to get rid of extra source files git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190410 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03[lsan] Colorize LSan reports.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189804 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-29Make InternalAlloc/InternalFree in sanitizer runtimes libc-free by switching ↵Alexey Samsonov
to a custom allocator. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182836 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28[msan] Change report header to be more alike to ASan and TSan.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182774 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-06[msan] Common flags in MSan.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181194 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12[MSan] Demangle function name in description of stack originAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@179368 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05[Sanitizer] Use a common mutex to prevent mixing reports from different ↵Alexey Samsonov
sanitizers. This fixes PR15516 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@178853 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06[msan] Block reports from interceptors during _Unwind_BacktraceReid Kleckner
Summary: I'm hitting a big recursive report from: uninit on strlen -> __msan::PrintWarningWithOrigin() -> __msan::GetStackTrace() -> __sanitizer::StackTrace::SlowUnwindStack() -> _Unwind_Backtrace() -> ... libgcc calls -> uninit on strlen() -> ... repeats Reviewers: eugenis Differential Revision: http://llvm-reviews.chandlerc.com/D497 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176555 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13[msan] don't check shadow inside interceptors if we are inside symbolizer; ↵Kostya Serebryany
add weak function __msan_default_options that overrides default options git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@175040 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12[MSan] symbolize correct PC when printing Summary messageAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174956 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11[msan] Lit tests for MemorySanitizer.Evgeniy Stepanov
Build system setup for MSan lit tests (build with freshly-built clang, run, check output) - a nearly exact copy from ASan. First 2 lit tests for MSan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174876 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07[msan] add strip_path_prefix flag; print error summary; don't crash while ↵Kostya Serebryany
printing summary if debug info is missing. The tests will follow later once we establish the lit-like tests for msan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174595 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30[Sanitizer] update style checker script and fix namespace style warningsAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173910 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10[msan] Set program exit code in keep-going mode.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172057 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-27[sanitizer] add statistics to the allocator; fix lintKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@171161 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-26[msan] MSan, New Year Tree style.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@171106 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-26[msan] Refactor report printing.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@171105 91177308-0d34-0410-b5e6-96231b3b80d8