Bug 201829 - SamplingProfiler should hold API lock before reporting results
Summary: SamplingProfiler should hold API lock before reporting results
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tadeu Zagallo
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-09-16 11:53 PDT by Tadeu Zagallo
Modified: 2019-09-16 13:49 PDT (History)
8 users (show)

See Also:


Attachments
Patch (1.79 KB, patch)
2019-09-16 12:55 PDT, Tadeu Zagallo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tadeu Zagallo 2019-09-16 11:53:06 PDT
...
Comment 1 Tadeu Zagallo 2019-09-16 12:55:14 PDT
Created attachment 378882 [details]
Patch
Comment 2 Yusuke Suzuki 2019-09-16 13:27:58 PDT
Comment on attachment 378882 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=378882&action=review

r=me with nit.

> Source/JavaScriptCore/runtime/SamplingProfiler.cpp:1029
> +        JSLockHolder holder(m_vm);

Can you ensure that this locking order (registerationLock -> APILock) is correct? (maybe, in practice, it does not matter).
Comment 3 Tadeu Zagallo 2019-09-16 13:31:49 PDT
Thanks for the review!

(In reply to Yusuke Suzuki from comment #2)
> Can you ensure that this locking order (registerationLock -> APILock) is
> correct? (maybe, in practice, it does not matter).

The registrationLock is only guarding the append to the HashSet, `reportDataToOptionFile` is actually called later, from within the `atexit` lambda.
Comment 4 WebKit Commit Bot 2019-09-16 13:48:44 PDT
Comment on attachment 378882 [details]
Patch

Clearing flags on attachment: 378882

Committed r249915: <https://trac.webkit.org/changeset/249915>
Comment 5 WebKit Commit Bot 2019-09-16 13:48:46 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2019-09-16 13:49:26 PDT
<rdar://problem/55412906>