Fix race condition in test clock (backport #2819)#2821
Merged
MichaelOrlov merged 1 commit intojazzyfrom May 1, 2025
Merged
Conversation
Signed-off-by: pedroazeredo04 <pedro_azeredo@usp.br> Signed-off-by: Pedro Nogueira <pedro_azeredo@usp.br> (cherry picked from commit 8e49bef)
fujitatomoya
approved these changes
Apr 18, 2025
Collaborator
|
Pulls: #2821 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request intends to fix the issue #2804
In order to do so, I first ran helgrind on the code, and found that there existed a race condition in a vector of booleans. Afterwards, I changed this vector to
std::atomic_bool. With that, I ran the helgrind again, and found there was no more race condition.This is the full log of helgrind for the original code.
This is the full log of helgrind for the modified code.
Note that, since they are the full log of the helgrind, in both of these snippets, there are some unrelated warnings. However, by searching for
data raceinside this logs, it is possible to see that they were corrected.This is my first Pull Request, so if there are any changes I still have to do, please let me know.
(Edit: I just realized my signature in the commit was wrong. I believe I have corrected it, hopefully everything is OK now)
This is an automatic backport of pull request #2819 done by Mergify.