Skip to content

SILFunctionTransform Crash #85737

@timsneath

Description

@timsneath

Description

No response

Reproduction

Will provide privately -- it's not public code.

Stack dump

Building for production...
error: compile command failed due to signal 6 (use -v to see invocation)
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/timsneath/src/swift/z80/Sources/z80/Disassembler.swift /Users/timsneath/src/swift/z80/Sources/z80/Extensions/BinaryIntegerExtensions.swift /Users/timsneath/src/swift/z80/Sources/z80/Extensions/StringExtensions.swift /Users/timsneath/src/swift/z80/Sources/z80/Memory.swift /Users/timsneath/src/swift/z80/Sources/z80/Z80.swift /Users/timsneath/src/swift/z80/Sources/z80/Z80ExtendedInstructions.swift /Users/timsneath/src/swift/z80/Sources/z80/Z80Instructions.swift -supplementary-output-file-map /var/folders/4k/_xrxf7fj2mqd3nqt148nzrnc0000gn/T/TemporaryDirectory.AdXOj0/supplementaryOutputs-1 -target arm64-apple-macosx15.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.1.sdk -I /Users/timsneath/src/swift/z80/.build/arm64-apple-macosx/release/Modules -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks -color-diagnostics -Xcc -fcolor-diagnostics -enable-testing -g -debug-info-format=dwarf -dwarf-version=5 -module-cache-path /Users/timsneath/src/swift/z80/.build/arm64-apple-macosx/release/ModuleCache -swift-version 6 -O -D SWIFT_PACKAGE -D SWIFT_MODULE_RESOURCE_BUNDLE_UNAVAILABLE -new-driver-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing -file-compilation-dir /Users/timsneath/src/swift/z80 -Xcc -isysroot -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.1.sdk -Xcc -F -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Xcc -F -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks -Xcc -fPIC -Xcc -g -no-auto-bridging-header-chaining -module-name z80 -package-name z80 -disable-clang-spi -target-sdk-version 26.1 -target-sdk-name macosx26.1 -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 -in-process-plugin-server-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -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 -enable-default-cmo -parse-as-library -num-threads 8 -o /Users/timsneath/src/swift/z80/.build/arm64-apple-macosx/release/z80.build/Disassembler.swift.o -o /Users/timsneath/src/swift/z80/.build/arm64-apple-macosx/release/z80.build/BinaryIntegerExtensions.swift.o -o /Users/timsneath/src/swift/z80/.build/arm64-apple-macosx/release/z80.build/StringExtensions.swift.o -o /Users/timsneath/src/swift/z80/.build/arm64-apple-macosx/release/z80.build/Memory.swift.o -o /Users/timsneath/src/swift/z80/.build/arm64-apple-macosx/release/z80.build/Z80.swift.o -o /Users/timsneath/src/swift/z80/.build/arm64-apple-macosx/release/z80.build/Z80ExtendedInstructions.swift.o -o /Users/timsneath/src/swift/z80/.build/arm64-apple-macosx/release/z80.build/Z80Instructions.swift.o
1.	Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1)
2.	Compiling with the current language version
3.	While evaluating request ExecuteSILPipelineRequest(Run pipelines { Mandatory Diagnostic Passes + Enabling Optimization Passes } on SIL for z80)
4.	While running pass #11579 SILFunctionTransform "SendNonSendable" on SILFunction "@$s3z803Z80V18cbInstructionTableSayySpyACGXfGvpZfiyAEXfSiXEfU_".
 for expression at [/Users/timsneath/src/swift/z80/Sources/z80/Z80ExtendedInstructions.swift:12:66 - line:37:5] RangeText="{ code in
        let x = code >> 6
        let y = Int((code & 0x38) >> 3)
        let z = Int(code & 0x07)
        let isHL = z == 0x06
        let isBitOnHL = isHL && code > 0x40 && code < 0x7F
        return { cpuPtr in
            var cpu = cpuPtr.pointee
            switch x {
            case 0:
                cpu.rotate(operation: y, register: z)
            case 1:
                cpu.BIT(bitToTest: y, register: z)
            case 2:
                cpu.RES(bitToReset: y, register: z)
            default:
                cpu.SET(bitToSet: y, register: z)
            }
            if isHL {
                cpu.tStates += isBitOnHL ? 12 : 15
            } else {
                cpu.tStates += 8
            }
            cpuPtr.pointee = cpu
        }
    "
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           0x000000010b0a5eb4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x000000010b0a3844 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x000000010b0a64e0 SignalHandler(int, __siginfo*, void*) + 344
3  libsystem_platform.dylib 0x000000019ec3f744 _sigtramp + 56
4  libsystem_pthread.dylib  0x000000019ec35888 pthread_kill + 296
5  libsystem_c.dylib        0x000000019eb3a850 abort + 124
6  swift-frontend           0x0000000105e314fc swift::Partition::assignElement(swift::PartitionPrimitives::Element, swift::PartitionPrimitives::Element, bool) + 96
7  swift-frontend           0x0000000105989b84 swift::RegionAnalysisFunctionInfo::runDataflow() + 6024
8  swift-frontend           0x000000010598d430 swift::RegionAnalysis::newFunctionAnalysis(swift::SILFunction*) + 1672
9  swift-frontend           0x0000000105bf0b5c (anonymous namespace)::SendNonSendable::run() + 292
10 swift-frontend           0x0000000105c2fca4 swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) + 3556
11 swift-frontend           0x0000000105c2bcc4 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 11988
12 swift-frontend           0x0000000105c4eb28 swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 52
13 swift-frontend           0x0000000105c328e4 swift::ExecuteSILPipelineRequest::OutputType swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest, swift::ExecuteSILPipelineRequest::OutputType swift::evaluateOrFatal<swift::ExecuteSILPipelineRequest>(swift::Evaluator&, swift::ExecuteSILPipelineRequest)::'lambda'()>(swift::ExecuteSILPipelineRequest const&, swift::ExecuteSILPipelineRequest::OutputType swift::evaluateOrFatal<swift::ExecuteSILPipelineRequest>(swift::Evaluator&, swift::ExecuteSILPipelineRequest)::'lambda'()) + 412
14 swift-frontend           0x0000000105c34ec0 swift::runSILDiagnosticPasses(swift::SILModule&) + 416
15 swift-frontend           0x00000001050db4ac swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 656
16 swift-frontend           0x0000000104cdff18 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*) + 1360
17 swift-frontend           0x0000000104cdf874 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 2680
18 swift-frontend           0x0000000104ce2534 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1764
19 swift-frontend           0x0000000104ce1144 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3580
20 swift-frontend           0x0000000104c62724 swift::mainEntry(int, char const**) + 5412
21 dyld                     0x000000019e86dd54 start + 7184

error: fatalError

Expected behavior

No crash :)

Environment

swift-driver version: 1.127.14.1 Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1)
Target: arm64-apple-macosx26.0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwaretriage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions