[cfe-dev] Multiple results from LookupSameContext (ExternalASTMerger.cpp)
Krzysztof Parzyszek via cfe-dev
cfe-dev at lists.llvm.org
Wed Jun 14 10:33:38 PDT 2017
Hi all,
In our local build of clang we see a crash in one of the clang tests
running clang-import-test. Specifically, LookupSameContext finds two
results (shown below), and the fact that there are two of them triggers
the assertion.
This is where the assertion occurs:
size_t SearchResultSize = SearchResult.size();
// Handle multiple candidates once we have a test for it.
// This may turn up when we import template specializations correctly.
assert(SearchResultSize < 2);
The __va_list... is not something defined in any of the sources in the
test, it's a builtin type for Hexagon's handling of va_arg.
Does anyone have any pointers as to what the problem may be? Could this
be a legitimate case of multiple results, or these two type declarations
should not have been found/backed up/etc.?
result 1:
TypedefDecl 0x229d2a0 <<invalid sloc>> <invalid sloc> implicit
__va_list_tag 'struct __va_list_tag'
`-RecordType 0x229d1c0 'struct __va_list_tag'
`-CXXRecord 0x229d110 '__va_list_tag'
result 2:
CXXRecordDecl 0x229d110 <<invalid sloc>> <invalid sloc> implicit struct
__va_list_tag definition
|-TypeVisibilityAttr 0x229d1e0 <<invalid sloc>> Implicit Default
`-<undeserialized declarations>
The test:
clang-import-test --import test/Import/conflicting-struct/Inputs/S1.cpp
--import test/Import/conflicting-struct/Inputs/S2.cpp -expression
test/Import/conflicting-struct/test.cpp
Full stack trace:
clang-import-test: lib/AST/ExternalASTMerger.cpp:71: Source<const
clang::DeclContext *> (anonymous
namespace)::LookupSameContext(Source<clang::TranslationUnitDecl *>,
const clang::DeclContext *, clang::ASTImporter &): Assertion
`SearchResultSize < 2' failed.
#0 0x000000000050bf54 PrintStackTraceSignalHandler(void*)
(clang-import-test+0x50bf54)
#1 0x000000000050c1b6 SignalHandler(int) (clang-import-test+0x50c1b6)
#2 0x00007f0fc10fa330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#3 0x00007f0fbfae8c37 gsignal
/build/eglibc-MjiXCM/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#4 0x00007f0fbfaec028 abort
/build/eglibc-MjiXCM/eglibc-2.19/stdlib/abort.c:91:0
#5 0x00007f0fbfae1bf6 __assert_fail_base
/build/eglibc-MjiXCM/eglibc-2.19/assert/assert.c:92:0
#6 0x00007f0fbfae1ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#7 0x0000000000655a43 (anonymous
namespace)::LookupSameContext((anonymous
namespace)::Source<clang::TranslationUnitDecl*>, clang::DeclContext
const*, clang::ASTImporter&) (clang-import-test+0x655a43)
#8 0x000000000065527b
clang::ExternalASTMerger::FindExternalLexicalDecls(clang::DeclContext
const*, llvm::function_ref<bool (clang::Decl::Kind)>,
llvm::SmallVectorImpl<clang::Decl*>&) (clang-import-test+0x65527b)
#9 0x000000000059cfdd clang::RecordDecl::LoadFieldsFromExternalStorage()
const (clang-import-test+0x59cfdd)
#10 0x000000000059cf1b clang::RecordDecl::field_begin() const
(clang-import-test+0x59cf1b)
#11 0x0000000000732900 (anonymous
namespace)::IsStructurallyEquivalent(clang::StructuralEquivalenceContext&,
clang::RecordDecl*, clang::RecordDecl*) (clang-import-test+0x732900)
#12 0x000000000072d8c7 clang::StructuralEquivalenceContext::Finish()
(clang-import-test+0x72d8c7)
#13 0x000000000072efc5
clang::StructuralEquivalenceContext::IsStructurallyEquivalent(clang::QualType,
clang::QualType) (clang-import-test+0x72efc5)
#14 0x000000000071391e
clang::ASTImporter::IsStructurallyEquivalent(clang::QualType,
clang::QualType, bool) (clang-import-test+0x71391e)
#15 0x0000000000713543
clang::ASTNodeImporter::VisitTypedefNameDecl(clang::TypedefNameDecl*,
bool) (clang-import-test+0x713543)
#16 0x000000000070f311 clang::ASTImporter::Import(clang::Decl*)
(clang-import-test+0x70f311)
#17 0x00000000006550dc
clang::ExternalASTMerger::FindExternalVisibleDeclsByName(clang::DeclContext
const*, clang::DeclarationName) (clang-import-test+0x6550dc)
#18 0x00000000005b2a5c
clang::DeclContext::makeDeclVisibleInContextImpl(clang::NamedDecl*,
bool) (clang-import-test+0x5b2a5c)
#19 0x00000000005b2102
clang::DeclContext::makeDeclVisibleInContextWithFlags(clang::NamedDecl*,
bool, bool) (clang-import-test+0x5b2102)
#20 0x0000000000f25019 clang::Sema::PushOnScopeChains(clang::NamedDecl*,
clang::Scope*, bool) (clang-import-test+0xf25019)
#21 0x0000000000e5d5c9 clang::Sema::Initialize()
(clang-import-test+0xe5d5c9)
#22 0x0000000000c43cdc clang::Parser::Initialize()
(clang-import-test+0xc43cdc)
#23 0x0000000000c3f7b4 clang::ParseAST(clang::Sema&, bool, bool)
(clang-import-test+0xc3f7b4)
#24 0x0000000000c3f676 clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool,
clang::TranslationUnitKind, clang::CodeCompleteConsumer*, bool)
(clang-import-test+0xc3f676)
#25 0x0000000000413f4d (anonymous
namespace)::Parse(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&,
llvm::ArrayRef<std::__1::unique_ptr<clang::CompilerInstance,
std::__1::default_delete<clang::CompilerInstance> > >)
(clang-import-test+0x413f4d)
#26 0x00000000004138fc main (clang-import-test+0x4138fc)
#27 0x00007f0fbfad3f45 __libc_start_main
/build/eglibc-MjiXCM/eglibc-2.19/csu/libc-start.c:321:0
#28 0x0000000000412a17 _start (clang-import-test+0x412a17)
-Krzysztof
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
More information about the cfe-dev
mailing list