[lldb-dev] [Bug 50054] New: getASTRecordLayout called before that type's base classes are saved

2021-04-21 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=50054

Bug ID: 50054
   Summary: getASTRecordLayout called before that type's base
classes are saved
   Product: lldb
   Version: unspecified
  Hardware: PC
OS: Windows NT
Status: NEW
  Severity: normal
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: emrekultur...@google.com
CC: jdevliegh...@apple.com, llvm-b...@lists.llvm.org

Created attachment 24776
  --> https://bugs.llvm.org/attachment.cgi?id=24776&action=edit
Full stack trace

This is a case where LLDB calls `Context.getASTRecordLayout(...)` for a class
BEFORE the `CXXRecordDecl::setBases()` for that same class.

As a result, `getASTRecordLayout()` computes and caches an layout without any
base classes, and subsequent calls use that cached, incorrect result. 

This causes a segfault in LLDB due to downstream accesses using FieldNo values
that do not exist in ASTRecordLayout.

I can only reproduce this by attaching to a binary that a customer provided,
and I cannot share that publicly here. However, I hope maybe some LLDB experts
here might be able to guide/help by looking at the stack trace here.

* Topmost frame: Computes and saves the ASTRecordLayout for the problematic
class without any base class information.
* Frame with asterisk(*): Has not processed/saved the base classes for that
same class yet.


>   clang::ASTContext::getASTRecordLayout Line 3339 
`anonymous namespace'::EmptySubobjectMap::ComputeEmptySubobjectSizes
Line 203   
`anonymous namespace'::EmptySubobjectMap::EmptySubobjectMap Line 179
clang::ASTContext::getASTRecordLayout Line 3377 
`anonymous namespace'::EmptySubobjectMap::ComputeEmptySubobjectSizes
Line 203   
`anonymous namespace'::EmptySubobjectMap::EmptySubobjectMap Line 179
clang::ASTContext::getASTRecordLayout Line 3377 
`anonymous namespace'::EmptySubobjectMap::ComputeEmptySubobjectSizes
Line 203   
`anonymous namespace'::EmptySubobjectMap::EmptySubobjectMap Line 179
clang::ASTContext::getASTRecordLayout Line 3377 
`anonymous namespace'::EmptySubobjectMap::ComputeEmptySubobjectSizes
Line 203   
`anonymous namespace'::EmptySubobjectMap::EmptySubobjectMap Line 179
clang::ASTContext::getASTRecordLayout Line 3377 
`anonymous namespace'::EmptySubobjectMap::ComputeEmptySubobjectSizes
Line 203   
`anonymous namespace'::EmptySubobjectMap::EmptySubobjectMap Line 179
clang::ASTContext::getASTRecordLayout Line 3377 
`anonymous namespace'::EmptySubobjectMap::ComputeEmptySubobjectSizes
Line 203   
`anonymous namespace'::EmptySubobjectMap::EmptySubobjectMap Line 179
clang::ASTContext::getASTRecordLayout Line 3377 
clang::ASTContext::getTypeInfoImpl Line 2258
clang::ASTContext::getTypeInfo Line 1879
clang::ASTContext::getTypeInfo Line 2116
clang::ASTContext::getTypeSize Line 2122
lldb_private::TypeSystemClang::GetBitSize Line 4588 
lldb_private::CompilerType::GetBitSize Line 484 
lldb_private::CompilerType::GetByteSize Line 490
DWARFASTParserClang::ParseSingleMember Line 2680
DWARFASTParserClang::ParseChildMembers Line 2801
DWARFASTParserClang::CompleteRecordType Line 2002   
DWARFASTParserClang::CompleteTypeFromDWARF Line 2126
...
DWARFASTParserClang::ParseChildMembers Line 2888
DWARFASTParserClang::CompleteRecordType Line 2002   
DWARFASTParserClang::CompleteTypeFromDWARF Line 2126
...
DWARFASTParserClang::ParsePointerToMemberType Line 1362 
DWARFASTParserClang::ParseTypeFromDWARF Line 530
...
DWARFASTParserClang::ParseChildParameters Line 3014 
DWARFASTParserClang::ParseSubroutine Line 942   
DWARFASTParserClang::ParseTypeFromDWARF Line 522
...
DWARFASTParserClang::CompleteRecordType Line 2003   
DWARFASTParserClang::CompleteTypeFromDWARF Line 2126
...
DWARFASTParserClang::ParseSingleMember Line 2562
DWARFASTParserClang::ParseChildMembers Line 2801
DWARFASTParserClang::CompleteRecordType Line 2002   
DWARFASTParserClang::CompleteTypeFromDWARF Line 2126
...
DWARFASTParserClang::ParsePointerToMemberType Line 1362 
DWARFASTParserClang::ParseTypeFromDWARF Line 530
...
DWARFASTParserClang::ParseChildParameters Line 3014 
DWARFASTParserClang::ParseSubroutine Line 942   
DWARFASTParserClang::ParseTypeFromDWARF Line 522
...
DWARFASTParserClang::CompleteRecordType Line 2003   
DWARFASTParser

[lldb-dev] [Bug 50056] New: Segmention faults with empty call trace when debugging some coredump files

2021-04-21 Thread via lldb-dev
https://bugs.llvm.org/show_bug.cgi?id=50056

Bug ID: 50056
   Summary: Segmention faults with empty call trace when debugging
some coredump files
   Product: lldb
   Version: 11.0
  Hardware: PC
OS: Linux
Status: NEW
  Severity: normal
  Priority: P
 Component: All Bugs
  Assignee: lldb-dev@lists.llvm.org
  Reporter: sisu...@protonmail.com
CC: jdevliegh...@apple.com, llvm-b...@lists.llvm.org

1. Open a coredump file(terminated by SIGABRT)
2. Type 'run' then 'y'
3. Segfault(with an empty call trace)

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev