Bug 302540

Summary: VMManager::singleton() is not thread safe.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Mark Lam
Reported 2025-11-14 10:35:23 PST
VMManager::singleton() may be called concurrently from multiple threads. Hence, the initialization of the singleton instance needs to be done in a thread safe manner. To fix this, we'll switch from using a NeverDestroyed<VMManager> to a LazyNeverDestroyed<VMManager>, and initialize it within a std::call_once, which is thread safe. rdar://116953427
Attachments
Mark Lam
Comment 1 2025-11-14 10:35:44 PST
Correction, radar link should be: rdar://164580639
Mark Lam
Comment 2 2025-11-14 10:51:13 PST
EWS
Comment 3 2025-11-14 12:51:24 PST
Committed 303054@main (01e8c830aad1): <https://commits.webkit.org/303054@main> Reviewed commits have been landed. Closing PR #53944 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.