Swift 5.5 has serious stack corruption bugs!

i am able to reproduce on linux, using the builtin SIMD4<T> type. the issue also affects the 5.5-RELEASE toolchain. moreover, it occurs even with a single child task, returning a single constant SIMD value.

@main
enum Main
{
    static
    func main() async
    {
        await withTaskGroup(of: SIMD4<Int32>.self) 
        { 
            (group:inout TaskGroup) in
            group.addTask 
            {
                return SIMD4<Int32>.init(repeating: 0)
            }
        }
    }
}
$ swiftc --version
Swift version 5.5 (swift-5.5-RELEASE)
Target: x86_64-unknown-linux-gnu
$ swiftc -O -parse-as-library async-stack-corruption-simd.swift 
$ ./async-stack-corruption-simd 
Segmentation fault (core dumped)

have you filed a bug on bugs.swift.org? it might help to link it to the other issues here

3 Likes