[compiler-rt] r220582 - Add runtime flag 'symbolize_inline_frames' to disable symbolization of inlined frames done in llvm-symbolizer

Alexey Samsonov vonosmas at gmail.com
Mon Oct 27 15:48:54 PDT 2014


Hi Will,

It's possible that FooBarBaz() just doesn't get inlined. Could you check if
the attached patch fixes the test for you?

On Mon, Oct 27, 2014 at 3:23 PM, Will Schmidt <will_schmidt at vnet.ibm.com>
wrote:

> On Fri, 2014-10-24 at 18:34 +0000, Alexey Samsonov wrote:
> > Author: samsonov
> > Date: Fri Oct 24 13:34:43 2014
> > New Revision: 220582
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=220582&view=rev
> > Log:
> > Add runtime flag 'symbolize_inline_frames' to disable symbolization of
> inlined frames done in llvm-symbolizer
> >
>
> > Modified:
> compiler-rt/trunk/test/sanitizer_common/TestCases/print-stack-trace.cc
> > URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/print-stack-trace.cc?rev=220582&r1=220581&r2=220582&view=diff
> >
> ==============================================================================
> > ---
> compiler-rt/trunk/test/sanitizer_common/TestCases/print-stack-trace.cc
> (original)
> > +++
> compiler-rt/trunk/test/sanitizer_common/TestCases/print-stack-trace.cc Fri
> Oct 24 13:34:43 2014
> > @@ -1,13 +1,14 @@
> >  // RUN: %clangxx -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
> >  // RUN: %clangxx -O3 %s -o %t && %run %t 2>&1 | FileCheck %s
> > -//
> > +// RUN: %tool_options=symbolize_inline_frames=false %run %t 2>&1 |
> FileCheck %s --check-prefix=NOINLINE
> > +
>
> Hi Alexey,
>
> This one fails for me, in a local build, on ppc64*.  The output from the
> run portion ( that gets passed into FileCheck ) looks the same,
> regardless of the ASAN_OPTIONS=symbolize_inline_frames=*  value used.
> So I'd guess this is an architecture limitation for the moment, but
> thats not obvious from the other changes...   Am I missing something
> else in my environment here?  (should be all fresh build, etc).
>
> > /home/willschm/llvm_build/native/llvm.cmake/./bin/clang
> --driver-mode=g++ -gline-tables-only -fsanitize=address  -O3
> /home/willschm/llvm/projects/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc
> -o
> /home/willschm/llvm_build/native/llvm.cmake/projects/compiler-rt/test/sanitizer_common/asan/Output/print-stack-trace.cc.tmp
>
> > ASAN_OPTIONS=symbolize_inline_frames=true
> /home/willschm/llvm_build/native/llvm.cmake/projects/compiler-rt/test/sanitizer_common/asan/Output/print-stack-trace.cc.tmp
>     #0 0x100c07dc in __sanitizer_print_stack_trace
> /home/willschm/llvm/projects/compiler-rt/lib/asan/asan_stack.cc:23
>     #1 0x100def70 in FooBarBaz
> /home/willschm/llvm/projects/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc:12:3
>     #2 0x100def70 in main
> /home/willschm/llvm/projects/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc:16
>     #3 0x1000003b4cfc in generic_start_main
> /build/buildd/eglibc-2.19/csu/../csu/libc-start.c:287
>
> Thanks,
> -Will
>
>
> >  // Not yet implemented for TSan.
> >  // https://code.google.com/p/address-sanitizer/issues/detail?id=243
> >  // XFAIL: tsan
> >
> >  #include <sanitizer/common_interface_defs.h>
> >
> > -void FooBarBaz() {
> > +static inline void FooBarBaz() {
> >    __sanitizer_print_stack_trace();
> >  }
> >
> > @@ -16,5 +17,8 @@ int main() {
> >    return 0;
> >  }
> >  // CHECK: {{    #0 0x.* in __sanitizer_print_stack_trace}}
> > -// CHECK: {{    #1 0x.* in FooBarBaz(\(\))? .*print-stack-trace.cc:11}}
> > -// CHECK: {{    #2 0x.* in main.*print-stack-trace.cc:15}}
> > +// CHECK: {{    #1 0x.* in FooBarBaz(\(\))? .*print-stack-trace.cc:12}}
> > +// CHECK: {{    #2 0x.* in main.*print-stack-trace.cc:16}}
> > +
> > +// NOINLINE: #0 0x{{.*}} in __sanitizer_print_stack_trace
> > +// NOINLINE: #1 0x{{.*}} in main{{.*}}print-stack-trace.cc:12
>
>
>
>
>
>
>


-- 
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141027/7688a569/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: print-stack-trace.patch
Type: application/octet-stream
Size: 1035 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141027/7688a569/attachment.obj>


More information about the llvm-commits mailing list