<div dir="ltr"><div><div><div><div><div>Hi Eric,<br></div>I am still seeing this issue actually. Last night I built clang with clang to save time. I just figured out this issue is only visible if you build clang with gcc/g++.<br>
<br>I am on Debian Wheezy and LLVM was configured with:<br></div><br>cmake $LLVMSrcDir \<br>  -DCMAKE_BUILD_TYPE=Release \<br>  -DFFI_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \<br>  -DFFI_INCLUDE_DIR=/usr/include/x86_64-linux-gnu \<br>
  -DLLVM_ENABLE_FFI=ON<br><br></div>See below for more info.<br><br></div>Thanks,<br></div>-Kal<br><div><div>-----------------------------------------------------------------------<br><div><div><div>#clang --version<br>clang version 3.4 (188254)<br>
Target: x86_64-unknown-linux-gnu<br>Thread model: posix<br><br>#cat main.c<br>int main() { return 42; }<br><br>#clang -g main.c<br><br>#readelf --debug-dump=aranges a.out <br><br>#clang -g -fsanitize=address main.c<br><br>
#readelf --debug-dump=aranges a.out <br>Contents of the .debug_aranges section:<br><br>  Length:                   252<br>  Version:                  2<br>  Offset into .debug_info:  0x0<br>  Pointer Size:             8<br>
  Segment Size:             0<br><br>    Address            Length<br>    00000000004081b0 0000000000006feb <br>    0000000000408020 000000000000001f <br>    0000000000408040 0000000000000022 <br>    0000000000408062 000000000000001f <br>
    000000000040f1a0 0000000000000058 <br>    000000000040f200 0000000000000123 <br>    000000000040f330 00000000000006e5 <br>    000000000040fa20 00000000000000b7 <br>    000000000040fae0 00000000000002f0 <br>    000000000040fdd0 0000000000000238 <br>
    0000000000410010 000000000000013d <br>    0000000000410150 000000000000015a <br>    00000000004102b0 00000000000000bc <br>    0000000000408130 0000000000000024 <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>
  Version:                  2<br>  Offset into .debug_info:  0x1d36c<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000410370 0000000000001510 <br>    0000000000000000 0000000000000000 <br>
  Length:                   60<br>  Version:                  2<br>  Offset into .debug_info:  0x20e2a<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000411880 0000000000001052 <br>
    0000000000408160 000000000000000e <br>    0000000000000000 0000000000000000 <br>  Length:                   60<br>  Version:                  2<br>  Offset into .debug_info:  0x23d32<br>  Pointer Size:             8<br>
  Segment Size:             0<br><br>    Address            Length<br>    00000000004128e0 000000000001f3e8 <br>    0000000000431cd0 000000000000013c <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>
  Version:                  2<br>  Offset into .debug_info:  0x600db<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000431e10 000000000000007f <br>    0000000000000000 0000000000000000 <br>
  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x610bb<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000431e90 00000000000007c5 <br>
    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x63398<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>
    0000000000432660 000000000000058c <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x64ef4<br>  Pointer Size:             8<br>
  Segment Size:             0<br><br>    Address            Length<br>    0000000000432bf0 000000000000137f <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>
  Offset into .debug_info:  0x67e43<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000433f70 0000000000000395 <br>    0000000000000000 0000000000000000 <br>
  Length:                   28<br>  Version:                  2<br>  Offset into .debug_info:  0x6947c<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000000000 0000000000000000 <br>
  Length:                   108<br>  Version:                  2<br>  Offset into .debug_info:  0x69b17<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000434310 000000000000286a <br>
    000000000040f1a0 0000000000000058 <br>    0000000000436b80 0000000000000039 <br>    0000000000436bc0 00000000000000e1 <br>    0000000000436cb0 0000000000000052 <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>
  Version:                  2<br>  Offset into .debug_info:  0x72727<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000436d10 00000000000019f2 <br>    0000000000000000 0000000000000000 <br>
  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x76190<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000438710 0000000000000044 <br>
    0000000000000000 0000000000000000 <br>  Length:                   60<br>  Version:                  2<br>  Offset into .debug_info:  0x76a8f<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>
    0000000000438760 0000000000000a15 <br>    0000000000408170 0000000000000024 <br>    0000000000000000 0000000000000000 <br>  Length:                   108<br>  Version:                  2<br>  Offset into .debug_info:  0x7a35f<br>
  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000439180 0000000000000edb <br>    000000000043a060 0000000000000002 <br>    000000000043a070 0000000000000002 <br>
    000000000043a080 0000000000000002 <br>    000000000043a090 0000000000000002 <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x7e487<br>
  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    000000000043a0a0 0000000000000048 <br>    0000000000000000 0000000000000000 <br>  Length:                   28<br>
  Version:                  2<br>  Offset into .debug_info:  0x7e5ee<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000000000 0000000000000000 <br>  Length:                   124<br>
  Version:                  2<br>  Offset into .debug_info:  0x7e66a<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    000000000043a0f0 0000000000000d48 <br>    000000000040f1a0 0000000000000058 <br>
    000000000043ae40 000000000000010d <br>    000000000043af50 00000000000004ca <br>    000000000043b420 00000000000002f5 <br>    000000000043b720 0000000000000247 <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>
  Version:                  2<br>  Offset into .debug_info:  0x85f86<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    000000000043b970 00000000000006dd <br>    0000000000000000 0000000000000000 <br>
  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x8761e<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    000000000043c050 000000000000056c <br>
    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x88696<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>
    000000000043c5c0 0000000000000ba2 <br>    0000000000000000 0000000000000000 <br>  Length:                   76<br>  Version:                  2<br>  Offset into .debug_info:  0x8980d<br>  Pointer Size:             8<br>
  Segment Size:             0<br><br>    Address            Length<br>    000000000043d170 00000000000013cc <br>    0000000000408081 00000000000000ad <br>    0000000000000000 000000000000004a <br>    0000000000000000 0000000000000000 <br>
  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x8fd76<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    000000000043e540 000000000000004a <br>
    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x944b2<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>
    000000000043e590 00000000000006dc <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x95bf4<br>  Pointer Size:             8<br>
  Segment Size:             0<br><br>    Address            Length<br>    000000000043ec70 0000000000000b49 <br>    0000000000000000 0000000000000000 <br>  Length:                   60<br>  Version:                  2<br>
  Offset into .debug_info:  0x971b8<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    000000000043f7c0 00000000000004e4 <br>    000000000040f1a0 0000000000000058 <br>
    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x9907e<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>
    000000000043fcb0 00000000000006f7 <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x9aac9<br>  Pointer Size:             8<br>
  Segment Size:             0<br><br>    Address            Length<br>    00000000004403b0 00000000000007a2 <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>
  Offset into .debug_info:  0x9c33c<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000440b60 0000000000000025 <br>    0000000000000000 0000000000000000 <br>
  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x9c52b<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000440b90 0000000000000131 <br>
    0000000000000000 0000000000000000 <br>  Length:                   140<br>  Version:                  2<br>  Offset into .debug_info:  0x9ca24<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>
    0000000000440cd0 0000000000001045 <br>    000000000043a060 0000000000000002 <br>    000000000043a070 0000000000000002 <br>    0000000000441d20 0000000000000002 <br>    000000000043a080 0000000000000002 <br>    0000000000441d30 0000000000000002 <br>
    000000000043a090 0000000000000002 <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0x9fa70<br>  Pointer Size:             8<br>
  Segment Size:             0<br><br>    Address            Length<br>    0000000000441d40 0000000000000021 <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>
  Offset into .debug_info:  0x9fc33<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    0000000000441d70 000000000000076e <br>    0000000000000000 0000000000000000 <br>
  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0xa156b<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    00000000004424e0 00000000000001d3 <br>
    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0xa21c7<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>
    00000000004426c0 0000000000000d76 <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0xa560a<br>  Pointer Size:             8<br>
  Segment Size:             0<br><br>    Address            Length<br>    0000000000443440 0000000000000e9c <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>
  Offset into .debug_info:  0xa8808<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    00000000004442e0 00000000000001c4 <br>    0000000000000000 0000000000000000 <br>
  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0xa936e<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    00000000004444b0 0000000000000408 <br>
    0000000000000000 0000000000000000 <br>  Length:                   60<br>  Version:                  2<br>  Offset into .debug_info:  0xa9b58<br>  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>
    00000000004448c0 0000000000001ff5 <br>    00000000004081a0 000000000000000e <br>    0000000000000000 0000000000000000 <br>  Length:                   44<br>  Version:                  2<br>  Offset into .debug_info:  0xb054e<br>
  Pointer Size:             8<br>  Segment Size:             0<br><br>    Address            Length<br>    00000000004468c0 00000000000004f2 <br>    0000000000000000 0000000000000000 <br></div></div></div></div></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/12 Kal Conley <span dir="ltr"><<a href="mailto:kcconley@gmail.com" target="_blank">kcconley@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This appears to be fixed ToT. Must have been fixed very recently? The<br>
