Fix thread-safety issue in LockGuard and ScopedLock by using atomic operations for shared_ptr.#3324
Closed
kevingpqi123 wants to merge 1 commit intomainfrom
Closed
Fix thread-safety issue in LockGuard and ScopedLock by using atomic operations for shared_ptr.#3324kevingpqi123 wants to merge 1 commit intomainfrom
kevingpqi123 wants to merge 1 commit intomainfrom
Conversation
…perations for shared_ptr.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3324 +/- ##
==========================================
- Coverage 75.25% 75.25% -0.01%
==========================================
Files 503 503
Lines 33299 33300 +1
Branches 10739 10630 -109
==========================================
Hits 25060 25060
+ Misses 6031 6027 -4
- Partials 2208 2213 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
改法增加了内存越界访问的风险,要继续分析真正的crash原因,不是这么修改。 |
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.
Fix a race condition in lock acquisition: when one thread was about to lock rootLocker, another thread could call updateRootLocker to replace the shared_ptr, potentially destroying the mutex before the first thread locked it.
Changes: