[lldb-dev] Can any expression parser experts or clang AST experts help with this issue?

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Wed Aug 29 16:24:39 PDT 2018


This bug reproduces for me every time using the Debug+Asserts build. In clang I build top of tree clang and just debug the "bin/clang" that was produced by stopped at main. 

$ ./lldb/build/DebugClang/lldb bin/clang
(lldb) target create "bin/clang"
Current executable set to 'bin/clang' (x86_64).
(lldb) b main
(lldb) r
(lldb) p errs() << "foo\n"
Assertion failed: ((data().DefaultedCopyConstructorIsDeleted || needsOverloadResolutionForCopyConstructor()) && "Copy constructor should not be deleted"), function setImplicitCopyConstructorIsDeleted, file /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/include/clang/AST/DeclCXX.h, line 1075.


In another window I attach to this LLDB and caught the abort:

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.3
  * frame #0: 0x00007fff6854c12f libsystem_c.dylib`abort
    frame #1: 0x00007fff685141ac libsystem_c.dylib`__assert_rtn + 320
    frame #2: 0x0000000113e581bf LLDB`clang::CXXRecordDecl::setImplicitCopyConstructorIsDeleted(this=0x00007fab911fcd08) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/include/clang/AST/DeclCXX.h:1073
    frame #3: 0x0000000113e403ec LLDB`clang::Sema::DeclareImplicitCopyConstructor(this=0x00007fab8e79ca00, ClassDecl=0x00007fab911fcd08) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp:12426
    frame #4: 0x0000000114224bb6 LLDB`clang::Sema::LookupConstructors(this=0x00007fab8e79ca00, Class=0x00007fab911fcd08) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaLookup.cpp:3098
    frame #5: 0x000000011435fb1f LLDB`IsUserDefinedConversion(S=0x00007fab8e79ca00, From=0x00007fab8f4a4818, ToType=QualType @ 0x00007ffeee9b7b00, User=0x00007ffeee9b9840, CandidateSet=0x00007ffeee9b7c80, AllowExplicit=false, AllowObjCConversionOnExplicit=false) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaOverload.cpp:3338
    frame #6: 0x000000011439046b LLDB`TryUserDefinedConversion(S=0x00007fab8e79ca00, From=0x00007fab8f4a4818, ToType=QualType @ 0x00007ffeee9b7c78, SuppressUserConversions=false, AllowExplicit=false, InOverloadResolution=false, CStyle=false, AllowObjCWritebackConversion=false, AllowObjCConversionOnExplicit=false) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaOverload.cpp:1245
    frame #7: 0x00000001143596ad LLDB`TryImplicitConversion(S=0x00007fab8e79ca00, From=0x00007fab8f4a4818, ToType=QualType @ 0x00007ffeee9b9760, SuppressUserConversions=false, AllowExplicit=false, InOverloadResolution=false, CStyle=false, AllowObjCWritebackConversion=false, AllowObjCConversionOnExplicit=false) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaOverload.cpp:1377
    frame #8: 0x0000000114394f07 LLDB`TryReferenceInit(S=0x00007fab8e79ca00, Init=0x00007fab8f4a4818, DeclType=QualType @ 0x00007ffeee9b9a00, DeclLoc=(ID = 1670), SuppressUserConversions=false, AllowExplicit=false) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaOverload.cpp:4684
    frame #9: 0x000000011436829d LLDB`TryCopyInitialization(S=0x00007fab8e79ca00, From=0x00007fab8f4a4818, ToType=QualType @ 0x00007ffeee9b9ac0, SuppressUserConversions=false, InOverloadResolution=true, AllowObjCWritebackConversion=false, AllowExplicit=false) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaOverload.cpp:5006
    frame #10: 0x0000000114366faf LLDB`clang::Sema::AddOverloadCandidate(this=0x00007fab8e79ca00, Function=0x00007fab8fe02b00, FoundDecl=(Ptr = 0x00007fab8fe02b03), Args=ArrayRef<clang::Expr *> @ 0x00007ffeee9b9e40, CandidateSet=0x00007ffeee9ba940, SuppressUserConversions=false, PartialOverloading=false, AllowExplicit=false, EarlyConversions=clang::ConversionSequenceList @ 0x00007ffeee9b9ea8) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaOverload.cpp:6088
    frame #11: 0x00000001143758a1 LLDB`clang::Sema::AddArgumentDependentLookupCandidates(this=0x00007fab8e79ca00, Name=(Ptr = 0x00007fab8e794ba3), Loc=(ID = 1667), Args=ArrayRef<clang::Expr *> @ 0x00007ffeee9ba010, ExplicitTemplateArgs=0x0000000000000000, CandidateSet=0x00007ffeee9ba940, PartialOverloading=false) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaOverload.cpp:8911
    frame #12: 0x00000001143849d4 LLDB`clang::Sema::CreateOverloadedBinOp(this=0x00007fab8e79ca00, OpLoc=(ID = 1667), Opc=BO_Shl, Fns=0x00007ffeee9bc328, LHS=0x0000000000000000, RHS=0x0000000000000000, PerformADL=true) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaOverload.cpp:12390
    frame #13: 0x0000000113fce864 LLDB`BuildOverloadedBinOp(S=0x00007fab8e79ca00, Sc=0x00007faba6021ac0, OpLoc=(ID = 1667), Opc=BO_Shl, LHS=0x00007fab8f4a4770, RHS=0x00007fab8f4a4818) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaExpr.cpp:12471
    frame #14: 0x0000000113fce62a LLDB`clang::Sema::BuildBinOp(this=0x00007fab8e79ca00, S=0x00007faba6021ac0, OpLoc=(ID = 1667), Opc=BO_Shl, LHSExpr=0x00007fab8f4a4770, RHSExpr=0x00007fab8f4a4818) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaExpr.cpp:12573
    frame #15: 0x0000000113f92b4a LLDB`clang::Sema::ActOnBinOp(this=0x00007fab8e79ca00, S=0x00007faba6021ac0, TokLoc=(ID = 1667), Kind=lessless, LHSExpr=0x00007fab8f4a4770, RHSExpr=0x00007fab8f4a4818) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Sema/SemaExpr.cpp:12436
    frame #16: 0x00000001124f9010 LLDB`clang::Parser::ParseRHSOfBinaryExpression(this=0x00007fab8e7a3200, LHS=(PtrWithInvalid = 0x00007fab8f4a4770), MinPrec=Assignment) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/ParseExpr.cpp:504
    frame #17: 0x00000001124f73b1 LLDB`clang::Parser::ParseAssignmentExpression(this=0x00007fab8e7a3200, isTypeCast=NotTypeCast) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/ParseExpr.cpp:175
    frame #18: 0x00000001124f726f LLDB`clang::Parser::ParseExpression(this=0x00007fab8e7a3200, isTypeCast=NotTypeCast) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/ParseExpr.cpp:124
    frame #19: 0x000000011257731b LLDB`clang::Parser::ParseExprStatement(this=0x00007fab8e7a3200) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/ParseStmt.cpp:418
    frame #20: 0x000000011257580f LLDB`clang::Parser::ParseStatementOrDeclarationAfterAttributes(this=0x00007fab8e7a3200, Stmts=0x00007ffeee9bdc70, Allowed=ACK_Any, TrailingElseLoc=0x0000000000000000, Attrs=0x00007ffeee9bd928) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/ParseStmt.cpp:224
    frame #21: 0x0000000112574e40 LLDB`clang::Parser::ParseStatementOrDeclaration(this=0x00007fab8e7a3200, Stmts=0x00007ffeee9bdc70, Allowed=ACK_Any, TrailingElseLoc=0x0000000000000000) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/ParseStmt.cpp:110
    frame #22: 0x000000011257d82d LLDB`clang::Parser::ParseCompoundStatementBody(this=0x00007fab8e7a3200, isStmtExpr=false) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/ParseStmt.cpp:997
    frame #23: 0x000000011257e5b9 LLDB`clang::Parser::ParseFunctionStatementBody(this=0x00007fab8e7a3200, Decl=0x00007fab8e7b5ec0, BodyScope=0x00007ffeee9be140) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1971
    frame #24: 0x00000001125a4368 LLDB`clang::Parser::ParseFunctionDefinition(this=0x00007fab8e7a3200, D=0x00007ffeee9be788, TemplateInfo=0x00007ffeee9be5e0, LateParsedAttrs=0x00007ffeee9be6e8) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/Parser.cpp:1246
    frame #25: 0x00000001124b12e3 LLDB`clang::Parser::ParseDeclGroup(this=0x00007fab8e7a3200, DS=0x00007ffeee9bf0a0, Context=FileContext, DeclEnd=0x0000000000000000, FRI=0x0000000000000000) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1968
    frame #26: 0x00000001125a2e93 LLDB`clang::Parser::ParseDeclOrFunctionDefInternal(this=0x00007fab8e7a3200, attrs=0x00007ffeee9bf6b0, DS=0x00007ffeee9bf0a0, AS=AS_none) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/Parser.cpp:1015
    frame #27: 0x00000001125a2420 LLDB`clang::Parser::ParseDeclarationOrFunctionDefinition(this=0x00007fab8e7a3200, attrs=0x00007ffeee9bf6b0, DS=0x0000000000000000, AS=AS_none) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/Parser.cpp:1031
    frame #28: 0x00000001125a0f88 LLDB`clang::Parser::ParseExternalDeclaration(this=0x00007fab8e7a3200, attrs=0x00007ffeee9bf6b0, DS=0x0000000000000000) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/Parser.cpp:856
    frame #29: 0x000000011259f986 LLDB`clang::Parser::ParseTopLevelDecl(this=0x00007fab8e7a3200, Result=0x00007ffeee9bf800) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/Parser.cpp:610
    frame #30: 0x000000011248b844 LLDB`clang::ParseAST(S=0x00007fab8e79ca00, PrintStats=false, SkipFunctionBodies=false) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/ParseAST.cpp:158
    frame #31: 0x000000011248b32f LLDB`clang::ParseAST(PP=0x00007fab8e758818, Consumer=0x00007faba601dbc0, Ctx=0x00007fab8e790800, PrintStats=false, TUKind=TU_Complete, CompletionConsumer=0x0000000000000000, SkipFunctionBodies=false) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/llvm/tools/clang/lib/Parse/ParseAST.cpp:111
    frame #32: 0x0000000114def593 LLDB`lldb_private::ClangExpressionParser::Parse(this=0x00007ffeee9c0b80, diagnostic_manager=0x00007ffeee9c16f0) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:610
    frame #33: 0x0000000114e08479 LLDB`lldb_private::ClangUserExpression::Parse(this=0x00007faba53a6280, diagnostic_manager=0x00007ffeee9c16f0, exe_ctx=0x00007ffeee9c2520, execution_policy=eExecutionPolicyOnlyWhenNeeded, keep_result_in_memory=true, generate_debug_info=false) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp:495
    frame #34: 0x0000000115393045 LLDB`lldb_private::UserExpression::Evaluate(exe_ctx=0x00007ffeee9c2520, options=0x00007ffeee9c2c50, expr=<17>: "errs() << \"foo\\n\"", prefix=<0>: "", result_valobj_sp=0x00007ffeee9c2960, error=0x00007ffeee9c24a0, line_offset=0x00000000, fixed_expression="", jit_module_sp_ptr=0x0000000000000000) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/Expression/UserExpression.cpp:237
    frame #35: 0x00000001156448f9 LLDB`lldb_private::Target::EvaluateExpression(this=0x00007fab9e809400, expr=<17>: "errs() << \"foo\\n\"", exe_scope=0x00007faba30de820, result_valobj_sp=0x00007ffeee9c2960, options=0x00007ffeee9c2c50, fixed_expression="") at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/Target/Target.cpp:2328
    frame #36: 0x00000001149343a5 LLDB`lldb_private::CommandObjectExpression::EvaluateExpression(this=0x00007fab9be38bd0, expr=<17>: "errs() << \"foo\\n\"", output_stream=0x00007ffeee9c5650, error_stream=0x00007ffeee9c56f8, result=0x00007ffeee9c5650) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/Commands/CommandObjectExpression.cpp:377
    frame #37: 0x0000000114936e6e LLDB`lldb_private::CommandObjectExpression::DoExecute(this=0x00007fab9be38bd0, command=<20>: "-- errs() << \"foo\\n\"", result=0x00007ffeee9c5650) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/Commands/CommandObjectExpression.cpp:594
    frame #38: 0x0000000114fcbf76 LLDB`lldb_private::CommandObjectRaw::Execute(this=0x00007fab9be38bd0, args_string="-- errs() << \"foo\\n\"", result=0x00007ffeee9c5650) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/Interpreter/CommandObject.cpp:1000
    frame #39: 0x0000000114f8317b LLDB`lldb_private::CommandInterpreter::HandleCommand(this=0x00007fab9be309a0, command_line="p errs() << \"foo\\n\"", lazy_add_to_history=eLazyBoolCalculate, result=0x00007ffeee9c5650, override_context=0x0000000000000000, repeat_on_empty_command=true, no_context_switching=false) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/Interpreter/CommandInterpreter.cpp:1695
    frame #40: 0x0000000114f8f62d LLDB`lldb_private::CommandInterpreter::IOHandlerInputComplete(this=0x00007fab9be309a0, io_handler=0x00007fab9d911110, line="p errs() << \"foo\\n\"") at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/Interpreter/CommandInterpreter.cpp:2696
    frame #41: 0x0000000115027b02 LLDB`lldb_private::IOHandlerEditline::Run(this=0x00007fab9d911110) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/Core/IOHandler.cpp:566
    frame #42: 0x0000000114ae5012 LLDB`lldb_private::Debugger::ExecuteIOHandlers(this=0x00007fab9be301f0) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/Core/Debugger.cpp:976
    frame #43: 0x0000000114f90d7f LLDB`lldb_private::CommandInterpreter::RunCommandInterpreter(this=0x00007fab9be309a0, auto_handle_events=true, spawn_thread=false, options=0x00007ffeee9c5ba0) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/Interpreter/CommandInterpreter.cpp:2896
    frame #44: 0x000000010d7c31d6 LLDB`lldb::SBDebugger::RunCommandInterpreter(this=0x00007ffeee9c65b0, auto_handle_events=true, spawn_thread=false) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/source/API/SBDebugger.cpp:923
    frame #45: 0x00000001012437c2 lldb`Driver::MainLoop(this=0x00007ffeee9c6590) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/tools/driver/Driver.cpp:1162
    frame #46: 0x00000001012440ab lldb`main(argc=2, argv=0x00007ffeee9c6768) at /Users/gclayton/Documents/src/lldb/svn/clean/lldb/tools/driver/Driver.cpp:1267
    frame #47: 0x00007fff684a0015 libdyld.dylib`start + 1
    frame #48: 0x00007fff684a0015 libdyld.dylib`start + 1




More information about the lldb-dev mailing list