[SR-14421] [Concurrency] Custom struct corrupted when passed from actor to Task context #56777
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
concurrency
Feature: umbrella label for concurrency language features
Environment
MacBook Air (M1, 2020)
MacOS 11.2.3 (20D91)
Swift Development Snapshot 2021-03-09 (a) Toolchain
Additional Detail from JIRA
md5: 89306ef47f247697c3e6447c2703caa6
Issue Description:
When custom struct (contains several UInt) passed from actor to task group value of the struct fields are corrupted. At the same time if I pass ints separated everything works fine.
I have created a separate branch on my project that reproduces the issue. https://github.com/makadaw/swift-raft/tree/conccurency-error
The app creates an instance of RequestVote.Request that is ConcurrentValue. Then it creates a bunch of tasks with Task.withGroup and uses instance inside the block. Inside the block struct keep the right values for properties, but when it passes into a async method properties corrupted.
To reproduce it open the project and run `local-cluster` target. After a moment app will break on the assert.
The text was updated successfully, but these errors were encountered: