Skip to content

Swift 6.0.x crash on win/arm64 Release build #77220

Open
@nil4

Description

@nil4

Description

A compiler crash (assertion failure) occurs with swift build --configuration release on Windows ARM64. This is reproducible with Swift 6.0 and 6.0.1. With both Swift versions, the same code compiles without issue in debug configuration, or release on x64.

Summary of observed results:

Swift version Architecture Configuration Result
6.0 arm64 release 💥 crash
6.0 arm64 debug ✅ works
6.0 x64 release ✅ works -- https://github.com/royalapplications/royalvnc/actions/runs/11513028067/job/32049003371#step:7:909
6.0.1 arm64 release 💥 crash
6.0.1 arm64 debug ✅ works
6.0.1 x64 release ✅ works -- https://github.com/royalapplications/royalvnc/actions/runs/11513740438/job/32051009618#step:7:910

Reproduction

Clone the repo and check out the relevant commit:

> git clone https://github.com/royalapplications/royalvnc.git
> cd royalvnc
> git reset aaca28ae04a93615489e3a6ab9f21b6f6bf51086 --hard

Run swift build and observe the debug build succeds:

> swift build
Building for debugging...
[<<< build output elided >>>]
Build complete! (73.07s)

Run swift build --configuration release and observe assertion failure and build crash:

> swift build --configuration release
Building for production...
error: compile command failed due to exception 3 (use -v to see invocation)
error: failed parsing the Swift compiler output: unexpected JSON message: {
  "exception" : 3,
  "kind" : "abnormal-exit",
  "name" : "compile",
  "output" : "Assertion failed: getAlign() && *getAlign() == Align && \"Alignment representation error!\", file C:\\Users\\swift-ci\\jenkins\\workspace\\swift-6.0.0-windows-toolchain-arm64\\llvm-project\\llvm\\lib\\IR\\Globals.cpp, line 140\r\nPlease submit a bug report (https:\/\/swift.org\/contributing\/#reporting-bugs) and include the crash backtrace.\r\nException Code: 0x80000003\r\nAssertion failed: getAlign() && *getAlign() == Align && \"Alignment representation error!\", file Rename failed: C:\\dev\\royalvnc\\.build\\aarch64-unknown-windows-msvc\\release\\RoyalVNCKit.build\\VNCRegion+CG.swift-fb46aa97.o.tmpC:\\Users\\swift-ci\\jenkins\\workspace\\swift-6.0.0-windows- -> toolchain-arm64\\llvm-project\\llvm\\lib\\IR\\Globals.cpp,C:\\dev\\royalvnc\\.build\\aarch64-unknown-windows-msvc\\release\\RoyalVNCKit.build\\VNCRegion+CG.swift.o line 140\r\n: permission denied\r\n",
  "pid" : 3180,
  "process" : {
    "real_pid" : 3180
  }
}: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "kind", intValue: nil)], debugDescription: "invalid kind", underlyingError: nil))

Stack dump

> swift build --configuration release
Building for production...
error: compile command failed due to exception 3 (use -v to see invocation)
error: failed parsing the Swift compiler output: unexpected JSON message: {
  "exception" : 3,
  "kind" : "abnormal-exit",
  "name" : "compile",
  "output" : "Assertion failed: getAlign() && *getAlign() == Align && \"Alignment representation error!\", file C:\\Users\\swift-ci\\jenkins\\workspace\\swift-6.0.0-windows-toolchain-arm64\\llvm-project\\llvm\\lib\\IR\\Globals.cpp, line 140\r\nPlease submit a bug report (https:\/\/swift.org\/contributing\/#reporting-bugs) and include the crash backtrace.\r\nException Code: 0x80000003\r\nAssertion failed: getAlign() && *getAlign() == Align && \"Alignment representation error!\", file Rename failed: C:\\dev\\royalvnc\\.build\\aarch64-unknown-windows-msvc\\release\\RoyalVNCKit.build\\VNCRegion+CG.swift-fb46aa97.o.tmpC:\\Users\\swift-ci\\jenkins\\workspace\\swift-6.0.0-windows- -> toolchain-arm64\\llvm-project\\llvm\\lib\\IR\\Globals.cpp,C:\\dev\\royalvnc\\.build\\aarch64-unknown-windows-msvc\\release\\RoyalVNCKit.build\\VNCRegion+CG.swift.o line 140\r\n: permission denied\r\n",
  "pid" : 3180,
  "process" : {
    "real_pid" : 3180
  }
}: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "kind", intValue: nil)], debugDescription: "invalid kind", underlyingError: nil))

Expected behavior

The assertion failure observed with arm64/release is unexpected. The build should work the same as arm64/debug locally, and x64/release on GitHub CI -- producing a compile error, or completing successfully.

Environment

> swiftc --version
Swift version 6.0.1 (swift-6.0.1-RELEASE)
Target: aarch64-unknown-windows-msvc

> ver
Microsoft Windows [Version 10.0.22621.4317]

Additional information

ref. royalapplications/royalvnc#11 (comment)

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