Bug 131321

Summary: Web Inspector: Hang in debuggable application after receiving WIRPermissionDenied
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 none

Description Joseph Pecoraro 2014-04-07 16:01:35 PDT
Hang seen in application after receiving WIRPermissionDenied message:

  XPC Connection Queue
   ...
    1000  _xpc_connection_call_event_handler + 58 (libxpc.dylib + 40329) [0x7fff88676d89] 1-1000
      1000  Inspector::RemoteInspectorXPCConnection::handleEvent(void*) + 156 (JavaScriptCore + 4603324) [0x10e334dbc] 1-1000
        1000  Inspector::RemoteInspector::xpcConnectionReceivedMessage(Inspector::RemoteInspectorXPCConnection*, NSString*, NSDictionary*) + 72 (JavaScriptCore + 4587976) [0x10e3311c8] 1-1000
          1000  Inspector::RemoteInspector::stop() + 29 (JavaScriptCore + 4587437) [0x10e330fad] 1-1000
            1000  std::__1::mutex::lock() + 9 (libc++.1.dylib + 248623) [0x7fff8f33fb2f] 1-1000
              1000  __psynch_mutexwait + 10 (libsystem_kernel.dylib + 90754) [0x7fff95b3f282] 1-1000
               *1000  psynch_mtxcontinue + 0 (pthread + 18499) [0xffffff7f80ed2843] 1-1000

Note RemoteInspector::xpcConnectionReceivedMessage took the mutex that Inspector::RemoteInspector::stop is waiting for. It already has the mutex.

This is the only place stop() is called (other then the RemoteInspector API). Since stop() takes the lock, we can just move xpcConnectionReceivedMessage's lock after the disjoint branch that calls stop().
Comment 1 Radar WebKit Bug Importer 2014-04-07 16:02:21 PDT
<rdar://problem/16545910>
Comment 2 Joseph Pecoraro 2014-04-07 16:03:48 PDT
Created attachment 228767 [details]
[PATCH] Proposed Fix
Comment 3 WebKit Commit Bot 2014-04-07 16:45:45 PDT
Comment on attachment 228767 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 228767

Committed r166891: <http://trac.webkit.org/changeset/166891>
Comment 4 WebKit Commit Bot 2014-04-07 16:45:48 PDT
All reviewed patches have been landed.  Closing bug.