Assertion isActuallyCanonicalOrNull() failed

Saw the below build failure in last night’s master branch build on s390x:

swift: /localbox/vivkong/swift-master/swift/include/swift/AST/Type.h:408: swift::CanType::CanType(swift::TypeBase *): Assertion `isActuallyCanonicalOrNull() && "Forming a CanType out of a non-canonical type!"' failed.
#0 0x0000000083e3d4e2 PrintStackTraceSignalHandler(void*) (/localbox/vivkong/swift-master/build/Ninja-ReleaseAssert/swift-linux-s390x/bin/swift+0x83e3d4e2)
Stack dump:
0.      Program arguments: /localbox/vivkong/swift-master/build/Ninja-ReleaseAssert/swift-linux-s390x/bin/swift -frontend -emit-module -filelist /tmp/sources-1b453e -supplementary-output-file-map /tmp/supplementaryOutputs-9dcacd -disable-objc-attr-requires-foundation-module -target s390x-unknown-linux-gnu -disable-objc-interop -sdk / -I /localbox/vivkong/swift-master/build/Ninja-ReleaseAssert/swift-linux-s390x/./lib/swift/linux/s390x -warn-swift3-objc-inference-complete -module-cache-path /localbox/vivkong/swift-master/build/Ninja-ReleaseAssert/swift-linux-s390x/./module-cache -module-link-name swiftCore -nostdimport -parse-stdlib -resource-dir /localbox/vivkong/swift-master/build/Ninja-ReleaseAssert/swift-linux-s390x/./lib/swift -swift-version 3 -O -D INTERNAL_CHECKS_ENABLED -D SWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS -enable-resilience -group-info-path /localbox/vivkong/swift-master/swift/stdlib/public/core/GroupInfo.json -enable-sil-ownership -Xllvm -sil-inline-generics -Xllvm -sil-partial-specialization -Xcc -D__SWIFT_CURRENT_DYLIB=swiftCore -parse-as-library -module-name Swift -o /localbox/vivkong/swift-master/build/Ninja-ReleaseAssert/swift-linux-s390x/./lib/swift/linux/s390x/Swift.swiftmodule 

I looked up the commit history and found there was a recent commit for Type.h and Type.cpp (https://github.com/apple/swift/commit/9146891d16f483ac906b8f3126211a39ff6a00b2). Tried reverting it but the build still failed.

Any ideas what has changed that might have caused the build error? Thanks.

That’s usually a failure somewhere higher in the stack. Any chance you can get an actual stack trace?

Actually last night’s build is back to normal again :slight_smile: Thanks Jordan!

1 Like

Seems like the problem is here again. I'm getting the very same with the nightly builds from 23th of December and today's build – which is a pity, since I'd love to do some tests with regards to async/await…

Assertion failed: (isActuallyCanonicalOrNull() && "Forming a CanType out of a non-canonical type!"), function CanType, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/include/swift/AST/Type.h, line 402.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.	Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2021-01-04-a.xctoolchain/usr/bin/swift-frontend -frontend -c /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/ItemDetails/ImageViewController.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/App & Misc/TableSectionHeaderView.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/Backend/ImageLoader.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/MediaPods/DirectoryViewController.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/MediaPods/DirectoryEntryTableViewCell.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/ItemSlider/ItemSliderViewController.swift -primary-file /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/Backend/Session.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/MediaPods/MediaPodTableViewCell.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/MediaPods/MediaPodsViewController.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/Backend/Models/MediaPod.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/Menu/MenuViewController.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/Backend/WebDAV.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/App & Misc/AppDelegate.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/Backend/REST.swift /Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/App & Misc/SceneDelegate.swift -emit-module-path /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/Objects-normal/x86_64/Session~partial.swiftmodule -emit-module-doc-path /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/Objects-normal/x86_64/Session~partial.swiftdoc -emit-module-source-info-path /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/Objects-normal/x86_64/Session~partial.swiftsourceinfo -serialize-diagnostics-path /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/Objects-normal/x86_64/Session.dia -emit-dependencies-path /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/Objects-normal/x86_64/Session.d -emit-reference-dependencies-path /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/Objects-normal/x86_64/Session.swiftdeps -target x86_64-apple-ios14.3-simulator -enable-objc-interop -sdk /Applications/Xcode-12.3.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.3.sdk -I /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Products/Debug-iphonesimulator -F /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Products/Debug-iphonesimulator -enable-testing -g -module-cache-path /Users/mickey/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/GeneratedModuleMaps-iphonesimulator/CCryptoBoringSSLShims.modulemap -Xcc -fmodule-map-file=/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/GeneratedModuleMaps-iphonesimulator/CCryptoBoringSSL.modulemap -Xcc -fmodule-map-file=/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/GeneratedModuleMaps-iphonesimulator/YapDatabase.modulemap -Xcc -I/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/MediaBeam-generated-files.hmap -Xcc -I/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/MediaBeam-own-target-headers.hmap -Xcc -I/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/MediaBeam-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/MediaBeam-project-headers.hmap -Xcc -I/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/SourcePackages/checkouts/swift-crypto/Sources/CCryptoBoringSSLShims/include -Xcc -I/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/SourcePackages/checkouts/swift-crypto/Sources/CCryptoBoringSSL/include -Xcc -I/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/SourcePackages/checkouts/SwiftYapDatabase/Sources/YapDatabase/include -Xcc -I/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/DerivedSources-normal/x86_64 -Xcc -I/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/DerivedSources/x86_64 -Xcc -I/Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam -target-sdk-version 14.3 -module-name MediaBeam -o /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Build/Intermediates.noindex/MediaBeam.build/Debug-iphonesimulator/MediaBeam.build/Objects-normal/x86_64/Session.o -index-store-path /Users/mickey/Library/Developer/Xcode/DerivedData/MediaBeam-herrtttfbqaecxcqwvbkhsgejipk/Index/DataStore -index-system-modules 
1.	Apple Swift version 5.3-dev (LLVM d59a33031c0a4cc, Swift 79c4e3c64fec02f)
2.	While evaluating request IRGenRequest(IR Generation for file "/Volumes/Transcend/Documents/late/mediabeam/iOS/MediaBeam/MediaBeam/Backend/Session.swift")
3.	While evaluating request ExecuteSILPipelineRequest(Run pipelines { IRGen Preparation } on SIL for MediaBeam.MediaBeam)
4.	While running pass #92 SILModuleTransform "LoadableByAddress".
0  swift-frontend           0x0000000111e33d35 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  swift-frontend           0x0000000111e32f95 llvm::sys::RunSignalHandlers() + 85
2  swift-frontend           0x0000000111e34306 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff2040dd7d _sigtramp + 29
4  libsystem_platform.dylib 000000000000000000 _sigtramp + 18446603339975041696
5  libsystem_c.dylib        0x00007fff2031c720 abort + 120
6  libsystem_c.dylib        0x00007fff2031b9d6 err + 0
7  swift-frontend           0x00000001121a5cc3 swift::SILBuilder::createTuple(swift::SILLocation, llvm::ArrayRef<swift::SILValue>) (.cold.1) + 35
8  swift-frontend           0x000000010e1a0ccb swift::SILBuilder::createTuple(swift::SILLocation, llvm::ArrayRef<swift::SILValue>) + 507
9  swift-frontend           0x000000010da1246c (anonymous namespace)::LoadableByAddress::run() + 4364
10 swift-frontend           0x000000010dde4f5e swift::SILPassManager::runModulePass(unsigned int) + 558
11 swift-frontend           0x000000010dde9b3a swift::SILPassManager::execute() + 666
12 swift-frontend           0x000000010dde1d08 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 72
13 swift-frontend           0x000000010dde1ca3 swift::ExecuteSILPipelineRequest::evaluate(swift::Evaluator&, swift::SILPipelineExecutionDescriptor) const + 51
14 swift-frontend           0x000000010de04f8d swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 29
15 swift-frontend           0x000000010ddec12b llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) + 379
16 swift-frontend           0x000000010dde1f42 swift::executePassPipelinePlan(swift::SILModule*, swift::SILPassPipelinePlan const&, bool, swift::irgen::IRGenModule*) + 82
17 swift-frontend           0x000000010d9b033a swift::IRGenRequest::evaluate(swift::Evaluator&, swift::IRGenDescriptor) const + 1850
18 swift-frontend           0x000000010d9e855d swift::GeneratedModule swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)9>::callDerived<0ul>(swift::Evaluator&, std::__1::integer_sequence<unsigned long, 0ul>) const + 157
19 swift-frontend           0x000000010d9e847e swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::IRGenRequest const&, swift::Evaluator&) + 14
20 swift-frontend           0x000000010d9ba06a llvm::Expected<swift::IRGenRequest::OutputType> swift::Evaluator::getResultUncached<swift::IRGenRequest>(swift::IRGenRequest const&) + 346
21 swift-frontend           0x000000010d9b2f19 swift::performIRGeneration(swift::FileUnit*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::GlobalVariable**) + 313
22 swift-frontend           0x000000010d6dc218 performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 2504
23 swift-frontend           0x000000010d6db50e performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 350
24 swift-frontend           0x000000010d6d018e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 5214
25 swift-frontend           0x000000010d665042 main + 866
26 libdyld.dylib            0x00007fff203e4621 start + 1
error: Abort trap: 6 (in target 'MediaBeam' from project 'MediaBeam')
Terms of Service

Privacy Policy

Cookie Policy