Description
The root issue is a consistently reproducible crash which appears to be related to a concurrency/job-switching issue – details are at https://forums.swift.org/t/debugging-a-concurrency-crash/64179/.
The issue applies when building with Xcode 14.3 and targeting x86_64 macOS 13.3; the bug doesn't reproduce on ARM but that may also be because of behaviour differences in the test application. It was present in Xcode 14.2 but only when compiling without optimisations. I haven't been able to produce a reduced test case.
The application does use some unsafe constructs such as @_unsafeInheritExecutor
(e.g. in methods that wrap with_Continuation
), so it's possible the crash is a result of invalid/unsupported code rather than a compiler/runtime bug; however, if that's the case, it would still be useful to know the root cause if possible so I can work around it. I've tried eliminating the use of those attributes where possible and the application still crashes, so my assumption is that it's likely something else.