last build I did was last week. You can also reproduce with clang-3.3.<br>
-Kal<br>
<br>
Am 8/12/13 10:28 PM, schrieb Eric Christopher:<br>
<div class="HOEnZb"><div class="h5">> Do you have an example? A random testcase didn't have anything emitted.<br>
><br>
> -eric<br>
><br>
> On Mon, Aug 12, 2013 at 1:22 PM, Kal Conley <<a href="mailto:kcconley@gmail.com">kcconley@gmail.com</a>> wrote:<br>
>> When I compile with -fsanitize=address the resulting binary contains a<br>
>> .debug_aranges section on Linux. However it is incomplete and it trips<br>
>> up lldb.<br>
>> -Kal<br>
>><br>
>> Am 8/12/13 8:11 PM, schrieb Eric Christopher:<br>
>>> Exactly, we don't produce it at the moment. It's on the list mind you, but ...<br>
>>><br>
>>> -eric<br>
>>><br>
>>> On Mon, Aug 12, 2013 at 11:02 AM, Robinson, Paul<br>
>>> <<a href="mailto:Paul_Robinson@playstation.sony.com">Paul_Robinson@playstation.sony.com</a>> wrote:<br>
>>>> Clang can produce .debug_aranges?  Somebody asked me about this recently,<br>
>>>> and I couldn’t get clang to produce a non-empty section, unless I was<br>
>>>> compiling an assembler source.<br>
>>>><br>
>>>> --paulr<br>
>>>><br>
>>>><br>
>>>><br>
>>>> From: <a href="mailto:cfe-dev-bounces@cs.uiuc.edu">cfe-dev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:cfe-dev-bounces@cs.uiuc.edu">cfe-dev-bounces@cs.uiuc.edu</a>] On<br>
>>>> Behalf Of David Blaikie<br>
>>>> Sent: Monday, August 12, 2013 10:13 AM<br>
>>>> To: Kal Conley<br>
>>>> Cc: cfe-dev Developers<br>
>>>> Subject: Re: [cfe-dev] clang -g -fsanitize=address produces broken debug<br>
>>>> info?<br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>> On Aug 12, 2013 9:55 AM, "Kal Conley" <<a href="mailto:kcconley@gmail.com">kcconley@gmail.com</a>> wrote:<br>
>>>>> Hi,<br>
>>>>> DWARF info produced with "clang -g -fsanitize=address" doesn't have a<br>
>>>>> complete .debug_aranges section. LLDB relies on .debug_aranges if it is<br>
>>>>> present, thus LLDB fails to load any debug info for clang binaries built<br>
>>>>> with -fsanitize=address. The LLDB folks believe this is a clang bug. Can<br>
>>>>> someone from the clang side look into this?<br>
>>>> Can you describe in what way it is broken? Do you have a reduced test case?<br>
>>>><br>
>>>>> Thanks,<br>
>>>>> -Kal<br>
>>>>> _______________________________________________<br>
>>>>> cfe-dev mailing list<br>
>>>>> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
>>>>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
>>>> _______________________________________________<br>
>>>> cfe-dev mailing list<br>
>>>> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
>>>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
>>>><br>
<br>
</div></div></blockquote></div><br></div>