Bug 131406

Summary: Web Inspector: Prevent deadlocks receiving WIRPermissionDenied message
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, mrowe, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
timothy: review+
[PATCH] For Landing none

Joseph Pecoraro
Reported 2014-04-08 16:13:52 PDT
When processing the WIRPermissionDenied message we have to avoid grabs of the mutex in RemoteInspector and RemoteInspectorXPCConnection. Address both of these by creating a stop/close path that takes locks, and a path that does not take locks.
Attachments
[PATCH] Proposed Fix (4.68 KB, patch)
2014-04-08 16:22 PDT, Joseph Pecoraro
timothy: review+
[PATCH] For Landing (4.67 KB, patch)
2014-04-08 16:43 PDT, Joseph Pecoraro
no flags
Radar WebKit Bug Importer
Comment 1 2014-04-08 16:14:07 PDT
Joseph Pecoraro
Comment 2 2014-04-08 16:22:41 PDT
Created attachment 228907 [details] [PATCH] Proposed Fix Tested with a daemon that always responded with WIRPermissionDenied, and this fixes the issue.
Timothy Hatcher
Comment 3 2014-04-08 16:37:09 PDT
Comment on attachment 228907 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=228907&action=review > Source/JavaScriptCore/inspector/remote/RemoteInspector.h:68 > + enum StopSource { StopSourceAPI, StopSourceXPCMessage }; IIRC, we don't typically repeat the enum name. So: enum StopSource { API, XPCMessage }; But I could be wrong.
Joseph Pecoraro
Comment 4 2014-04-08 16:39:06 PDT
(In reply to comment #3) > (From update of attachment 228907 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=228907&action=review > > > Source/JavaScriptCore/inspector/remote/RemoteInspector.h:68 > > + enum StopSource { StopSourceAPI, StopSourceXPCMessage }; > > IIRC, we don't typically repeat the enum name. So: > > enum StopSource { API, XPCMessage }; > > But I could be wrong. Seems fine. I'll make that change.
Joseph Pecoraro
Comment 5 2014-04-08 16:41:49 PDT
Even better: enum class StopSource { API, XPCMessage }; And call sites use: StopSource::API, StopSource::XPCMessage
Joseph Pecoraro
Comment 6 2014-04-08 16:43:25 PDT
Created attachment 228914 [details] [PATCH] For Landing
WebKit Commit Bot
Comment 7 2014-04-08 16:46:03 PDT
Attachment 228914 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/inspector/remote/RemoteInspector.h:68: enum members should use InterCaps with an initial capital letter. [readability/enum_casing] [4] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 8 2014-04-08 17:12:37 PDT
Comment on attachment 228914 [details] [PATCH] For Landing Clearing flags on attachment: 228914 Committed r166982: <http://trac.webkit.org/changeset/166982>
WebKit Commit Bot
Comment 9 2014-04-08 17:12:42 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.