[compiler-rt] r212929 - [msan] Stop demangling function name in the stack origin report.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Mon Jul 14 02:35:27 PDT 2014


Author: eugenis
Date: Mon Jul 14 04:35:27 2014
New Revision: 212929

URL: http://llvm.org/viewvc/llvm-project?rev=212929&view=rev
Log:
[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.

Added:
    compiler-rt/trunk/test/msan/report-demangling.cc   (with props)
Modified:
    compiler-rt/trunk/lib/msan/msan_report.cc

Modified: compiler-rt/trunk/lib/msan/msan_report.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_report.cc?rev=212929&r1=212928&r2=212929&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_report.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_report.cc Mon Jul 14 04:35:27 2014
@@ -46,8 +46,8 @@ static void DescribeStackOrigin(const ch
   Printf(
       "  %sUninitialized value was created by an allocation of '%s%s%s'"
       " in the stack frame of function '%s%s%s'%s\n",
-      d.Origin(), d.Name(), s, d.Origin(), d.Name(),
-      Symbolizer::Get()->Demangle(sep + 1), d.Origin(), d.End());
+      d.Origin(), d.Name(), s, d.Origin(), d.Name(), sep + 1, d.Origin(),
+      d.End());
   InternalFree(s);
 
   if (pc) {

Added: compiler-rt/trunk/test/msan/report-demangling.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/msan/report-demangling.cc?rev=212929&view=auto
==============================================================================
--- compiler-rt/trunk/test/msan/report-demangling.cc (added)
+++ compiler-rt/trunk/test/msan/report-demangling.cc Mon Jul 14 04:35:27 2014
@@ -0,0 +1,19 @@
+// Test that function name is mangled in the "created by an allocation" line,
+// and demangled in the single-frame "stack trace" that follows.
+
+// RUN: %clangxx_msan -fsanitize-memory-track-origins -m64 -O0 %s -o %t && not %run %t >%t.out 2>&1
+// RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
+
+__attribute__((noinline))
+int f() {
+  int x;
+  int *volatile p = &x;
+  return *p;
+}
+
+int main(int argc, char **argv) {
+  return f();
+  // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
+  // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame of function '_Z1fv'
+  // CHECK: #0 {{.*}} in f() {{.*}}report-demangling.cc:[[@LINE-10]]
+}

Propchange: compiler-rt/trunk/test/msan/report-demangling.cc
------------------------------------------------------------------------------
    svn:eol-style = LF





More information about the llvm-commits mailing list