-
-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mpmcq use-after-free bug (#4541)
according to address sanitizer, prior to this commit, the mpmcq node free could cause a use-after-free error from another thread that might still be reading from `tail->next`. This was technically safe in this context since the logic will end up looping due to the CAS failing in the while condition due to the aba counter being out of sync. This commit defers freeing of the nodes and instead recycles them for future pushes onto the mpmcq from the same thread to ensure that there are no use-after-free concerns any longer.
- Loading branch information
Showing
3 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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