llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.02k stars 11.57k forks source link

print-stack-trace.cc test case print "Dwarf Error: Info pointer extends beyond end of attributes" #27653

Open llvmbot opened 8 years ago

llvmbot commented 8 years ago
Bugzilla Link 27279
Version 3.8
OS Linux
Reporter LLVM Bugzilla Contributor
CC @adrian-prantl,@dwblaikie,@echristo,@vitalybuka

Extended Description

The error message occurs when we do clang bootstrap testing.

Reproduce Step:

  1. Need a bootstrap version of clang

mkdir stage2 && cd stage2

CLANG_PATH=/path/to/clang/built/by/gcc CC=$CLANG_PATH/bin/clang CXX=$CLANG_PATH/bin/clang++

cmake -DCMAKE_C_COMPILER=$CC \ -DCMAKE_CXX_COMPILER=$CXX \ -DCMAKE_BUILD_TYPE=Release \ /path/to/llvm/src

make -j8 check-sanitizer

  1. Search the binary "print-stack-trace.cc.tmp" and execute it.

find -name 'print-stack-trace.cc.tmp' -exec {} \;

  1. Output on x86: /usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes .. (repeat 14 times)

    ​0 __sanitizer_print_stack_trace /home/cycheng/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc:705 (print-stack-trace.cc.tmp+0x000000478f45)

    ​1 main /home/cycheng/llvm/projects/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc:9 (print-stack-trace.cc.tmp+0x00000049b14f)

    ​2 main /home/cycheng/llvm/projects/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc:13 (print-stack-trace.cc.tmp+0x00000049b14f)

    ​3 __libc_start_main /build/glibc-ryFjv0/glibc-2.21/csu/libc-start.c:289 (libc.so.6+0x000000020a3f)

    ​4 _start (print-stack-trace.cc.tmp+0x00000041a2f8)

  2. Output on PPC: /usr/bin/addr2line: Dwarf Error: Info pointer extends beyond end of attributes .. (repeat 14 times)

    ​0 0x100a5238 in __sanitizer_print_stack_trace /home/cycheng/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc:705

    ​1 0x100d54cc in FooBarBaz() /home/cycheng/llvm/projects/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc:9

    ​2 0x100d5464 in main /home/cycheng/llvm/projects/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc:13

  3. Platform Information: Tested version of llvm/clang/compiler-rt:

    • r265128/r265083/r265378
    • release_38/release_38/release_38

    /usr/bin/addr2line version:

    • on x86: 2.25.1
    • on ppc: 2.25
vitalybuka commented 6 years ago

Is this still relevant?

llvmbot commented 8 years ago

I'd very much like to have a testcase to duplicate this yes. It is definitely a bug.

Sorry I am still unable to write a simple testcase, but I have some progress. I found if I remove the compile option '-gline-tables-only' when building "lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.*.dir" by clang, the error disappeared.

e.g. on x86:

vi lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/flags.make

remove '-gline-tables-only'

rm lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/*.o cd ../../ make -j8 check-sanitizer find -name 'print-stack-trace.cc.tmp' -exec {} \;

I also found these object files that will cause this error when building with "-gline-tables-only":

sanitizer_deadlock_detector2.cc.o sanitizer_linux_s390.cc.o sanitizer_persistent_allocator.cc.o sanitizer_platform_limits_linux.cc.o sanitizer_procmaps_freebsd.cc.o sanitizer_procmaps_mac.cc.o sanitizer_symbolizer_mac.cc.o sanitizer_symbolizer_win.cc.o sanitizer_win.cc.o

echristo commented 8 years ago

I'd very much like to have a testcase to duplicate this yes. It is definitely a bug.

llvmbot commented 8 years ago

It only shows up when I use clang to build compiler-rt library.

So I don't have to worry about this message?

adrian-prantl commented 8 years ago

I haven't seen this one either...

dwblaikie commented 8 years ago

Nothing that springs to my mind. :/

echristo commented 8 years ago

Adrian, Dave: Wasn't there something like this recently?