Skip to content

Compile crash non import of non existing module #70657

@mr-swifter

Description

@mr-swifter

Description

I've removed dependency from swift package, but didn't remove import of a removed module. Compiler crashes.

Reproduction

Stack dump

Stack dump:
0.	Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/ChannelHandler.swift /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/DiscoveryManager.swift /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/DistributedSystem.swift /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/DistributedSystemErrors.swift /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/DistributedSystemServer.swift /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/EndpointIdentifier+Coding.swift /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/InstanceIdentifier+Coding.swift /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/InvocationEnvelope.swift -primary-file /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/NetworkAddress.swift -primary-file /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/PingService.swift /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/RemoteCallDecoder.swift /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/RemoteCallEncoder.swift /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/RemoteCallResultHandler.swift /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/ServiceIdentifier+Coding.swift /Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/SyncCallManager.swift -emit-dependencies-path /Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/DistributedSystem.build/NetworkAddress.d -emit-reference-dependencies-path /Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/DistributedSystem.build/NetworkAddress.swiftdeps -emit-dependencies-path /Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/DistributedSystem.build/PingService.d -emit-reference-dependencies-path /Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/DistributedSystem.build/PingService.swiftdeps -target arm64-apple-macosx14.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -I /Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug -I /Users/ordo/Dev/PRs/package-distributed-system/.build/artifacts/package-frostflake-xcframework/FrostflakeKit/FrostflakeKit.xcframework/macos-arm64 -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -color-diagnostics -enable-testing -g -module-cache-path /Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -enable-experimental-feature AccessLevelOnImport -empty-abi-descriptor -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -I -Xcc /Users/ordo/Dev/PRs/package-distributed-system/.build/artifacts/package-frostflake-xcframework/FrostflakeKit/FrostflakeKit.xcframework/macos-arm64 -Xcc -fmodule-map-file=/Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/CNIOLLHTTP.build/module.modulemap -Xcc -I -Xcc /Users/ordo/Dev/PRs/package-distributed-system/.build/checkouts/swift-nio/Sources/CNIOLLHTTP/include -Xcc -fmodule-map-file=/Users/ordo/Dev/PRs/package-distributed-system/.build/checkouts/swift-nio/Sources/CNIOWindows/include/module.modulemap -Xcc -I -Xcc /Users/ordo/Dev/PRs/package-distributed-system/.build/checkouts/swift-nio/Sources/CNIOWindows/include -Xcc -fmodule-map-file=/Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/CNIOLinux.build/module.modulemap -Xcc -I -Xcc /Users/ordo/Dev/PRs/package-distributed-system/.build/checkouts/swift-nio/Sources/CNIOLinux/include -Xcc -fmodule-map-file=/Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/CNIODarwin.build/module.modulemap -Xcc -I -Xcc /Users/ordo/Dev/PRs/package-distributed-system/.build/checkouts/swift-nio/Sources/CNIODarwin/include -Xcc -fmodule-map-file=/Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/CNIOAtomics.build/module.modulemap -Xcc -I -Xcc /Users/ordo/Dev/PRs/package-distributed-system/.build/checkouts/swift-nio/Sources/CNIOAtomics/include -Xcc -fmodule-map-file=/Users/ordo/Dev/PRs/package-distributed-system/.build/checkouts/swift-atomics/Sources/_AtomicsShims/include/module.modulemap -Xcc -I -Xcc /Users/ordo/Dev/PRs/package-distributed-system/.build/checkouts/swift-atomics/Sources/_AtomicsShims/include -Xcc -fmodule-map-file=/Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/_PauseShims.build/module.modulemap -Xcc -I -Xcc /Users/ordo/Dev/PRs/package-distributed-system/.build/checkouts/package-concurrency-helpers/Sources/_PauseShims/include -Xcc -isysroot -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -Xcc -F -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Xcc -fPIC -module-name DistributedSystem -package-name package_distributed_system -disable-clang-spi -target-sdk-version 14.2 -target-sdk-name macosx14.2 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -parse-as-library -o /Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/DistributedSystem.build/NetworkAddress.swift.o -o /Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/DistributedSystem.build/PingService.swift.o -index-store-path /Users/ordo/Dev/PRs/package-distributed-system/.build/arm64-apple-macosx/debug/index/store -index-system-modules
1.	Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
2.	Compiling with the current language version
3.	While evaluating request TypeCheckSourceFileRequest(source_file "/Users/ordo/Dev/PRs/package-distributed-system/Sources/DistributedSystem/PingService.swift")
4.	While evaluating request TypeCheckFunctionBodyRequest(DistributedSystem.(file).PingServiceEndpoint.ping())
5.	While evaluating request ParseAbstractFunctionBodyRequest(DistributedSystem.(file).PingServiceEndpoint.ping())
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x0000000105161abc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000107dc7cb0 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000107b31054 SignalHandler(int) + 352
3  libsystem_platform.dylib 0x000000018df59a24 _sigtramp + 56
4  swift-frontend           0x0000000106e10c14 deriveBodyDistributed_thunk(swift::AbstractFunctionDecl*, void*) + 23200
5  swift-frontend           0x000000010538a040 swift::SimpleRequest<swift::ParseAbstractFunctionBodyRequest, swift::BodyAndFingerprint (swift::AbstractFunctionDecl*), (swift::RequestFlags)4>::evaluateRequest(swift::ParseAbstractFunctionBodyRequest const&, swift::Evaluator&) + 308
6  swift-frontend           0x00000001056dfcf8 swift::ParseAbstractFunctionBodyRequest::OutputType swift::evaluateOrDefault<swift::ParseAbstractFunctionBodyRequest>(swift::Evaluator&, swift::ParseAbstractFunctionBodyRequest, swift::ParseAbstractFunctionBodyRequest::OutputType) + 1136
7  swift-frontend           0x000000010567aee4 swift::AbstractFunctionDecl::getBody(bool) const + 304
8  swift-frontend           0x0000000107af4e68 swift::TypeCheckFunctionBodyRequest::evaluate(swift::Evaluator&, swift::AbstractFunctionDecl*) const + 236
9  swift-frontend           0x00000001056e0e58 swift::TypeCheckFunctionBodyRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckFunctionBodyRequest>(swift::Evaluator&, swift::TypeCheckFunctionBodyRequest, swift::TypeCheckFunctionBodyRequest::OutputType) + 884
10 swift-frontend           0x000000010508e9a8 swift::TypeCheckSourceFileRequest::evaluate(swift::Evaluator&, swift::SourceFile*) const + 608
11 swift-frontend           0x0000000105094658 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultUncached<swift::TypeCheckSourceFileRequest>(swift::TypeCheckSourceFileRequest const&) + 664
12 swift-frontend           0x0000000105072a4c swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType) + 228
13 swift-frontend           0x0000000105749a8c swift::CompilerInstance::performSema() + 160
14 swift-frontend           0x00000001076a4504 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 464
15 swift-frontend           0x00000001076a8854 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 4568
16 swift-frontend           0x000000010770fd44 swift::mainEntry(int, char const**) + 4408
17 dyld                     0x000000018dbb1058 start + 2224

Expected behavior

Compilation error

Environment

swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwaredistributedFeature → concurrency: distributed actormissing infoResolution: Is missing crucial info such as a test case or a concise descriptionswift 5.9type checkerArea → compiler: Semantic analysis

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions