forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sampling heap profiler] Fix a deadlock.
Profiler functions used to lock the mutex first and then update the entered_ TLS variable. That caused the following sequence leading to a deadlock: 1. In DoRecordAlloc it locks the mutex and then calls entered_.Set(true) 2. If this happens to be the very first access to TLS, it causes internal TLS vector to be allocated. 3. It then reenters DoRecordAlloc, the entered_.Get() is still false since chromium#1 is not yet finished. 4. Thus it proceed to locking the mutex again. The fix is basically swapping the order of mutex locking and entered_.Set(true). BUG=842396 Change-Id: I926c05755321c082215ca84bfc312348c89ecdca Reviewed-on: https://chromium-review.googlesource.com/1056412 Commit-Queue: Alexei Filippov <alph@chromium.org> Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Cr-Commit-Position: refs/heads/master@{#558122}
- Loading branch information
Showing
1 changed file
with
48 additions
and
37 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