<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 24, 2014 at 12:08 PM, Kuba Brecka <span dir="ltr"><<a href="mailto:kuba.brecka@gmail.com" target="_blank">kuba.brecka@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I'm getting test failures for compiler-rt asan tests after this patch. It seems the symbolizer stops working with -gline-tables-only on OS X:</div></div></blockquote><div><br>Could you provide a simple reproduction? (a clang command line with a -target and an llvm-symbolizer invocation that should symbolize a particular instruction/offset in the binary, etc) and/or llvm-dwarfdump of a simple binary that fails symbolication when it shouldn't.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>FAIL: AddressSanitizer32 :: TestCases/use-after-free.cc (222 of 460)</div></div><div><div>******************** TEST 'AddressSanitizer32 :: TestCases/use-after-free.cc' FAILED ********************</div></div><div><div>Script:</div></div><div><div>--</div></div><div><div>/Users/kuba/llvm-tot-cmake-release/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m32 -O0 /Users/kuba/llvm-tot/projects/compiler-rt/test/asan/TestCases/use-after-free.cc -o /Users/kuba/llvm-tot-cmake-release/projects/compiler-rt/test/asan/32bitConfig/TestCases/Output/use-after-free.cc.tmp && not  /Users/kuba/llvm-tot-cmake-release/projects/compiler-rt/test/asan/32bitConfig/TestCases/Output/use-after-free.cc.tmp 2>&1 | FileCheck /Users/kuba/llvm-tot/projects/compiler-rt/test/asan/TestCases/use-after-free.cc --check-prefix=CHECK-Darwin --check-prefix=CHECK</div></div><div><div>/Users/kuba/llvm-tot-cmake-release/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m32 -O1 /Users/kuba/llvm-tot/projects/compiler-rt/test/asan/TestCases/use-after-free.cc -o /Users/kuba/llvm-tot-cmake-release/projects/compiler-rt/test/asan/32bitConfig/TestCases/Output/use-after-free.cc.tmp && not  /Users/kuba/llvm-tot-cmake-release/projects/compiler-rt/test/asan/32bitConfig/TestCases/Output/use-after-free.cc.tmp 2>&1 | FileCheck /Users/kuba/llvm-tot/projects/compiler-rt/test/asan/TestCases/use-after-free.cc --check-prefix=CHECK-Darwin --check-prefix=CHECK</div></div><div><div>/Users/kuba/llvm-tot-cmake-release/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m32 -O2 /Users/kuba/llvm-tot/projects/compiler-rt/test/asan/TestCases/use-after-free.cc -o /Users/kuba/llvm-tot-cmake-release/projects/compiler-rt/test/asan/32bitConfig/TestCases/Output/use-after-free.cc.tmp && not  /Users/kuba/llvm-tot-cmake-release/projects/compiler-rt/test/asan/32bitConfig/TestCases/Output/use-after-free.cc.tmp 2>&1 | FileCheck /Users/kuba/llvm-tot/projects/compiler-rt/test/asan/TestCases/use-after-free.cc --check-prefix=CHECK-Darwin --check-prefix=CHECK</div></div><div><div>/Users/kuba/llvm-tot-cmake-release/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m32 -O3 /Users/kuba/llvm-tot/projects/compiler-rt/test/asan/TestCases/use-after-free.cc -o /Users/kuba/llvm-tot-cmake-release/projects/compiler-rt/test/asan/32bitConfig/TestCases/Output/use-after-free.cc.tmp && not  /Users/kuba/llvm-tot-cmake-release/projects/compiler-rt/test/asan/32bitConfig/TestCases/Output/use-after-free.cc.tmp 2>&1 | FileCheck /Users/kuba/llvm-tot/projects/compiler-rt/test/asan/TestCases/use-after-free.cc --check-prefix=CHECK-Darwin --check-prefix=CHECK</div></div><div><div>--</div></div><div><div>Exit Code: 1</div></div><div><div><br></div></div><div><div>Command Output (stdout):</div></div><div><div>--</div></div><div><div>warning: no debug symbols in executable (-arch i386)</div></div><div><div><br></div></div><div><div>--</div></div><div><div>Command Output (stderr):</div></div><div><div>--</div></div><div><div>/Users/kuba/llvm-tot/projects/compiler-rt/test/asan/TestCases/use-after-free.cc:15:12: error: expected string not found in input</div></div><div><div> // CHECK: {{ #0 0x.* in main .*use-after-free.cc:}}[[@LINE-4]]</div></div><div><div>           ^</div></div><div><div><stdin>:4:2: note: scanning from here</div></div><div><div> #0 0x75e5f in main (/Users/kuba/llvm-tot-cmake-release/projects/compiler-rt/test/asan/32bitConfig/TestCases/Output/use-after-free.cc.tmp+0x1e5f)</div></div><div><div> ^</div></div><div><div><stdin>:4:2: note: with expression "@LINE-4" equal to "11"</div></div><div><div> #0 0x75e5f in main (/Users/kuba/llvm-tot-cmake-release/projects/compiler-rt/test/asan/32bitConfig/TestCases/Output/use-after-free.cc.tmp+0x1e5f)</div></div><div><div> ^</div></div><div><div><stdin>:4:97: note: possible intended match here</div></div><div><div> #0 0x75e5f in main (/Users/kuba/llvm-tot-cmake-release/projects/compiler-rt/test/asan/32bitConfig/TestCases/Output/use-after-free.cc.tmp+0x1e5f)</div></div></blockquote><span class="HOEnZb"><font color="#888888"><div><br></div><div>Kuba</div></font></span><div><div class="h5"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: dblaikie<br>Date: Fri Sep 19 12:03:16 2014<br>New Revision: 218129<br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=218129&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=218129&view=rev</a><br>Log:<br>Omit DW_TAG_subprograms for subprograms without inlined subroutines when producing -gmlt data<br>To reduce the size of -gmlt data, skip the subprograms without any<br>inlined subroutines. Since we've now got the ability to make these<br>determinations in the backend (funnily enough - we added the flag so we<br>wouldn't produce ranges under -gmlt, but with this change we use the<br>flag, but go back to producing ranges under -gmlt).<br>Instead, just produce CU ranges to inform the consumer which parts of<br>the code are described by this CU's line table. Tools could inspect the<br>line table directly to compute the range, but the CU ranges only seem to<br>be about 0.5% of object/executable size, so I'm not too worried about<br>teaching llvm-symbolizer that trick just yet - it's certainly a possible<br>piece of future work.<br>Update an llvm-symbolizer test just to demonstrate that this schema is<br>acceptable there (if it wasn't, the compiler-rt tests would catch this,<br>but good to have an in-llvm-tree test for llvm-symbolizer's behavior<br>here)<br>Building the clang binary with -gmlt with this patch reduces the total<br>size of object files by 5.1% (5.56% without ranges) without compression<br>and the executable by 4.37% (4.75% without ranges).<br>Modified:<br>    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp<br>    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-inl-test.elf-x86-64<br>    llvm/trunk/test/DebugInfo/gmlt.ll<br>    llvm/trunk/test/DebugInfo/llvm-symbolizer.test</blockquote></div></div></div>
</blockquote></div><br></div></div>