swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
66.77k stars 10.29k forks source link

[SR-15062] Compiler crash with message "Instruction does not dominate all uses!" when compiling swift-system for Xcode Previews #57389

Open sharplet opened 2 years ago

sharplet commented 2 years ago
Previous ID SR-15062
Radar rdar://problem/81906829
Original Reporter @sharplet
Type Bug
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: f9eeb5afa37d555d679f4b7034de9021

Issue Description:

Instruction does not dominate all uses!
  %24 = getelementptr inbounds %"$s13SystemPackage8FilePathV10componentsAC13ComponentViewVvM.Frame", %"$s13SystemPackage8FilePathV10componentsAC13ComponentViewVvM.Frame"* %22, i32 0, i32 0, !dbg !411
  %11 = bitcast %T13SystemPackage8FilePathV13ComponentViewV* %24 to i8*
<unknown>:0: error: fatal error encountered during compilation; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
<unknown>:0: note: Broken function
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.  Program arguments: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/Errno.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/FileDescriptor.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/FileHelpers.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/FileOperations.swift -primary-file ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/FilePath/FilePath.swift -primary-file ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/FilePath/FilePathComponentView.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/FilePath/FilePathComponents.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/FilePath/FilePathParsing.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/FilePath/FilePathString.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/FilePath/FilePathSyntax.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/FilePath/FilePathWindows.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/FilePermissions.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/Internals/CInterop.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/Internals/Constants.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/Internals/Exports.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/Internals/Mocking.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/Internals/Syscalls.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/Internals/WindowsSyscallAdapters.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/PlatformString.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/SystemString.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/Util.swift ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/System/UtilConsumers.swift -emit-module-path "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePath~partial.swiftmodule" -emit-module-doc-path "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePath~partial.swiftdoc" -emit-module-source-info-path "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePath~partial.swiftsourceinfo" -emit-dependencies-path "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePath.d" -emit-reference-dependencies-path "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePath.swiftdeps" -serialize-diagnostics-path "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePath.dia" -emit-module-path "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePathComponentView~partial.swiftmodule" -emit-module-doc-path "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePathComponentView~partial.swiftdoc" -emit-module-source-info-path "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePathComponentView~partial.swiftsourceinfo" -emit-dependencies-path "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePathComponentView.d" -emit-reference-dependencies-path "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePathComponentView.swiftdeps" -serialize-diagnostics-path "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePathComponentView.dia" -target x86_64-apple-macos10.10 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -I "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Products/Debug" -I /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Products/Debug/PackageFrameworks" -F "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Products/Debug" -F /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -application-extension -enable-testing -g -module-cache-path ~/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D SWIFT_PACKAGE -D DEBUG -D SYSTEM_PACKAGE -D ENABLE_MOCKING -D Xcode -new-driver-path /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -serialize-debugging-options -enable-implicit-dynamic -enable-private-imports -enable-dynamic-replacement-chaining -disable-previous-implementation-calls-in-dynamic-replacements -Xcc -working-directory -Xcc ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system -resource-dir /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc "-I~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/swift-overrides.hmap" -Xcc -I~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/SourcePackages/checkouts/swift-system/Sources/CSystem/include -Xcc "-I~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Products/Debug/include" -Xcc "-I~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/DerivedSources-normal/x86_64" -Xcc "-I~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/DerivedSources/x86_64" -Xcc "-I~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/DerivedSources" -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG=1 -module-name SystemPackage -target-sdk-version 12.0.0 -o "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePath.o" -o "~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePathComponentView.o" -index-store-path ~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Index/DataStore -index-system-modules
1.  Apple Swift version 5.5 (swiftlang-1300.0.29.102 clang-1300.0.28.1)
2.  
3.  Running pass 'CallGraph Pass Manager' on module '~/Library/Developer/Xcode/DerivedData/Handbook-fbhewdvixcmfwwabejugvbheihww/Build/Intermediates.noindex/Previews/Handbook (macOS)/Intermediates.noindex/swift-system.build/Debug/SystemPackage.build/Objects-normal/x86_64/FilePathComponentView.o'.
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           0x0000000106bf9797 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1  swift-frontend           0x0000000106bf8728 llvm::sys::RunSignalHandlers() + 248
2  swift-frontend           0x0000000106bf9da6 SignalHandler(int) + 278
3  libsystem_platform.dylib 0x00007ff806c9706d _sigtramp + 29
4  libsystem_platform.dylib 000000000000000000 _sigtramp + 18446603370467069872
5  libsystem_c.dylib        0x00007ff806bd3d10 abort + 123
6  swift-frontend           0x0000000101d279f2 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$_2::__invoke(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 978
7  swift-frontend           0x0000000106b4320e llvm::report_fatal_error(llvm::Twine const&, bool) + 286
8  swift-frontend           0x0000000106b430eb llvm::report_fatal_error(char const*, bool) + 43
9  swift-frontend           0x0000000104855183 postSplitCleanup(llvm::Function&) + 531
10 swift-frontend           0x000000010485acde (anonymous namespace)::CoroSplitLegacy::runOnSCC(llvm::CallGraphSCC&) + 2526
11 swift-frontend           0x00000001064c0812 (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) + 1346
12 swift-frontend           0x0000000106a74615 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1061
13 swift-frontend           0x000000010220b802 swift::performLLVMOptimizations(swift::IRGenOptions const&, llvm::Module*, llvm::TargetMachine*) + 2242
14 swift-frontend           0x000000010220c3c7 swift::performLLVM(swift::IRGenOptions const&, swift::DiagnosticEngine&, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, llvm::StringRef, swift::UnifiedStatsReporter*) + 2039
15 swift-frontend           0x0000000101d33179 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*) + 3529
16 swift-frontend           0x0000000101d24836 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 13494
17 swift-frontend           0x0000000101c66548 main + 1032
18 dyld                     0x00000001140d54d5 start + 421
19 dyld                     000000000000000000 start + 18446744069078166736
20 swift-frontend           0x0000000101c44000 __dso_handle + 0
error: Abort trap: 6 (in target 'SystemPackage' from project 'swift-system')
typesanitizer commented 2 years ago

@swift-ci create