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

Fix TSAN issues in thread support library #89

Merged
merged 1 commit into from
Mar 4, 2022

Conversation

sherry-yuan
Copy link
Contributor

The issue was the test is attempting to check for change in variable through a while loop, but did not protect the data read using mutext lock. This could potentially lead to reading of unexpected data and cause a tsan error.

The fix wraps the checks for variable state inside the mutex lock.

Closes #71
Unblock #63

@sherry-yuan sherry-yuan requested a review from pcolberg March 4, 2022 19:06
@sherry-yuan sherry-yuan self-assigned this Mar 4, 2022
@sherry-yuan sherry-yuan added the bug Something isn't working label Mar 4, 2022
@sherry-yuan sherry-yuan added this to the 2022.3 milestone Mar 4, 2022
@sherry-yuan sherry-yuan force-pushed the thread_support_tsan_fix branch from f3a7fd2 to 329a433 Compare March 4, 2022 19:32
Copy link
Contributor

@pcolberg pcolberg left a comment

Choose a reason for hiding this comment

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

This is great @sherry-yuan, thanks for figuring this out 🙂

--------------------------------------------------------

The issue was the test is attempting to check for change in variable through a while loop, but did not protect the data read using mutext lock. This could potentially lead to reading of unexpected data and cause a tsan error.

The fix wraps the checks for variable state inside the mutex lock.
@sherry-yuan sherry-yuan force-pushed the thread_support_tsan_fix branch from 329a433 to b308b72 Compare March 4, 2022 21:54
@sherry-yuan sherry-yuan requested a review from pcolberg March 4, 2022 21:56
@pcolberg pcolberg merged commit 0efaa5d into intel:main Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TSAN Detected Data Race: Fix or Note as False Positive
2 participants