Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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 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
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 🙂

lib/acl_threadsupport/test/acl_threadsupport_test.cpp Outdated Show resolved Hide resolved
--------------------------------------------------------

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.
@pcolberg pcolberg merged commit 0efaa5d into intel:main Mar 4, 2022
# for free to join this conversation on GitHub. Already have an account? # 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