Open ChristopherRogers opened 5 years ago
davidungar (JIRA User), the backtrace looks like some of your refactorings? Not sure, though.
Comment by David Ungar (JIRA)
Thanks, @belkadan. I'll take a look.
Comment by David Ungar (JIRA)
The portion that passes through my refactoring was also there before the refactoring.
(See line 1220-1224 in NameLookup.cpp, commit 18f4bcb5ff8a15db71581da090fc3f35495e867a.)
I'm happy to look at it; @belkadan, can you tell me how to reproduce this kind of crash?
I haven't ever actually had to myself. @nathawes, @nkcsgexi?
You can reproduce it using the sourcekit-test utility, which should be in bin next to swiftc if you're building locally:
1. Add the content between the 'begin/end file content' markers to a new file e.g. /tmp/test.swift:
extension Foo {
init(_ bar: Bar)
self.<cursor-offset>init
2. work out the character offset of and remove the '\<cursor-offset>' part from the file (51 in this case) and save.
<build-dir>/bin/sourcekitd-test -req=cursor -offset=51 /tmp/test.swift -- /tmp/test.swift
The bit after the --
is the swift compiler args to use for the file you're interested in. In this case it's a self-contained invalid file, so we don't need anything other than the file itself.
Comment by David Ungar (JIRA)
Thanks a bunch, @belkadan and @nathawes . I've got a putative fix: https://github.com/apple/swift/pull/25584 . If it passes review, I'll land it.
Attachment: Download
Environment
swift-DEVELOPMENT-SNAPSHOT-2019-06-06-a or swift-5.1-DEVELOPMENT-SNAPSHOT-2019-06-15-a Xcode 11 beta 1 (11M336w) sk-stress-test --rewrite-mode=concurrent /path/to/Foo.swift swiftc -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.0.sdk -target x86_64-apple-ios10.0-simulator /path/to/Foo.swiftAdditional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Source Tooling | |Labels | Bug, CompilerCrash, FoundByStressTester | |Assignee | None | |Priority | Medium | md5: 64085663e3c2e65713d51c345b5a5a94Issue Description:
Assertion failed: (!baseName.isSpecial() && "Can't retrieve the identifier of a special base name"), function getBaseIdentifier, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/include/swift/AST/Identifier.h, line 449.