Skip to content

Conversation

@DougGregor
Copy link
Member

A compare_exchange_weak can spuriously return false, regardless of
whether a concurrent access happened. This was causing a null-pointer
dereference in TaskGroupImpl::poll in a narrow circumstance.

The dereference failure only appears when using the arm64
slice of the runtime library, since Clang will use ldxr/stxr for
synchronization on such targets. The weak form does not retry on a
spurious failure, but the strong version will.

resolves rdar://84192672

A `compare_exchange_weak` can spuriously return false, regardless of
whether a concurrent access happened. This was causing a null-pointer
dereference in TaskGroupImpl::poll in a narrow circumstance.

The dereference failure only appears when using the `arm64`
slice of the runtime library, since Clang will use `ldxr/stxr` for
synchronization on such targets. The weak form does not retry on a
spurious failure, but the strong version will.

resolves rdar://84192672

(cherry picked from commit 69e80a1)
@DougGregor DougGregor requested a review from a team as a code owner December 14, 2021 03:37
@DougGregor
Copy link
Member Author

@swift-ci please test

@shahmishal
Copy link
Member

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - a90c721

@shahmishal
Copy link
Member

@swift-ci test macOS

@shahmishal
Copy link
Member

@swift-ci test windows

@tkremenek
Copy link
Member

@swift-ci clean test

@shahmishal shahmishal merged commit b5f30b5 into swiftlang:release/5.5 Jan 24, 2022
@DougGregor DougGregor deleted the task-group-atomic-fix-5.5 branch January 25, 2022 01:51
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.

5 participants