Skip to content

Conversation

@practicalswift
Copy link
Contributor

Add test case for crash triggered in swift::Parser::parseTopLevel(...).

Current number of unresolved compiler crashers: 24 (5389 resolved)

Assertion failure in lib/Parse/ParseDecl.cpp (line 222):

Assertion `isInSILMode() && "'sil' should only be a keyword in SIL mode"' failed.

When executing: bool swift::Parser::parseTopLevel()

Assertion context:

    parseSILDefaultWitnessTable();
  } else if (Tok.is(tok::kw_sil_coverage_map)) {
    assert(isInSILMode() && "'sil' should only be a keyword in SIL mode");
    parseSILCoverageMap();
  } else if (Tok.is(tok::kw_sil_scope)) {
    assert(isInSILMode() && "'sil' should only be a keyword in SIL mode");
    parseSILScope();
  } else {
    parseBraceItems(Items,
                    allowTopLevelCode() ? BraceItemListKind::TopLevelCode
                                        : BraceItemListKind::TopLevelLibrary);

Stack trace:

0 0x0000000003512118 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x3512118)
1 0x0000000003512856 SignalHandler(int) (/path/to/swift/bin/swift+0x3512856)
2 0x00007f8ea4f2d3e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007f8ea365b428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f8ea365d02a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00007f8ea3653bd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0
6 0x00007f8ea3653c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
7 0x0000000000b80db1 swift::Parser::parseTopLevel() (/path/to/swift/bin/swift+0xb80db1)
8 0x0000000000bb4f10 swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) (/path/to/swift/bin/swift+0xbb4f10)
9 0x0000000000996713 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x996713)
10 0x000000000047c5aa swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c5aa)
11 0x000000000043ade7 main (/path/to/swift/bin/swift+0x43ade7)
12 0x00007f8ea3646830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
13 0x0000000000438229 _start (/path/to/swift/bin/swift+0x438229)

Add test case for crash triggered in `swift::Parser::parseTopLevel(...)`.

Current number of unresolved compiler crashers: 24 (5389 resolved)

Assertion failure in [`lib/Parse/ParseDecl.cpp (line 222)`](https://github.com/apple/swift/blob/master/lib/Parse/ParseDecl.cpp#L222):

```
Assertion `isInSILMode() && "'sil' should only be a keyword in SIL mode"' failed.

When executing: bool swift::Parser::parseTopLevel()
```

Assertion context:

```
    parseSILDefaultWitnessTable();
  } else if (Tok.is(tok::kw_sil_coverage_map)) {
    assert(isInSILMode() && "'sil' should only be a keyword in SIL mode");
    parseSILCoverageMap();
  } else if (Tok.is(tok::kw_sil_scope)) {
    assert(isInSILMode() && "'sil' should only be a keyword in SIL mode");
    parseSILScope();
  } else {
    parseBraceItems(Items,
                    allowTopLevelCode() ? BraceItemListKind::TopLevelCode
                                        : BraceItemListKind::TopLevelLibrary);
```
Stack trace:

```
0 0x0000000003512118 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x3512118)
1 0x0000000003512856 SignalHandler(int) (/path/to/swift/bin/swift+0x3512856)
2 0x00007f8ea4f2d3e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007f8ea365b428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f8ea365d02a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00007f8ea3653bd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0
6 0x00007f8ea3653c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
7 0x0000000000b80db1 swift::Parser::parseTopLevel() (/path/to/swift/bin/swift+0xb80db1)
8 0x0000000000bb4f10 swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) (/path/to/swift/bin/swift+0xbb4f10)
9 0x0000000000996713 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x996713)
10 0x000000000047c5aa swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c5aa)
11 0x000000000043ade7 main (/path/to/swift/bin/swift+0x43ade7)
12 0x00007f8ea3646830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
13 0x0000000000438229 _start (/path/to/swift/bin/swift+0x438229)
```
@practicalswift
Copy link
Contributor Author

@swift-ci please smoke test and merge

@practicalswift
Copy link
Contributor Author

@swift-ci please test and merge

@practicalswift practicalswift merged commit 7268654 into swiftlang:master Jan 4, 2017
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.

1 participant