<div dir="ltr">Thanks Greg. Yes, as I tried in another thread, the error seems to go away after patching with this fix.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 28, 2016 at 9:33 AM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This seems to have been fixed with the <a href="http://reviews.llvm.org/D18008" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18008</a>.<br>
<div class="HOEnZb"><div class="h5"><br>
> On Mar 28, 2016, at 9:31 AM, Greg Clayton via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Is it possible for me to see the "biggrep_master_server_async" binary? I would like to look at the DWARF and try to figure out what is wrong. It seems that this code is what is causing the problem:<br>
><br>
><br>
> CompilerType member_clang_type = member_type->GetLayoutCompilerType ();<br>
> if (!member_clang_type.IsCompleteType())<br>
>    member_clang_type.GetCompleteType();<br>
><br>
> {<br>
>    // Older versions of clang emit array[0] and array[1] in the same way (<rdar://problem/12566646>).<br>
>    // If the current field is at the end of the structure, then there is definitely no room for extra<br>
>    // elements and we override the type to array[0].<br>
><br>
>    CompilerType member_array_element_type;<br>
>    uint64_t member_array_size;<br>
>    bool member_array_is_incomplete;<br>
><br>
>    if (member_clang_type.IsArrayType(&member_array_element_type,<br>
>                                      &member_array_size,<br>
>                                      &member_array_is_incomplete) &&<br>
>        !member_array_is_incomplete)<br>
>    {<br>
>        uint64_t parent_byte_size = parent_die.GetAttributeValueAsUnsigned(DW_AT_byte_size, UINT64_MAX);<br>
><br>
>        if (member_byte_offset >= parent_byte_size)<br>
>        {<br>
>            if (member_array_size != 1 && (member_array_size != 0 || member_byte_offset > parent_byte_size))<br>
>            {<br>
>                module_sp->ReportError ("0x%8.8" PRIx64 ": DW_TAG_member '%s' refers to type 0x%8.8" PRIx64 " which extends beyond the bounds of 0x%8.8" PRIx64,<br>
>                                        die.GetID(),<br>
>                                        name,<br>
>                                        encoding_form.Reference(),<br>
>                                        parent_die.GetID());<br>
>            }<br>
><br>
>            member_clang_type = m_ast.CreateArrayType(member_array_element_type, 0, false);<br>
>        }<br>
>    }<br>
> }<br>
><br>
><br>
> So we are parsing a member variable, and the member variable's type is an array type, and the offset of the member is beyond the parent's type's size and yet the array claims to have a valid size.<br>
><br>
> This code is trying to correctly create an CompilerType for a struct such as this:<br>
><br>
> struct MyStruct<br>
> {<br>
>    size_t num_entries;<br>
>    Entry entries[0];<br>
> };<br>
><br>
> Older versions of clang would emit the same DWARF for:<br>
><br>
> struct MyStruct<br>
> {<br>
>    size_t num_entries;<br>
>    Entry entries[0];<br>
> };<br>
><br>
> or<br>
><br>
> struct MyStruct<br>
> {<br>
>    size_t num_entries;<br>
>    Entry entries[1];<br>
> };<br>
><br>
> This is bad because in the DWARFASTParserClang we are trying to faithfully re-create the type as the user initially created it.<br>
><br>
> This error is trying to say that you have a structure where the byte size of "MyStruct" is something like 8 bytes, but "entries" is an array that has a valid size (not zero or one) and that the offset of "entries" is greater than or equal to 8. If "entries" has a size like:<br>
><br>
> struct MyStruct<br>
> {<br>
>    size_t num_entries;<br>
>    Entry entries[1];<br>
> };<br>
><br>
> You would expect the member offset for "entries" to be less than or equal to the sizeof(MyStruct). If "Entry" is 8 bytes in size, you might expect the byte size of "MyStruct" to be 16, and the offset of "num_entries" to be 0 and "entries" to be 8. Both offsets are less than or equal to the byte size of 16.<br>
><br>
> If I can see the DWARF file I can tell you more. If I can't, you will need to step through this code and see why this is triggering. The error message is telling you all you need to know to dump the problem. So for this error message:<br>
><br>
> error: biggrep_master_server_async 0x10b9a91a: DW_TAG_member '_M_pod_data' refers to type 0x10bb1e99 which extends beyond the bounds of 0x10b9a901<br>
><br>
> So if you dump the DWARF and look for the DIE at 0x10b9a91a, you will be able to see the DWARF that is causing the problem. On MacOSX, I would do this:<br>
><br>
> % dwarfdump --debug-info=0x10b9a91a --show-children --show-parents biggrep_master_server_async<br>
><br>
> llvm-dwarfdump will dump your entire file and you will need to look through a ton of DWARF in the output. You will need to search for "0x10b9a91a:" (the offset followed by a colon).<br>
><br>
> So LLDB believes it is pointing out an error in the DWARF that needs to be fixed in the compiler. It could be an incorrect error, but I would need to see the DWARF in question to know more. Debugging can happen just fine if you ignore this error, it is actually more of a warning, but we emit an error so users know to file a bug and hopefully get the compiler fixed.<br>
><br>
> Greg<br>
><br>
>> On Mar 26, 2016, at 5:10 PM, Jeffrey Tan via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> Sorry, sent to the wrong alias.<br>
>><br>
>> ---------- Forwarded message ----------<br>
>> From: Jeffrey Tan <<a href="mailto:jeffrey.fudan@gmail.com">jeffrey.fudan@gmail.com</a>><br>
>> Date: Sat, Mar 26, 2016 at 3:19 PM<br>
>> Subject: DW_TAG_member extends beyond the bounds error on Linux<br>
>> To: <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
>><br>
>><br>
>> Hi,<br>
>><br>
>> While dogfooding our lldb based IDE on Linux, I am seeing a lot of variable evaluation errors related to DW_TAG_member which prevents us from release the IDE. Can anyone help to confirm if they are known issues? If not, any information you need to troubleshoot this issue?<br>
>><br>
>> Here is one example:<br>
>><br>
>> (lldb) fr v<br>
>> error: biggrep_master_server_async 0x10b9a91a: DW_TAG_member '_M_pod_data' refers to type 0x10bb1e99 which extends beyond the bounds of 0x10b9a901<br>
>> error: biggrep_master_server_async 0x10b98edc: DW_TAG_member 'small_' refers to type 0x10bb1d9f which extends beyond the bounds of 0x10b98ed3<br>
>> error: biggrep_master_server_async 0x10baf034: DW_TAG_member '__size' refers to type 0x10baf04d which extends beyond the bounds of 0x10baefae<br>
>> (facebook::biggrep::BigGrepMasterAsync *) this = 0x00007fd14d374fd0<br>
>> (const string &const) corpus = error: summary string parsing error: {<br>
>>  store_ = {<br>
>>     = {<br>
>>      small_ = {}<br>
>>      ml_ = (data_ = "��UH\x89�H�}�H\x8bE�]ÐUH\x89�H��H\x89}�H\x8bE�H\x89��~\xb4��\x90��UH\x89�SH\x83�H\x89}�H�u�H�E�H���\x9e���H\x8b\x18H\x8bE�H���O\xb4��H\x89ƿ\b", size_ = 0, capacity_ = 1441151880758558720)<br>
>>    }<br>
>>  }<br>
>> }<br>
>> (const string &const) needle = error: summary string parsing error: {<br>
>>  store_ = {<br>
>>     = {<br>
>>      small_ = {}<br>
>>      ml_ = (data_ = "", size_ = 0, capacity_ = 1080863910568919040)<br>
>>    }<br>
>>  }<br>
>> }<br>
>> (facebook::biggrep::Options &) options = 0x00007fd133cfb7b0: {<br>
>>  engine = error: summary string parsing error<br>
>>  full_lines = true<br>
>>  user = error: summary string parsing error<br>
>>  max_bytes = 5000000<br>
>>  leading_context = 0<br>
>>  trailing_context = 0<br>
>>  case_sensitive = true<br>
>>  client_hostname = error: summary string parsing error<br>
>>  client_ip = error: summary string parsing error<br>
>>  skip_logging = false<br>
>>  client_port = 0<br>
>>  shards_override = 0<br>
>>  sample = false<br>
>>  count = false<br>
>>  filename_pattern = error: summary string parsing error<br>
>>  limit = 0<br>
>>  __isset = {<br>
>>    engine = true<br>
>>    full_lines = true<br>
>>    user = true<br>
>>    max_bytes = true<br>
>>    leading_context = true<br>
>>    trailing_context = true<br>
>>    case_sensitive = true<br>
>>    client_hostname = true<br>
>>    client_ip = true<br>
>>    skip_logging = true<br>
>>    client_port = true<br>
>>    shards_override = true<br>
>>    sample = true<br>
>>    count = true<br>
>>    filename_pattern = true<br>
>>    limit = true<br>
>>  }<br>
>> }<br>
>> (size_t) recv_timeout = 140536468041728<br>
>> (std::vector<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >, std::allocator<std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> > > >) corpuses = size=0 {}<br>
>> (std::vector<facebook::biggrep::BigGrepMasterAsync::Revision, std::allocator<facebook::biggrep::BigGrepMasterAsync::Revision> >) revisions = size=0 {}<br>
>> (std::vector<facebook::biggrep::BigGrepMasterAsync::RevisionShard, std::allocator<facebook::biggrep::BigGrepMasterAsync::RevisionShard> >) shards = size=0 {}<br>
>> (std::string) returnRev = error: summary string parsing error<br>
>> (<lambda(folly::StringPiece)>) quote = {}<br>
>> (std::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, std::fbstring_core<char> >) desc = {<br>
>>  store_ = {<br>
>>     = {<br>
>>      small_ = {}<br>
>>      ml_ = (data_ = "", size_ = 73415312, capacity_ = 140536494141696)<br>
>>    }<br>
>>  }<br>
>> }<br>
>> (folly::EventBase *) eb = 0x00007fd133cfb888<br>
>> (apache::thrift::concurrency::ThreadManager *) tm = 0x00007fd133cfb570<br>
>><br>
>> I suspect each one may be different root cause. I was able to capture one callstack of a small repro:<br>
>><br>
>> Breakpoint 1, DWARFASTParserClang::ParseChildMembers (this=0x8c4520, sc=..., parent_die=..., class_clang_type=..., class_language=lldb::eLanguageTypeUnknown,<br>
>>    base_classes=..., member_accessibilities=..., member_function_dies=..., delayed_properties=...,<br>
>>    default_accessibility=@0x7ffdf3888cac: lldb::eAccessPublic, is_a_class=@0x7ffdf3888cab: false, layout_info=...)<br>
>>    at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:2937<br>
>> 2937                                                                         parent_die.GetID());<br>
>> (gdb) bt<br>
>> #0  0x00007f103d02533d in DWARFASTParserClang::ParseChildMembers(lldb_private::SymbolContext const&, DWARFDIE const&, lldb_private::CompilerType&, lldb::LanguageType, std::vector<clang::CXXBaseSpecifier*, std::allocator<clang::CXXBaseSpecifier*> >&, std::vector<int, std::allocator<int> >&, DWARFDIECollection&, std::vector<DWARFASTParserClang::DelayedAddObjCClassProperty, std::allocator<DWARFASTParserClang::DelayedAddObjCClassProperty> >&, lldb::AccessType&, bool&, DWARFASTParserClang::LayoutInfo&) (this=0x8c4520, sc=..., parent_die=..., class_clang_type=..., class_language=lldb::eLanguageTypeUnknown, base_classes=..., member_accessibilities=..., member_function_dies=..., delayed_properties=..., default_accessibility=@0x7ffdf3888cac: lldb::eAccessPublic, is_a_class=@0x7ffdf3888cab: false, layout_info=...) at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:2937<br>
>> #1  0x00007f103d025b84 in DWARFASTParserClang::CompleteTypeFromDWARF(DWARFDIE const&, lldb_private::Type*, lldb_private::CompilerType&) (this=0x8c4520, die=..., type=0xc40a50, clang_type=...)<br>
>>    at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:2036<br>
>> #2  0x00007f103d04c5e8 in SymbolFileDWARF::CompleteType(lldb_private::CompilerType&) (this=<optimized out>, compiler_type=...)<br>
>>    at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:1635<br>
>> #3  0x00007f103ceff9da in lldb_private::ClangASTContext::CompleteTagDecl(void*, clang::TagDecl*) (baton=<optimized out>, decl=0xc41bc0)<br>
>>    at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp:9619<br>
>> #4  0x00007f103cf03400 in GetCompleteQualType(clang::ASTContext*, clang::QualType, bool) (ast=0x7f102c020c30, qual_type=..., allow_completion=allow_completion@entry=true) at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp:2632<br>
>> #5  0x00007f103cf0c99e in lldb_private::ClangASTContext::GetNumChildren(void*, bool) (this=0x8c43c0, type=<optimized out>, omit_empty_base_classes=<optimized out>) at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp:5067<br>
>> #6  0x00007f103ce876ad in lldb_private::ValueObjectVariable::CalculateNumChildren(unsigned int) (this=<optimized out>, max=4294967295)<br>
>>    at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Core/ValueObjectVariable.cpp:102<br>
>> #7  0x00007f103ce7759f in lldb_private::ValueObject::GetNumChildren(unsigned int) (this=0xc40600, max=4294967295)<br>
>>    at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Core/ValueObject.cpp:778<br>
>> #8  0x00007f103cd999bd in lldb_private::FormatManager::ShouldPrintAsOneLiner(lldb_private::ValueObject&) (this=this@entry=0x7f103fe2f300 <GetFormatManager()::g_format_manager>, valobj=...) at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/DataFormatters/FormatManager.cpp:576<br>
>> #9  0x00007f103cd9226a in lldb_private::DataVisualization::ShouldPrintAsOneLiner(lldb_private::ValueObject&) (valobj=...)<br>
>>    at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/DataFormatters/DataVisualization.cpp:42<br>
>> #10 0x00007f103cdc2167 in lldb_private::ValueObjectPrinter::PrintChildrenIfNeeded(bool, bool) (this=this@entry=0x7ffdf38892a0, value_printed=<optimized out>, summary_printed=<optimized out>) at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/DataFormatters/ValueObjectPrinter.cpp:869<br>
>> #11 0x00007f103cdc1572 in lldb_private::ValueObjectPrinter::PrintValueObject() (this=this@entry=0x7ffdf38892a0)<br>
>>    at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/DataFormatters/ValueObjectPrinter.cpp:111<br>
>> #12 0x00007f103ce7102f in lldb_private::ValueObject::Dump(lldb_private::Stream&, lldb_private::DumpValueObjectOptions const&) (this=this@entry=0xc40600, s=..., options=...) at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Core/ValueObject.cpp:3585<br>
>> #13 0x00007f103d27e5e4 in CommandObjectFrameVariable::DoExecute(lldb_private::Args&, lldb_private::CommandReturnObject&) (this=0x7d0590, command=..., result=...) at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Commands/CommandObjectFrame.cpp:591<br>
>> #14 0x00007f103cece45d in lldb_private::CommandObjectParsed::Execute(char const*, lldb_private::CommandReturnObject&) (this=0x7d0590, args_string=<optimized out>, result=...) at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Interpreter/CommandObject.cpp:1095<br>
>> #15 0x00007f103cec9559 in lldb_private::CommandInterpreter::HandleCommand(char const*, lldb_private::LazyBool, lldb_private::CommandReturnObject&, lldb_private::ExecutionContext*, bool, bool) (this=this@entry=0x7a5210, command_line=<optimized out>, lazy_add_to_history=lazy_add_to_history@entry=lldb_private::eLazyBoolCalculate, result=..., override_context=override_context@entry=0x0, repeat_on_empty_command=repeat_on_empty_command@entry=true, no_context_switching=false)<br>
>>    at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp:1820<br>
>> #16 0x00007f103ceca50d in lldb_private::CommandInterpreter::IOHandlerInputComplete(lldb_private::IOHandler&, std::string&) (this=0x7a5210, io_handler=..., line=...) at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp:2976<br>
>> #17 0x00007f103ce1c733 in lldb_private::IOHandlerEditline::Run() (this=0x87d9b0)<br>
>>    at /home/engshare/third-party2/lldb/3.8.0.rc3/src/llvm/tools/lldb/source/Core/IOHandler.cpp:736<br>
>><br>
>><br>
>> Really appreciate if there is any fix/workaround I can get over this issue and unblock us!<br>
>><br>
>> Jeffrey<br>
>><br>
>> _______________________________________________<br>
>> lldb-dev mailing list<br>
>> <a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
><br>
> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
<br>
</div></div></blockquote></div><br></div>