Skip to content

[TSan] Do not report benign race on _swiftEmptyArrayStorage #28529

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

Closed
wants to merge 2 commits into from

Conversation

yln
Copy link
Contributor

@yln yln commented Dec 3, 2019

Cherry-picks for rdar://55161564 (Unexpected TSAN error against _swiftEmptyArrayStorage).
#27808

yln added 2 commits December 2, 2019 16:26
A previous commit [1] identified and fixed a benign race on
`_swiftEmptyArrayStorage`.  Unfortunately, we have some code duplication
and the fix was not applied to all the necessary places.  Essentially,
we need to ensure that the "empty array storage" object that backs many
"array like types" is never written to.

I tried to improve the test to capture this, however, it is very
finicky.  Currently, it does not go red on my system even when I remove
the check to avoid the benign race in Release mode.

Relevant classes: Array, ArraySlice, ContiguousArray, ArrayBuffer,
ContiguousArrayBuffer, SliceBuffer.

[1] b9b4c78

rdar://55161564
(cherry picked from commit 381dcc2)
Remove the argument label to reduce the verbosity in the test.

(cherry picked from commit ada44cb)
@yln yln requested a review from a team as a code owner December 3, 2019 00:29
@yln yln self-assigned this Dec 3, 2019
@yln
Copy link
Contributor Author

yln commented Dec 3, 2019

@swift-ci Please test

@yln yln requested review from mikeash and lorentey December 3, 2019 00:30
@swift-ci
Copy link
Contributor

swift-ci commented Dec 3, 2019

Build failed
Swift Test Linux Platform
Git Sha - 8024eb0

@yln
Copy link
Contributor Author

yln commented Dec 3, 2019

@swift-ci Please test Linux

Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

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

👍

@yln
Copy link
Contributor Author

yln commented Dec 3, 2019

@apple/swift5-branch-managers

@yln
Copy link
Contributor Author

yln commented Dec 4, 2019

It's too late in the integration cycle.

@yln yln closed this Dec 4, 2019
@yln yln deleted the tsan-empty-array-storage branch December 4, 2019 18:07
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.

4 participants