Skip to content

Conversation

@ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 5, 2024

We used C atomics but these were allocated as Swift variables. Even thought they were atomic, concurrent accesses to them could violate Swift’s exclusivity laws, raising thread sanitizer errors.

Allocate the C atomics using malloc to fix this problem.

rdar://129170128

@ahoppen ahoppen requested review from bnbarham and hamishknight June 5, 2024 17:46
@ahoppen ahoppen requested a review from benlangmuir as a code owner June 5, 2024 17:46
@ahoppen
Copy link
Member Author

ahoppen commented Jun 5, 2024

@swift-ci Please test

@ahoppen ahoppen force-pushed the atomics_on_heap branch from fee2156 to 204dd33 Compare June 6, 2024 04:30
@ahoppen
Copy link
Member Author

ahoppen commented Jun 6, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Jun 6, 2024

@swift-ci Please test Windows

We used C atomics but these were allocated as Swift variables. Even thought they were atomic, concurrent accesses to them could violate Swift’s exclusivity laws, raising thread sanitizer errors.

Allocate the C atomics using malloc to fix this problem.

rdar://129170128
@ahoppen ahoppen force-pushed the atomics_on_heap branch from 204dd33 to 556fd33 Compare June 6, 2024 06:27
@ahoppen
Copy link
Member Author

ahoppen commented Jun 6, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Jun 6, 2024

@swift-ci Please test Windows

@ahoppen ahoppen merged commit efd7f99 into swiftlang:main Jun 6, 2024
@ahoppen ahoppen deleted the atomics_on_heap branch June 6, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants