Macro Package failing test runs on Linux when `swift-syntax` is 510.0.0

I recently expanded the testing matrix of my macro package. I have some GitHub actions that run on every push to main. I started testing Linux builds and I am seeing some strange failures. They seem to be on some narrow but consistent set of configuration variables.

Here is my testing matrix for macOS:

xcode-version:
  - "15.4"
  - "16.0"
  - "16.1"
  - "16.2"
  - "16.3"
swift-syntax-version:
  - "510.0.0"
  - "510.0.1"
  - "510.0.2"
  - "510.0.3"
  - "600.0.0"
  - "600.0.1"
  - "601.0.0"
  - "601.0.1"
configuration:
  - debug
  - release

Here is my testing matrix for Linux:

swift-version:
  - "5.10.1"
  - "6.0.0"
  - "6.0.1"
  - "6.0.2"
  - "6.0.3"
  - "6.1.0"
swift-syntax-version:
  - "510.0.0"
  - "510.0.1"
  - "510.0.2"
  - "510.0.3"
  - "600.0.0"
  - "600.0.1"
  - "601.0.0"
  - "601.0.1"
configuration:
  - debug
  - release

I then run the builds and test across those products.

All of my macOS build run pass.
All of my macOS test runs pass.
All of my Linux build runs pass.
The following Linux test runs are failing:

  • Swift 6.0.0 / swift-syntax 510.0.0 / debug
  • Swift 6.0.1 / swift-syntax 510.0.0 / debug
  • Swift 6.0.2 / swift-syntax 510.0.0 / debug
  • Swift 6.0.3 / swift-syntax 510.0.0 / debug

It's only this range of Swift toolchains… only this specific version of swift-syntax… only debug builds… and only when I run tests.

I have no idea what could be causing this… but I've run these all multiple times and I keep seeing the same failures. Whatever it is… it seems to be consistent.

Here is an example of what the output looks like:

Any ideas? Can anyone else reproduce a failure on that specific configuration on their macro package from Linux?

You are hitting the misaligned memory read issue that was fixed by [5.10] Change `load` to `loadUnaligned` by ahoppen · Pull Request #2534 · swiftlang/swift-syntax · GitHub in swift-syntax 510.0.1. This is a known issue in swift-syntax 510.0.0 and we released 510.0.1 to fix it.

1 Like

Hmm… the 6929 issue from SPM references x86_64 architecture… but I don't see more details from the issues connecting this back to Linux platforms. Did we have any reason to believe 510.0.0 would fail in a similar way building from macOS on x86_64?

I'm also seeing the failures on a narrow configuration… it is only when I build and test from debug that I am failing on Linux. I am able to build debug on Linux. I am also able to build and test release on Linux. Would we expect those configurations not to show the issue with probability one? Would we have any reason to believe this same issue could show up on any 510.0.0 Linux build with probability greater than zero?

Since the crash is about alignment, it makes sense that the crash is very architecture and build configuration dependent.

Also, since you are not seeing these issues when using swift-syntax 510.0.1, I am very certain that [5.10] Change `load` to `loadUnaligned` by ahoppen · Pull Request #2534 · swiftlang/swift-syntax · GitHub fixes the issue and since we couldn’t do anything about 510.0.0 apart from releasing a fixed version (which we did because 510.0.1 doesn’t show the issue anymore), there isn’t any action we could take here anyway.

1 Like