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

[SR-9412] Assertion failed: (F->isAvailableExternally() && "external declaration of internal SILFunction not allowed") #51877

Closed
tonyarnold opened this issue Dec 4, 2018 · 9 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software regression swift 5.0

Comments

@tonyarnold
Copy link
Contributor

Previous ID SR-9412
Radar rdar://problem/46503121
Original Reporter @tonyarnold
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 5.0Regression, CompilerCrash
Assignee @slavapestov
Priority Medium

md5: a5eb7756c684bb0c803a643461749c01

Issue Description:

I'm getting the following abort when trying to build my project (https://github.com/tonyarnold/Differ - see the swift-5.0 branch) using the first snapshot of Swift 5.0 (swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-03-a-osx):

Assertion failed: (F->isAvailableExternally() && "external declaration of internal SILFunction not allowed"), function visitSILFunction, file /Users/buildnode/jenkins/workspace/oss-swift-5.0-package-osx/swift/lib/SIL/SILVerifier.cpp, line 4820.
Stack dump:
0.  Program arguments: /Users/tonyarnold/Library/Developer/Toolchains/swift-5.0-DEVELOPMENT-SNAPSHOT-2018-12-03-a.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/ExtendedDiff.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/Diff+AppKit.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/LinkedList.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/GenericPatch.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/Patch.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/NestedExtendedDiff.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/Patch+Sort.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/Diff+UIKit.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/Patch+Apply.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/ExtendedPatch+Apply.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/NestedBatchUpdate.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/Diff.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/BatchUpdate.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/ExtendedPatch.swift /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/NestedDiff.swift -emit-module-path /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/Objects-normal/x86_64/ExtendedDiff~partial.swiftmodule -emit-module-doc-path /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/Objects-normal/x86_64/ExtendedDiff~partial.swiftdoc -serialize-diagnostics-path /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/Objects-normal/x86_64/ExtendedDiff.dia -emit-dependencies-path /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/Objects-normal/x86_64/ExtendedDiff.d -emit-reference-dependencies-path /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/Objects-normal/x86_64/ExtendedDiff.swiftdeps -target x86_64-apple-macosx10.11 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Products/Debug -F /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Products/Debug -application-extension -enable-testing -g -import-underlying-module -module-cache-path /Users/tonyarnold/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -serialize-debugging-options -Xcc -I/Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/Differ-generated-files.hmap -Xcc -I/Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/Differ-own-target-headers.hmap -Xcc -I/Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/Differ-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/Differ-project-headers.hmap -Xcc -I/Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Products/Debug/include -Xcc -I/Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/DerivedSources/x86_64 -Xcc -I/Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -ivfsoverlay -Xcc /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/unextended-module-overlay.yaml -Xcc -working-directory/Users/tonyarnold/Developer/Repositories/Differ -module-name Differ -o /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Build/Intermediates.noindex/Differ.build/Debug/Differ.build/Objects-normal/x86_64/ExtendedDiff.o -index-store-path /Users/tonyarnold/Library/Developer/Xcode/DerivedData/Differ-emvioovexpgvuocbdvtafapupplz/Index/DataStore -index-system-modules 
1.  While verifying SIL function "@$s6Differ12DiffProtocolPAAEy0B11ElementTypeQzSicir".
 for read for subscript(_:) (at /Users/tonyarnold/Developer/Repositories/Differ/Sources/Differ/Diff.swift:344:12)
0  swift                    0x000000010515ae88 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x000000010515a105 llvm::sys::RunSignalHandlers() + 85
2  swift                    0x000000010515b492 SignalHandler(int) + 258
3  libsystem_platform.dylib 0x00007fff69ce2b3d _sigtramp + 29
4  libsystem_platform.dylib 0x0000000000003e90 _sigtramp + 2519864176
5  libsystem_c.dylib        0x00007fff69ba11c9 abort + 127
6  libsystem_c.dylib        0x00007fff69b69868 basename_r + 0
7  swift                    0x00000001023cbbf7 swift::SILFunction::verify(bool) const + 375
8  swift                    0x00000001023d06c3 swift::SILModule::verify() const + 211
9  swift                    0x0000000101e04e11 swift::Lowering::SILGenModule::~SILGenModule() + 33
10 swift                    0x0000000101e10a74 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*) + 1460
11 swift                    0x0000000101e10b7c swift::performSILGeneration(swift::FileUnit&, swift::SILOptions&) + 44
12 swift                    0x000000010159b183 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 7491
13 swift                    0x00000001015983ad swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3021
14 swift                    0x000000010154a19e main + 686
15 libdyld.dylib            0x00007fff69af908d start + 1
16 libdyld.dylib            0x0000000000000058 start + 2521853900
error: Abort trap: 6
@belkadan
Copy link
Contributor

belkadan commented Dec 5, 2018

@gottesmm, this kind of sounds like the thing we were looking at last week? Or am I conflating different things?

@gottesmm
Copy link
Member

gottesmm commented Dec 5, 2018

@belkadan I am assume you are talking about the bitfield issue. @slavapestov fixed it.

@belkadan
Copy link
Contributor

belkadan commented Dec 5, 2018

Hm. That may or may not have been cherry-picked to the 5.0 branch yet. Tony, mind trying the latest master snapshot?

@tonyarnold
Copy link
Contributor Author

@belkadan I have just tested it using today's master snapshot (swift-DEVELOPMENT-SNAPSHOT-2018-12-04-a-osx), and the abort is still happening for me on the same project. Sorry!

@belkadan
Copy link
Contributor

belkadan commented Dec 5, 2018

Good to know.

@slavapestov
Copy link
Member

#21115

@tonyarnold
Copy link
Contributor Author

The fix in the 5.0 branch works a treat - thank you, everyone!

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Jul 23, 2019

Closing the issue since the fix has been confirmed.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software regression swift 5.0
Projects
None yet
Development

No branches or pull requests

5 participants