Bug 116074 - Objective-C API: scanExternalObjectGraph should not create new JSVirtualMachine wrappers
Summary: Objective-C API: scanExternalObjectGraph should not create new JSVirtualMachi...
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Hahnenberg
Depends on:
Reported: 2013-05-13 16:30 PDT by Mark Hahnenberg
Modified: 2013-05-13 19:48 PDT (History)
0 users

See Also:

Patch (1.96 KB, patch)
2013-05-13 18:17 PDT, Mark Hahnenberg
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hahnenberg 2013-05-13 16:30:47 PDT
If it does, when the scanExternalObjectGraph call finishes and the autorelease pool is drained, we will dealloc the JSVirtualMachine which will cause us to try to take the API lock for the corresponding VM. If this happens on a GC thread other than the "main" thread, we will deadlock. The solution is to just check the VM cache, and if there is no JSVirtualMachine wrapper, return early.
Comment 1 Mark Hahnenberg 2013-05-13 18:17:28 PDT
Created attachment 201659 [details]
Comment 2 Mark Hahnenberg 2013-05-13 18:18:15 PDT
Comment 3 Mark Hahnenberg 2013-05-13 19:48:59 PDT
Committed r150050: <http://trac.webkit.org/changeset/150050>