Open vanvoorden opened 1 week ago
@AnthonyLatsis Would you know if we were tracking anything related to this? This crash seems to be fixed in 6.0… but I don't know if someone landed a fix to this issue directly or this fix came along implicitly with a fix for a different issue. Were there any related 5.10 workarounds to another issue that might workaround this one before 6.0 ships? Thanks!
Description
https://forums.swift.org/t/non-deterministic-5-10-compiler-failures-from-predictablememoryaccessoptimizations-and-swift-5-10/72630
This is a repro for a
PredictableMemoryAccessOptimizations
crash I originally saw in another project. There's a lot going on in that project… I attempted to look for a more "clean" repro. This is now reporting as aLoadableByAddress
crash… but the code is following a similar pattern to my other project.This crash seems to be non-deterministic… sometimes it crashes… sometimes it doesn't.
This code does not (for now) crash for me from the 6.0 toolchain. I'm only seeing the crashes from production Swift 5.10 (and Xcode 15.4).
It looks like this will be fixed once 6.0 goes live in Q3. I would really like to find some kind of workaround that could unblock me when building from production Xcode 15.4. Any ideas for that would be great!
Reproduction
This code does not crash with probability one. I can clean and build again and I eventually see a crash.
Saving the parameter pack elements as the return values of a closure pack seems to be important to the crash. It also seems to be important for the repeating element type to be a generic type.
I can prevent the crash with probability one by not saving the closure pack to a variable:
Stack dump
Environment
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4) Target: arm64-apple-macosx14.0