[lldb-dev] [Bug 51031] New: MapImported: Assertion `(Pos == ImportedDecls.end() || Pos->second == To) && "Try to import an already imported Decl"' failed.

via lldb-dev lldb-dev at lists.llvm.org
Thu Jul 8 14:08:44 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51031

            Bug ID: 51031
           Summary: MapImported: Assertion `(Pos == ImportedDecls.end() ||
                    Pos->second == To) && "Try to import an already
                    imported Decl"' failed.
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: peeter.joot at lzlabs.com
                CC: jdevlieghere at apple.com, llvm-bugs at lists.llvm.org

attempting to drill into some global variable state:

lhe.h  extern SYSBLK *sysblk;
sysblk.c  SYSBLK *sysblk;

I hit the following MapImported assertion:

(lldb) p &sysblk->regs[0]
lldb: /home/pjoot/chirag/llvm-project/clang/lib/AST/ASTImporter.cpp:9444:
clang::Decl* clang::ASTImporter::MapImported(clang::Decl*, clang::Decl*):
Assertion `(Pos == ImportedDecls.end() || Pos->second == To) && "Try to import
an already imported Decl"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.      Program arguments: /opt/lzlabs/lldb/bin/lldb -o "b main" -o "settings
set target.hide-invalid-legacy-frames false" -o "b rc_pli_enter_module" -o "b
LAE_dump" -o "b print_message" -o "b rc_pli_fatal_error" -o "b
__lz_runtime_init" -o "b __lz_runtime_term" --source
/opt/lzlabs/debug/lldb/macros/myLLDBinit -o "settings set target.charset
ibm-1047" -o "settings append target.source-map
/home/markus/git/raincode/RComp/installers/rpm/rpmbuild/BUILD/lz-sdm-compilers/llvm/runtime/src
/home/pjoot/rpmbuild/BUILD/lz-sdm-compilers/llvm/runtime/src" -o "settings
append target.source-map
/home/markus/git/raincode/RComp/installers/rpm/rpmbuild/BUILD/lz-sdm-compilers/llvm/runtime
/home/pjoot/rpmbuild/BUILD/lz-sdm-compilers/llvm/runtime" -o "settings append
target.source-map
/home/markus/git/raincode/lzlabs/RComp/installers/rpm/rpmbuild/BUILD/lz-sdm-compilers/llvm/runtime
/home/pjoot/rpmbuild/BUILD/lz-sdm-compilers/llvm/runtime" /usr/bin/lz_batch --
--debug -j tmp/jcl8553E.jcl
1.      HandleCommand(command = "p &sysblk->regs[0]")
2.      <user expression 24>:2:1: current parser token ';'
3.      <lldb wrapper prefix>:21162:1: parsing function body '$__lldb_expr'
4.      <lldb wrapper prefix>:21162:1: in compound statement ('{}')
 #0 0x00007f2bb184747c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/opt/lzlabs/lldb/lib64/libLLVMSupport.so.13git+0x19647c)
 #1 0x00007f2bb1845474 llvm::sys::RunSignalHandlers()
(/opt/lzlabs/lldb/lib64/libLLVMSupport.so.13git+0x194474)
 #2 0x00007f2bb1845c0d SignalHandler(int)
(/opt/lzlabs/lldb/lib64/libLLVMSupport.so.13git+0x194c0d)
 #3 0x00007f2bb2e7bb20 __restore_rt sigaction.c:0:0
 #4 0x00007f2bb09f437f raise (/lib64/libc.so.6+0x3737f)
 #5 0x00007f2bb09dedb5 abort (/lib64/libc.so.6+0x21db5)
 #6 0x00007f2bb09dec89 _nl_load_domain.cold.0 loadmsgcat.c:0:0
 #7 0x00007f2bb09eca76 .annobin___GI___assert_fail.end assert.c:0:0
 #8 0x00007f2ba9414150 clang::ASTImporter::MapImported(clang::Decl*,
clang::Decl*) (/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x1d8150)
 #9 0x00007f2ba9436a2a
clang::ASTNodeImporter::VisitTypedefNameDecl(clang::TypedefNameDecl*, bool)
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x1faa2a)
#10 0x00007f2ba9455b4a clang::declvisitor::Base<std::add_pointer,
clang::ASTNodeImporter, llvm::Expected<clang::Decl*> >::Visit(clang::Decl*)
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x219b4a)
#11 0x00007f2ba9455cb7 clang::ASTImporter::ImportImpl(clang::Decl*)
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x219cb7)
#12 0x00007f2bb26e392c
lldb_private::ClangASTImporter::ASTImporterDelegate::ImportImpl(clang::Decl*)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xc1992c)
#13 0x00007f2ba94175f3 clang::ASTImporter::Import(clang::Decl*)
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x1db5f3)
#14 0x00007f2ba941a654
clang::ASTNodeImporter::VisitTypedefType(clang::TypedefType const*)
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x1de654)
#15 0x00007f2ba9420235 clang::TypeVisitor<clang::ASTNodeImporter,
llvm::Expected<clang::QualType> >::Visit(clang::Type const*)
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x1e4235)
#16 0x00007f2ba9420447 clang::ASTImporter::Import(clang::Type const*)
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x1e4447)
#17 0x00007f2ba94206b7 clang::ASTImporter::Import(clang::QualType)
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x1e46b7)
#18 0x00007f2ba942dbf0
clang::ASTNodeImporter::VisitFunctionProtoType(clang::FunctionProtoType const*)
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x1f1bf0)
#19 0x00007f2ba9420215 clang::TypeVisitor<clang::ASTNodeImporter,
llvm::Expected<clang::QualType> >::Visit(clang::Type const*)
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x1e4215)
#20 0x00007f2ba9420447 clang::ASTImporter::Import(clang::Type const*)
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x1e4447)
#21 0x00007f2ba94206b7 clang::ASTImporter::Import(clang::QualType)
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x1e46b7)
#22 0x00007f2bb26dea10
lldb_private::ClangASTImporter::CopyType(lldb_private::TypeSystemClang&,
lldb_private::CompilerType const&)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xc14a10)
#23 0x00007f2bb26e5757
lldb_private::ClangASTSource::GuardedCopyType(lldb_private::CompilerType
const&) (/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xc1b757)
#24 0x00007f2bb270c928
lldb_private::ClangExpressionDeclMap::SearchFunctionsInSymbolContexts(lldb_private::SymbolContextList
const&, lldb_private::CompilerDeclContext const&)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xc42928)
#25 0x00007f2bb2714551
lldb_private::ClangExpressionDeclMap::LookupFunction(lldb_private::NameSearchContext&,
std::shared_ptr<lldb_private::Module>, lldb_private::ConstString,
lldb_private::CompilerDeclContext const&)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xc4a551)
#26 0x00007f2bb2714898
lldb_private::ClangExpressionDeclMap::FindExternalVisibleDecls(lldb_private::NameSearchContext&,
std::shared_ptr<lldb_private::Module>, lldb_private::CompilerDeclContext
const&) (/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xc4a898)
#27 0x00007f2bb27155aa
lldb_private::ClangExpressionDeclMap::FindExternalVisibleDecls(lldb_private::NameSearchContext&)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xc4b5aa)
#28 0x00007f2bb26eeff7
lldb_private::ClangASTSource::FindExternalVisibleDeclsByName(clang::DeclContext
const*, clang::DeclarationName)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xc24ff7)
#29 0x00007f2ba954d783 clang::DeclContext::lookup(clang::DeclarationName) const
(/opt/lzlabs/lldb/lib64/libclangAST.so.13git+0x311783)
#30 0x00007f2baa499cf4 LookupDirect(clang::Sema&, clang::LookupResult&,
clang::DeclContext const*)
(/opt/lzlabs/lldb/lib64/libclangSema.so.13git+0x60fcf4)
#31 0x00007f2baa49a75e CppNamespaceLookup(clang::Sema&, clang::LookupResult&,
clang::ASTContext&, clang::DeclContext*, (anonymous
namespace)::UnqualUsingDirectiveSet&) (.isra.1675)
(/opt/lzlabs/lldb/lib64/libclangSema.so.13git+0x61075e)
#32 0x00007f2baa4889a3 clang::Sema::CppLookupName(clang::LookupResult&,
clang::Scope*) (/opt/lzlabs/lldb/lib64/libclangSema.so.13git+0x5fe9a3)
#33 0x00007f2baa4890a5 clang::Sema::LookupName(clang::LookupResult&,
clang::Scope*, bool) (/opt/lzlabs/lldb/lib64/libclangSema.so.13git+0x5ff0a5)
#34 0x00007f2baa489993
clang::Sema::LookupOverloadedOperatorName(clang::OverloadedOperatorKind,
clang::Scope*, clang::UnresolvedSetImpl&)
(/opt/lzlabs/lldb/lib64/libclangSema.so.13git+0x5ff993)
#35 0x00007f2baa30f870 clang::Sema::BuildUnaryOp(clang::Scope*,
clang::SourceLocation, clang::UnaryOperatorKind, clang::Expr*)
(/opt/lzlabs/lldb/lib64/libclangSema.so.13git+0x485870)
#36 0x00007f2bab4a7823
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&,
clang::Parser::TypeCastState, bool, bool*)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0x73823)
#37 0x00007f2bab4a9226
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool,
clang::Parser::TypeCastState, bool, bool*)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0x75226)
#38 0x00007f2bab4a92b8
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0x752b8)
#39 0x00007f2bab4a9f29
clang::Parser::ParseExpression(clang::Parser::TypeCastState)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0x75f29)
#40 0x00007f2bab4fe2a4
clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0xca2a4)
#41 0x00007f2bab4f9322
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::ParsedAttributesWithRange&)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0xc5322)
#42 0x00007f2bab4f9fb7
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0xc5fb7)
#43 0x00007f2bab4f6b54 clang::Parser::ParseCompoundStatementBody(bool)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0xc2b54)
#44 0x00007f2bab4f6fdb clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0xc2fdb)
#45 0x00007f2bab523682
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0xef682)
#46 0x00007f2bab489c36 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0x55c36)
#47 0x00007f2bab51ea61
clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0xeaa61)
#48 0x00007f2bab51f039
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.332)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0xeb039)
#49 0x00007f2bab524a9b
clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0xf0a9b)
#50 0x00007f2bab525915
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0xf1915)
#51 0x00007f2bab467139 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/lzlabs/lldb/lib64/libclangParse.so.13git+0x33139)
#52 0x00007f2bb2719d49
lldb_private::ClangExpressionParser::ParseInternal(lldb_private::DiagnosticManager&,
clang::CodeCompleteConsumer*, unsigned int, unsigned int)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xc4fd49)
#53 0x00007f2bb26fff78
lldb_private::ClangUserExpression::TryParse(lldb_private::DiagnosticManager&,
lldb_private::ExecutionContextScope*, lldb_private::ExecutionContext&,
lldb_private::ExecutionPolicy, bool, bool)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xc35f78)
#54 0x00007f2bb2700bd3
lldb_private::ClangUserExpression::Parse(lldb_private::DiagnosticManager&,
lldb_private::ExecutionContext&, lldb_private::ExecutionPolicy, bool, bool)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xc36bd3)
#55 0x00007f2bb20f927c
lldb_private::UserExpression::Evaluate(lldb_private::ExecutionContext&,
lldb_private::EvaluateExpressionOptions const&, llvm::StringRef,
llvm::StringRef, std::shared_ptr<lldb_private::ValueObject>&,
lldb_private::Status&, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, lldb_private::ValueObject*)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0x62f27c)
#56 0x00007f2bb22154fe
lldb_private::Target::EvaluateExpression(llvm::StringRef,
lldb_private::ExecutionContextScope*,
std::shared_ptr<lldb_private::ValueObject>&,
lldb_private::EvaluateExpressionOptions const&,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
>*, lldb_private::ValueObject*)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0x74b4fe)
#57 0x00007f2bb26112c6
lldb_private::CommandObjectExpression::EvaluateExpression(llvm::StringRef,
lldb_private::Stream&, lldb_private::Stream&,
lldb_private::CommandReturnObject&)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xb472c6)
#58 0x00007f2bb2612a47
lldb_private::CommandObjectExpression::DoExecute(llvm::StringRef,
lldb_private::CommandReturnObject&)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0xb48a47)
#59 0x00007f2bb213a208 lldb_private::CommandObjectRaw::Execute(char const*,
lldb_private::CommandReturnObject&)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0x670208)
#60 0x00007f2bb2135e5d lldb_private::CommandInterpreter::HandleCommand(char
const*, lldb_private::LazyBool, lldb_private::CommandReturnObject&)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0x66be5d)
#61 0x00007f2bb21361f0
lldb_private::CommandInterpreter::IOHandlerInputComplete(lldb_private::IOHandler&,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
>&) (/opt/lzlabs/lldb/lib64/liblldb.so.13git+0x66c1f0)
#62 0x00007f2bb2070a31 lldb_private::IOHandlerEditline::Run()
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0x5a6a31)
#63 0x00007f2bb204ea10 lldb_private::Debugger::RunIOHandlers()
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0x584a10)
#64 0x00007f2bb2129cd3
lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0x65fcd3)
#65 0x00007f2bb1cfd5fa lldb::SBDebugger::RunCommandInterpreter(bool, bool)
(/opt/lzlabs/lldb/lib64/liblldb.so.13git+0x2335fa)
#66 0x0000000000406e2f Driver::MainLoop() (/opt/lzlabs/lldb/bin/lldb+0x406e2f)
#67 0x0000000000404ede main (/opt/lzlabs/lldb/bin/lldb+0x404ede)
#68 0x00007f2bb09e0493 __libc_start_main (/lib64/libc.so.6+0x23493)
#69 0x000000000040502e _start (/opt/lzlabs/lldb/bin/lldb+0x40502e)

Our lldb version has been extended to support COBOL and PL/I debugging, but in
this case I was debugging pure C code.  

The base for our build of llvm-project was:

commit b746a8db84ba28bcd54982655ff4e2762016bcda
Author: LLVM GN Syncbot <llvmgnsyncbot at gmail.com>
Date:   Mon Jun 21 06:23:08 2021 +0000

    [gn build] Port 80fd5fa5269c

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20210708/836295f5/attachment-0001.html>


More information about the lldb-dev mailing list