Skip to content

[SourceKit] Add test case for crash triggered in swift::Parser::parseDeclVar(…) #577

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

Merged
merged 1 commit into from
Dec 16, 2015
Merged

[SourceKit] Add test case for crash triggered in swift::Parser::parseDeclVar(…) #577

merged 1 commit into from
Dec 16, 2015

Conversation

practicalswift
Copy link
Contributor

Stack trace:

found code completion token A at offset 123
swift-ide-test: /path/to/swift/include/swift/Parse/ParserResult.h:73: T *swift::ParserResult<swift::Expr>::get() const [T = swift::Expr]: Assertion `getPtrOrNull() && "not checked for nullptr"' failed.
8  swift-ide-test  0x000000000087687b swift::Parser::parseDeclVar(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&, llvm::SmallVectorImpl<swift::Decl*>&, swift::SourceLoc, swift::StaticSpellingKind, swift::SourceLoc) + 4619
9  swift-ide-test  0x00000000008737c4 swift::Parser::parseDecl(llvm::SmallVectorImpl<swift::Decl*>&, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>) + 2836
11 swift-ide-test  0x00000000008680c8 swift::Parser::parseList(swift::tok, swift::SourceLoc, swift::SourceLoc&, swift::tok, bool, bool, swift::Diag<>, std::function<swift::ParserStatus ()>) + 728
12 swift-ide-test  0x000000000087a612 swift::Parser::parseDeclProtocol(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&) + 1602
13 swift-ide-test  0x0000000000873a77 swift::Parser::parseDecl(llvm::SmallVectorImpl<swift::Decl*>&, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>) + 3527
14 swift-ide-test  0x00000000008bebab swift::Parser::parseBraceItems(llvm::SmallVectorImpl<swift::ASTNode>&, swift::BraceItemListKind, swift::BraceItemListKind) + 2027
15 swift-ide-test  0x000000000086a30c swift::Parser::parseTopLevel() + 156
16 swift-ide-test  0x000000000086591b swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 107
17 swift-ide-test  0x0000000000774176 swift::CompilerInstance::performSema() + 2918
18 swift-ide-test  0x000000000071cc33 main + 35011
Stack dump:
0.  Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.  With parser at source location: <INPUT-FILE>:2:20

…DeclVar(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&, llvm::SmallVectorImpl<swift::Decl*>&, swift::SourceLoc, swift::StaticSpellingKind, swift::SourceLoc)

Stack trace:

```
found code completion token A at offset 123
swift-ide-test: /path/to/swift/include/swift/Parse/ParserResult.h:73: T *swift::ParserResult<swift::Expr>::get() const [T = swift::Expr]: Assertion `getPtrOrNull() && "not checked for nullptr"' failed.
8  swift-ide-test  0x000000000087687b swift::Parser::parseDeclVar(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&, llvm::SmallVectorImpl<swift::Decl*>&, swift::SourceLoc, swift::StaticSpellingKind, swift::SourceLoc) + 4619
9  swift-ide-test  0x00000000008737c4 swift::Parser::parseDecl(llvm::SmallVectorImpl<swift::Decl*>&, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>) + 2836
11 swift-ide-test  0x00000000008680c8 swift::Parser::parseList(swift::tok, swift::SourceLoc, swift::SourceLoc&, swift::tok, bool, bool, swift::Diag<>, std::function<swift::ParserStatus ()>) + 728
12 swift-ide-test  0x000000000087a612 swift::Parser::parseDeclProtocol(swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>, swift::DeclAttributes&) + 1602
13 swift-ide-test  0x0000000000873a77 swift::Parser::parseDecl(llvm::SmallVectorImpl<swift::Decl*>&, swift::OptionSet<swift::Parser::ParseDeclFlags, unsigned int>) + 3527
14 swift-ide-test  0x00000000008bebab swift::Parser::parseBraceItems(llvm::SmallVectorImpl<swift::ASTNode>&, swift::BraceItemListKind, swift::BraceItemListKind) + 2027
15 swift-ide-test  0x000000000086a30c swift::Parser::parseTopLevel() + 156
16 swift-ide-test  0x000000000086591b swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 107
17 swift-ide-test  0x0000000000774176 swift::CompilerInstance::performSema() + 2918
18 swift-ide-test  0x000000000071cc33 main + 35011
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	With parser at source location: <INPUT-FILE>:2:20
```
@benlangmuir
Copy link
Contributor

Thanks!

benlangmuir added a commit that referenced this pull request Dec 16, 2015
…r-parsedeclvar

[SourceKit] Add test case for crash triggered in swift::Parser::parseDeclVar(…)
@benlangmuir benlangmuir merged commit ba9e779 into swiftlang:master Dec 16, 2015
kateinoigakukun pushed a commit to kateinoigakukun/swift that referenced this pull request Apr 16, 2020
freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
[Stress tester XFails] Update XFails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants