Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in ActOnExplicitInstantiation(): "point of instantiation must be valid!" #11930

Closed
nico opened this issue Dec 13, 2011 · 3 comments
Closed
Labels
bugzilla Issues migrated from bugzilla c++

Comments

@nico
Copy link
Contributor

nico commented Dec 13, 2011

Bugzilla Link 11558
Resolution FIXED
Resolved on Dec 23, 2011 17:56
Version unspecified
OS All
CC @Abramo-Bagnara,@DougGregor

Extended Description

tests-MacBook-Pro-2:delta test$ cat repro.ii
namespace std {

template
class basic_string;

typedef basic_string string;

template class BasicStringPiece;

template <> class BasicStringPiecestd::string {
};

extern template class BasicStringPiecestd::string;
template class BasicStringPiecestd::string;

} // namespace std
tests-MacBook-Pro-2:delta test$ gcc -x c++ -c repro.ii
tests-MacBook-Pro-2:delta test$ ~/src/chrome-git/src/third_party/llvm-build/Release+Asserts/bin/clang -x c++ -c repro.ii
Assertion failed: (Loc.isValid() && "point of instantiation must be valid!"), function setPointOfInstantiation, file /Volumes/MacintoshHD2/src/chrome-git/src/third_party/llvm/tools/clang/lib/Sema/../../include/clang/AST/DeclTemplate.h, line 1416.
0 clang 0x00000001014c9ac2 _ZL15PrintStackTracePv + 34
1 clang 0x00000001014c9ff9 _ZL13SignalHandleri + 713
2 libsystem_c.dylib 0x00007fff8b0ffcfa _sigtramp + 26
3 clang 0x00000001002eb2ea clang::Parser::ParseTemplateArgument() + 138
4 clang 0x00000001000441e6 abort + 22
5 clang 0x0000000100044238 __assert_rtn + 56
6 clang 0x0000000100503cf5 clang::Sema::ActOnExplicitInstantiation(clang::Scope*, clang::SourceLocation, clang::SourceLocation, unsigned int, clang::SourceLocation, clang::CXXScopeSpec const&, clang::OpaquePtrclang::TemplateName, clang::SourceLocation, clang::SourceLocation, clang::ASTTemplateArgsPtr, clang::SourceLocation, clang::AttributeList*) + 2119
7 clang 0x00000001002c0ee8 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, bool) + 2710
8 clang 0x00000001002b3e5e clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext) + 6218
9 clang 0x00000001002ed4b5 clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 717
10 clang 0x00000001002ea15d clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 429
11 clang 0x00000001002b6fc3 clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 381
12 clang 0x00000001002f723e clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec*) + 1776
13 clang 0x00000001002c287a clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation, std::allocatorclang::SourceLocation >&, std::vector<clang::IdentifierInfo*, std::allocatorclang::IdentifierInfo* >&, std::vector<clang::SourceLocation, std::allocatorclang::SourceLocation >&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::Parser::BalancedDelimiterTracker&) + 256
14 clang 0x00000001002b861b clang::Parser::ParseNamespace(unsigned int, clang::SourceLocation&, clang::SourceLocation) + 3323
15 clang 0x00000001002b706b clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 549
16 clang 0x00000001002f723e clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec*) + 1776
17 clang 0x00000001002f7d6e clang::Parser::ParseTopLevelDecl(clang::OpaquePtrclang::DeclGroupRef&) + 262
18 clang 0x00000001002a3175 clang::ParseAST(clang::Sema&, bool) + 325
19 clang 0x000000010026f2cc clang::CodeGenAction::ExecuteAction() + 924
20 clang 0x0000000100065a96 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 962
21 clang 0x000000010004da31 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2161
22 clang 0x0000000100047acb cc1_main(char const**, char const**, char const*, void*) + 2923
23 clang 0x000000010004aab0 main + 640
24 clang 0x0000000100046f4c start + 52
25 clang 0x000000000000002f start + 18446744069414293783
Stack dump:
0. Program arguments: /Users/test/src/chrome-git/src/third_party/llvm-build/Release+Asserts/bin/clang -cc1 -triple x86_64-apple-macosx10.7.2 -emit-obj -mrelax-all -disable-free -main-file-name repro.ii -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 97.17 -coverage-file repro.o -resource-dir /Users/test/src/chrome-git/src/third_party/llvm-build/Release+Asserts/bin/../lib/clang/3.1 -fmodule-cache-path /var/folders/5j/6xp_dl050mv_b_0_56s5mjx80000gn/T/clang-module-cache -fdeprecated-macro -fdebug-compilation-dir /Users/test/src/delta -ferror-limit 19 -fmessage-length 267 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-dispatch-method=mixed -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o repro.o -x c++ repro.ii

  1. repro.ii:14:45: current parser token ';'
  2. repro.ii:1:1: parsing namespace 'std'
    clang: error: unable to execute command: Illegal instruction: 4
    clang: error: clang frontend command failed due to signal (use -v to see invocation)
    clang: note: diagnostic msg: Please submit a bug report to http://llvm.org/bugs/ and include command line arguments and all diagnostic information.
    clang: note: diagnostic msg: Preprocessed source(s) and associated run script(s) are located at:
    clang: note: diagnostic msg: /var/folders/5j/6xp_dl050mv_b_0_56s5mjx80000gn/T/repro-VirH75.ii
    clang: note: diagnostic msg: /var/folders/5j/6xp_dl050mv_b_0_56s5mjx80000gn/T/repro-VirH75.sh
@nico
Copy link
Contributor Author

nico commented Dec 16, 2011

The assert originates from

else if (TSK == TSK_ExplicitInstantiationDefinition) {
MarkVTableUsed(TemplateNameLoc, Specialization, true);
Specialization->setPointOfInstantiation(Def->getPointOfInstantiation());
}

in SemaTemplate.cpp. That call was added in http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100607/031205.html

@nico
Copy link
Contributor Author

nico commented Dec 17, 2011

@nico
Copy link
Contributor Author

nico commented Dec 24, 2011

r147225

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++
Projects
None yet
Development

No branches or pull requests

1 participant