[llvm-bugs] [Bug 24531] New: segfault in clang::LocalInstantiationScope::getPartiallySubstitutedPack

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 21 04:42:28 PDT 2015


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

            Bug ID: 24531
           Summary: segfault in
                    clang::LocalInstantiationScope::getPartiallySubstitute
                    dPack
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: octoploid at yandex.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

% cat assert.ii
template <typename> struct A;
template <typename... T> A<T...> models;
template <int> void fn1() { models<>; }

% g++ -std=c++14 -c assert.ii
% clang++ -std=c++14 -c assert.ii
#0 0x10dd0ac4 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/trippels/llvm-install/bin/clang-3.8+0x10dd0ac4)
#1 0x10dd1b10 PrintStackTraceSignalHandler(void*)
(/home/trippels/llvm-install/bin/clang-3.8+0x10dd1b10)
#2 0x10dcefbc llvm::sys::RunSignalHandlers()
(/home/trippels/llvm-install/bin/clang-3.8+0x10dcefbc)
#3 0x10dcf29c SignalHandler(int)
(/home/trippels/llvm-install/bin/clang-3.8+0x10dcf29c)
0  clang-3.8 0x0000000010dd0ac4 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
+ 132
1  clang-3.8 0x0000000010dd1b10
2  clang-3.8 0x0000000010dcefbc llvm::sys::RunSignalHandlers() + 124
3  clang-3.8 0x0000000010dcf29c
4            0x00003fff93610478 __kernel_sigtramp_rt64 + 0
5  clang-3.8 0x0000000011db65f0
clang::LocalInstantiationScope::getPartiallySubstitutedPack(clang::TemplateArgument
const**, unsigned int*) const + 48
6  clang-3.8 0x0000000011dfd808
clang::Sema::CheckParameterPacksForExpansion(clang::SourceLocation,
clang::SourceRange,
llvm::ArrayRef<std::pair<llvm::PointerUnion<clang::TemplateTypeParmType const*,
clang::NamedDecl*>, clang::SourceLocation> >,
clang::MultiLevelTemplateArgumentList const&, bool&, bool&,
llvm::Optional<unsigned int>&) + 648
7  clang-3.8 0x0000000011dd409c
8  clang-3.8 0x0000000011dc53b0
9  clang-3.8 0x0000000011dc60bc
10 clang-3.8 0x0000000011dc6244 clang::Sema::SubstType(clang::TypeSourceInfo*,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName) + 148
11 clang-3.8 0x0000000011df3e88
clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl(clang::VarTemplateDecl*,
clang::VarDecl*, void*, clang::TemplateArgumentListInfo const&,
llvm::ArrayRef<clang::TemplateArgument>) + 232
12 clang-3.8 0x0000000011df53dc
clang::Sema::BuildVarTemplateInstantiation(clang::VarTemplateDecl*,
clang::VarDecl*, clang::TemplateArgumentList const&,
clang::TemplateArgumentListInfo const&,
llvm::SmallVectorImpl<clang::TemplateArgument>&, clang::SourceLocation, void*,
llvm::SmallVector<clang::Sema::LateInstantiatedAttribute, 16u>*,
clang::LocalInstantiationScope*) + 508
13 clang-3.8 0x0000000011d452cc
clang::Sema::CheckVarTemplateId(clang::VarTemplateDecl*, clang::SourceLocation,
clang::SourceLocation, clang::TemplateArgumentListInfo const&) + 1660
14 clang-3.8 0x0000000011d45600
clang::Sema::CheckVarTemplateId(clang::CXXScopeSpec const&,
clang::DeclarationNameInfo const&, clang::VarTemplateDecl*,
clang::SourceLocation, clang::TemplateArgumentListInfo const*) + 80
15 clang-3.8 0x0000000011d458ec
clang::Sema::BuildTemplateIdExpr(clang::CXXScopeSpec const&,
clang::SourceLocation, clang::LookupResult&, bool,
clang::TemplateArgumentListInfo const*) + 444
16 clang-3.8 0x0000000011b86cd0 clang::Sema::ActOnIdExpression(clang::Scope*,
clang::CXXScopeSpec&, clang::SourceLocation, clang::UnqualifiedId&, bool, bool,
std::unique_ptr<clang::CorrectionCandidateCallback,
std::default_delete<clang::CorrectionCandidateCallback> >, bool, clang::Token*)
+ 1312
17 clang-3.8 0x000000001183752c
clang::Parser::tryParseCXXIdExpression(clang::CXXScopeSpec&, bool,
clang::Token&) + 236
18 clang-3.8 0x0000000011837674 clang::Parser::ParseCXXIdExpression(bool) + 148
19 clang-3.8 0x000000001182294c clang::Parser::ParseCastExpression(bool, bool,
bool&, clang::Parser::TypeCastState) + 1388
20 clang-3.8 0x0000000011824adc clang::Parser::ParseCastExpression(bool, bool,
clang::Parser::TypeCastState) + 44
21 clang-3.8 0x0000000011824bc0
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 64
22 clang-3.8 0x0000000011824c90
clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 32
23 clang-3.8 0x0000000011863848 clang::Parser::ParseExprStatement() + 88
24 clang-3.8 0x00000000118612c4
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
+ 5076
25 clang-3.8 0x0000000011861448
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 136
26 clang-3.8 0x000000001185d35c clang::Parser::ParseCompoundStatementBody(bool)
+ 1276
27 clang-3.8 0x0000000011866564
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 308
28 clang-3.8 0x00000000117e970c
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) +
2348
29 clang-3.8 0x000000001187224c
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 3468
30 clang-3.8 0x0000000011872f54
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1012
31 clang-3.8 0x00000000118732ac
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 204
32 clang-3.8 0x000000001180aae4 clang::Parser::ParseDeclaration(unsigned int,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 1044
33 clang-3.8 0x00000000117e66ec
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1692
34 clang-3.8 0x00000000117e71ac
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 556
35 clang-3.8 0x00000000117dd93c clang::ParseAST(clang::Sema&, bool, bool) + 780
36 clang-3.8 0x00000000111e0080 clang::ASTFrontendAction::ExecuteAction() + 112
37 clang-3.8 0x00000000114c6e50 clang::CodeGenAction::ExecuteAction() + 128
38 clang-3.8 0x00000000111e16b8 clang::FrontendAction::Execute() + 664
39 clang-3.8 0x00000000111b95b8
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 424
40 clang-3.8 0x000000001127c78c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2188
41 clang-3.8 0x00000000103d5d58 cc1_main(llvm::ArrayRef<char const*>, char
const*, void*) + 2520
42 clang-3.8 0x00000000103ab960 main + 1152
43 libc.so.6 0x00003fff92fd2920
44 libc.so.6 0x00003fff92fd2b34 __libc_start_main + 196
Stack dump:
0.      Program arguments: /home/trippels/llvm-install/bin/clang-3.8 -cc1
-triple powerpc64le-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name assert.ii -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-fuse-init-array -target-cpu ppc64le -target-abi elfv2 -dwarf-column-info
-coverage-file /home/trippels/hana/build/test/assert.ii -resource-dir
/home/trippels/llvm-install/bin/../lib/clang/3.8.0 -std=c++14
-fdeprecated-macro -fdebug-compilation-dir /home/trippels/hana/build/test
-ferror-limit 19 -fmessage-length 174 -mstackrealign -fno-signed-char
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o assert.o -x c++-cpp-output assert.ii 
1.      assert.ii:3:37: current parser token ';'
2.      assert.ii:3:27: parsing function body 'fn1'
3.      assert.ii:3:27: in compound statement ('{}')
clang-3.8: error: unable to execute command: Segmentation fault (core dumped)
clang-3.8: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.0 (http://llvm.org/git/clang.git
2163e6004de9ba2566711bef00f168ca6404eaed) (http://llvm.org/git/llvm.git
903567ca99d7377d124947272f55f42e954c83d9)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/trippels/llvm-install/bin

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150821/617035cd/attachment-0001.html>


More information about the llvm-bugs mailing list