Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-14421] [Concurrency] Custom struct corrupted when passed from actor to Task context #56777

Closed
swift-ci opened this issue Mar 29, 2021 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. concurrency Feature: umbrella label for concurrency language features

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-14421
Radar rdar://problem/75985086
Original Reporter makadaw (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

MacBook Air (M1, 2020)

MacOS 11.2.3 (20D91)

Swift Development Snapshot 2021-03-09 (a) Toolchain

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug, Concurrency
Assignee makadaw (JIRA)
Priority Medium

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.

@ktoso
Copy link
Member

ktoso commented Mar 30, 2021

@swift-ci create

@jckarter
Copy link
Member

jckarter commented Apr 9, 2021

Looks like this is working now in top-of-tree. I built a toolchain from yesterday's main, checked out your `conccurency-error` branch, let it run for a couple minutes, and I'm not seeing an assertion failure. We fixed a bunch of memory management and correctness bugs in the task and actor runtime implementation in the past month, so this well could've been one of those same issues. Are you able to reproduce the problem in a newer snapshot (once they build)?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. concurrency Feature: umbrella label for concurrency language features
Projects
None yet
Development

No branches or pull requests

3 participants