summaryrefslogtreecommitdiff
path: root/lib/msan/msan_report.cc
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-02-13 07:19:47 +0000
committerKostya Serebryany <kcc@google.com>2013-02-13 07:19:47 +0000
commit70c6e3fb6dfddb9c4d26ac133beb5f53b71e47d9 (patch)
tree3343bf5d73e44bd57bb6f7b7e60d8ed13d08762b /lib/msan/msan_report.cc
parent867ac63fdc4d5aec1c1d66858937cf787af86105 (diff)
[msan] don't check shadow inside interceptors if we are inside symbolizer; 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
Diffstat (limited to 'lib/msan/msan_report.cc')
-rw-r--r--lib/msan/msan_report.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/msan/msan_report.cc b/lib/msan/msan_report.cc
index d4a6d3018..16b13f6c0 100644
--- a/lib/msan/msan_report.cc
+++ b/lib/msan/msan_report.cc
@@ -44,6 +44,16 @@ class Decorator: private __sanitizer::AnsiColorDecorator {
const char *End() { return Default(); }
};
+struct SymbolizerScope {
+ SymbolizerScope() { EnterSymbolizer(); }
+ ~SymbolizerScope() { ExitSymbolizer(); }
+};
+
+static void PrintStack(const uptr *trace, uptr size) {
+ SymbolizerScope sym_scope;
+ StackTrace::PrintStack(trace, size, true, flags()->strip_path_prefix, 0);
+}
+
static void DescribeOrigin(u32 origin) {
Decorator d;
if (flags()->verbosity)
@@ -64,7 +74,7 @@ static void DescribeOrigin(u32 origin) {
const uptr *trace = StackDepotGet(origin, &size);
Printf(" %sUninitialized value was created by a heap allocation%s\n",
d.Origin(), d.End());
- StackTrace::PrintStack(trace, size, true, flags()->strip_path_prefix, 0);
+ PrintStack(trace, size);
}
}
@@ -72,7 +82,10 @@ static void ReportSummary(const char *error_type, StackTrace *stack) {
if (!stack->size || !IsSymbolizerAvailable()) return;
AddressInfo ai;
uptr pc = StackTrace::GetPreviousInstructionPc(stack->trace[0]);
- SymbolizeCode(pc, &ai, 1);
+ {
+ SymbolizerScope sym_scope;
+ SymbolizeCode(pc, &ai, 1);
+ }
ReportErrorSummary(error_type,
StripPathPrefix(ai.file, flags()->strip_path_prefix),
ai.line, ai.function);
@@ -87,8 +100,7 @@ void ReportUMR(StackTrace *stack, u32 origin) {
Printf("%s", d.Warning());
Report(" WARNING: Use of uninitialized value\n");
Printf("%s", d.End());
- StackTrace::PrintStack(stack->trace, stack->size, true,
- flags()->strip_path_prefix, 0);
+ PrintStack(stack->trace, stack->size);
if (origin) {
DescribeOrigin(origin);
}
@@ -99,8 +111,7 @@ void ReportExpectedUMRNotFound(StackTrace *stack) {
GenericScopedLock<StaticSpinMutex> lock(&report_mu);
Printf(" WARNING: Expected use of uninitialized value not found\n");
- StackTrace::PrintStack(stack->trace, stack->size, true,
- flags()->strip_path_prefix, 0);
+ PrintStack(stack->trace, stack->size);
}
void ReportAtExitStatistics() {