Skip to content

Mark BufferedChannelIterator.continuation @BeningDataRace to address … #3873

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

Merged
merged 4 commits into from
Oct 23, 2023

Conversation

qwwdfsad
Copy link
Collaborator

…potential UB and OoTA on K/N

Fixes #3834

Copy link
Collaborator

@dkhalanskyjb dkhalanskyjb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could document this more reliably and intuitively, but other than that, everything looks good.

@@ -1583,6 +1583,7 @@ internal open class BufferedChannel<E>(
* continuation. The [tryResumeHasNext] and [tryResumeHasNextOnClosedChannel]
* function resume this continuation when the [hasNext] invocation should complete.
*/
@BenignDataRace // See its uses for the explanation of the race
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should explicitly list the races right next to the annotation. This way, if a new race is discovered, we won't look at the annotation and go, "oh yeah, we know about this race, it's benign, no worries."

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, fixed

*/
@BenignDataRace
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the explanation here, for example.

@qwwdfsad qwwdfsad requested a review from dkhalanskyjb October 20, 2023 16:14
@qwwdfsad qwwdfsad merged commit 2b5d93f into develop Oct 23, 2023
@qwwdfsad qwwdfsad deleted the tsan-races branch October 23, 2023 10:09
igoriakovlev pushed a commit that referenced this pull request Nov 2, 2023
* Mark BufferedChannelIterator.continuation as @BeningDataRace to address potential UB and OoTA on K/N
* Explain benign data-race on SelectImplementation.clauses and mark it with @BenignDataRace
* Explain benign data-race on SelectImplementation.internalResult and mark it with @BenignDataRace


Fixes #3834
Fixes #3843
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