<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - LLDB crashes in expression evaluation (in codegen)"
href="https://bugs.llvm.org/show_bug.cgi?id=44331">44331</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>LLDB crashes in expression evaluation (in codegen)
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>release blocker
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>lldb-dev@lists.llvm.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jarin@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>jdevlieghere@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>LLDB crashes on expression evaluation. The program, the debug session and the
full stack trace are at the end of the bug report.
The crash reproduces on the current tip of tree
(541daa5e6b9bc38986e09612a9bd6f0f148fdfcf), a bisect points to one of the 10
revision following the revision below (the revision broke the LLDB build, the
build was fixed by 15695cd69c301a250b76ea5d36dcab4d3af055be, that revision is
the first one that crashes).
commit 457226e02a6e8533eaaa864a3fd7c8eeccd2bf58
Author: Richard Smith <<a href="mailto:richard-llvm@metafoo.co.uk">richard-llvm@metafoo.co.uk</a>>
Date: Mon Sep 23 03:48:44 2019 +0000
For P0784R7: add support for constexpr destructors, and call them as
appropriate during constant evaluation.
Note that the evaluator is sometimes invoked on incomplete expressions.
In such cases, if an object is constructed but we never reach the point
where it would be destroyed (and it has non-trivial destruction), we
treat the expression as having an unmodeled side-effect.
llvm-svn: 372538
--- Program ---
struct E {
int x;
};
struct D {
D(E &e) {}
D() {}
};
struct F {
int fi;
E e;
};
struct B {
D d;
};
struct C : B {
C(F *pf) : pf(pf) {}
int m() {
return 2; // Break here, eval pf->fi
}
F* pf;
int ci;
};
int main() {
F f;
C c(&f);
c.m();
return 0;
}
Compiled with clang++ -O0 -g a.cc
--- Debug session ---
(lldb) file a.out
Current executable set to 'a.out' (x86_64).
(lldb) b a.cc:23
Breakpoint 1: where = a.out`C::m() + 8 at a.cc:23:5, address = 0x...
(lldb) r
...
(lldb) p pf->fi
lldb: /llvm-project/llvm/../clang/include/clang/AST/DeclCXX.h:433:
clang::CXXRecordDecl::DefinitionData& clang::CXXRecordDecl::data() const:
Assertion `DD && "queried property of class with no definition"' failed.
--- Stack trace ---
(/lib/x86_64-linux-gnu/libc.so.6+0x2f542)
clang::CXXRecordDecl::data() const
/llvm/../clang/include/clang/AST/DeclCXX.h:434:13
clang::CXXRecordDecl::bases_begin() const
/llvm/../clang/include/clang/AST/DeclCXX.h:595:73
clang::CXXRecordDecl::bases_end() const
/llvm/../clang/include/clang/AST/DeclCXX.h:598:23
clang::CXXRecordDecl::bases() const
/llvm-project/clang/include/clang/AST/DeclCXX.h:591:12
isSafeToConvert(clang::RecordDecl const*, clang::CodeGen::CodeGenTypes&,
llvm::SmallPtrSet<clang::RecordDecl const*, 16u>&)
/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:137:37
isSafeToConvert(clang::QualType, clang::CodeGen::CodeGenTypes&,
llvm::SmallPtrSet<clang::RecordDecl const*, 16u>&)
/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:165:62
isSafeToConvert(clang::RecordDecl const*, clang::CodeGen::CodeGenTypes&,
llvm::SmallPtrSet<clang::RecordDecl const*, 16u>&)
/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:146:9
isSafeToConvert(clang::RecordDecl const*, clang::CodeGen::CodeGenTypes&)
/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:186:25
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(clang::RecordDecl const*)
(.localalias.0) /llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:733:7
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) (.localalias.1)
/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:388:47
clang::CodeGen::CodeGenTypes::ConvertTypeForMem(clang::QualType)
/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:87:30
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) (.localalias.1)
/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:560:48
clang::CodeGen::CodeGenTypes::ConvertTypeForMem(clang::QualType)
/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:87:30
(anonymous namespace)::CGRecordLowering::getStorageType(clang::FieldDecl
const*) /llvm-project/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp:135:47
(anonymous namespace)::CGRecordLowering::accumulateFields()
/llvm-project/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp:357:25
(anonymous namespace)::CGRecordLowering::lower(bool)
/llvm-project/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp:268:7
clang::CodeGen::CodeGenTypes::ComputeRecordLayout(clang::RecordDecl const*,
llvm::StructType*)
/llvm-project/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp:739:21
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(clang::RecordDecl const*)
(.localalias.0) /llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:752:47
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) (.localalias.1)
/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:388:47
clang::CodeGen::CodeGenTypes::ConvertTypeForMem(clang::QualType)
/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:87:30
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) (.localalias.1)
/llvm-project/clang/lib/CodeGen/CodeGenTypes.cpp:560:48
(anonymous namespace)::X86_64ABIInfo::classifyArgumentType(clang::QualType,
unsigned int, unsigned int&, unsigned int&, bool) const
/llvm-project/clang/lib/CodeGen/TargetInfo.cpp:3474:37
(anonymous
namespace)::X86_64ABIInfo::computeInfo(clang::CodeGen::CGFunctionInfo&) const
/llvm-project/clang/lib/CodeGen/TargetInfo.cpp:3672:60
clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(clang::CanQual<clang::Type>,
bool, bool, llvm::ArrayRef<clang::CanQual<clang::Type> >,
clang::FunctionType::ExtInfo,
llvm::ArrayRef<clang::FunctionType::ExtParameterInfo>,
clang::CodeGen::RequiredArgs) /llvm-project/clang/lib/CodeGen/CGCall.cpp:782:43
arrangeLLVMFunctionInfo(clang::CodeGen::CodeGenTypes&, bool,
llvm::SmallVectorImpl<clang::CanQual<clang::Type> >&,
clang::CanQual<clang::FunctionProtoType>)
/llvm-project/clang/lib/CodeGen/CGCall.cpp:188:46
clang::CodeGen::CodeGenTypes::arrangeCXXMethodType(clang::CXXRecordDecl const*,
clang::FunctionProtoType const*, clang::CXXMethodDecl const*)
/llvm-project/clang/lib/CodeGen/CGCall.cpp:261:68
clang::CodeGen::CodeGenTypes::arrangeCXXMethodDeclaration(clang::CXXMethodDecl
const*) /llvm-project/clang/lib/CodeGen/CGCall.cpp:290:69
clang::CodeGen::CodeGenTypes::arrangeFunctionDeclaration(clang::FunctionDecl
const*) /llvm-project/clang/lib/CodeGen/CGCall.cpp:437:44
clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(clang::GlobalDecl)
/llvm-project/clang/lib/CodeGen/CGCall.cpp:522:1
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) /llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:4427:68
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) /llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2837:28
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2549:5
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.localalias.1)
/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:5263:37
(anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
/llvm-project/clang/lib/CodeGen/ModuleBuilder.cpp:169:7
lldb_private::ASTResultSynthesizer::HandleTopLevelDecl(clang::DeclGroupRef)
/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp:110:47
lldb_private::ASTConsumerForwarder::HandleTopLevelDecl(clang::DeclGroupRef)
/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h:152:3
clang::ParseAST(clang::Sema&, bool, bool)
/llvm-project/clang/lib/Parse/ParseAST.cpp:162:20
lldb_private::ClangExpressionParser::ParseInternal(lldb_private::DiagnosticManager&,
clang::CodeCompleteConsumer*, unsigned int, unsigned int)
/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:1013:31
lldb_private::ClangExpressionParser::Parse(lldb_private::DiagnosticManager&)
/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:873:1
lldb_private::ClangUserExpression::Parse(lldb_private::DiagnosticManager&,
lldb_private::ExecutionContext&, lldb_private::ExecutionPolicy, bool, bool)
/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp:608:37
lldb_private::UserExpression::Evaluate(lldb_private::ExecutionContext&,
lldb_private::EvaluateExpressionOptions const&, llvm::StringRef,
llvm::StringRef, lldb_private::SharingPtr<lldb_private::ValueObject>&,
lldb_private::Status&, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, std::shared_ptr<lldb_private::Module>*,
lldb_private::ValueObject*)
/llvm-project/lldb/source/Expression/UserExpression.cpp:251:32
lldb_private::Target::EvaluateExpression(llvm::StringRef,
lldb_private::ExecutionContextScope*,
lldb_private::SharingPtr<lldb_private::ValueObject>&,
lldb_private::EvaluateExpressionOptions const&,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
<span class="quote">>*, lldb_private::ValueObject*)</span >
/llvm-project/lldb/source/Target/Target.cpp:2372:33
lldb_private::CommandObjectExpression::EvaluateExpression(llvm::StringRef,
lldb_private::Stream*, lldb_private::Stream*,
lldb_private::CommandReturnObject*)
/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:414:57
lldb_private::CommandObjectExpression::DoExecute(llvm::StringRef,
lldb_private::CommandReturnObject&)
/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:646:3
lldb_private::CommandObjectRaw::Execute(char const*,
lldb_private::CommandReturnObject&)
/llvm-project/lldb/source/Interpreter/CommandObject.cpp:1003:26
lldb_private::CommandInterpreter::HandleCommand(char const*,
lldb_private::LazyBool, lldb_private::CommandReturnObject&,
lldb_private::ExecutionContext*, bool, bool)
/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:1748:17
lldb_private::CommandInterpreter::IOHandlerInputComplete(lldb_private::IOHandler&,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
<span class="quote">>&) /llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2760:16</span >
lldb_private::IOHandlerEditline::Run()
/llvm-project/lldb/source/Core/IOHandler.cpp:548:44
lldb_private::Debugger::RunIOHandler(std::shared_ptr<lldb_private::IOHandler>
const&) /llvm-project/lldb/source/Core/Debugger.cpp:951:26
lldb_private::CommandInterpreter::HandleCommandsFromFile(lldb_private::FileSpec&,
lldb_private::ExecutionContext*, lldb_private::CommandInterpreterRunOptions&,
lldb_private::CommandReturnObject&)
/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2481:36
CommandObjectCommandsSource::DoExecute(lldb_private::Args&,
lldb_private::CommandReturnObject&)
/llvm-project/lldb/source/Commands/CommandObjectCommands.cpp:313:43
lldb_private::CommandObjectParsed::Execute(char const*,
lldb_private::CommandReturnObject&)
/llvm-project/lldb/source/Interpreter/CommandObject.cpp:981:28
lldb_private::CommandInterpreter::HandleCommand(char const*,
lldb_private::LazyBool, lldb_private::CommandReturnObject&,
lldb_private::ExecutionContext*, bool, bool)
/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:1748:17
lldb_private::CommandInterpreter::IOHandlerInputComplete(lldb_private::IOHandler&,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
<span class="quote">>&) /llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2760:16</span >
lldb_private::IOHandlerEditline::Run()
/llvm-project/lldb/source/Core/IOHandler.cpp:548:44
lldb_private::Debugger::ExecuteIOHandlers()
/llvm-project/lldb/source/Core/Debugger.cpp:907:60
lldb_private::CommandInterpreter::RunCommandInterpreter(bool, bool,
lldb_private::CommandInterpreterRunOptions&)
/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2956:5
lldb::SBDebugger::RunCommandInterpreter(bool, bool,
lldb::SBCommandInterpreterRunOptions&, int&, bool&, bool&)
/llvm-project/lldb/source/API/SBDebugger.cpp:1179:37
Driver::MainLoop() /llvm-project/lldb/tools/driver/Driver.cpp:613:39
main /llvm-project/lldb/tools/driver/Driver.cpp:890:34
__libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2352b)
_start (../build-debug/bin/lldb+0x142ba)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>