Bug 151789 - REGRESSION(r192753): Remote Web Inspector: RemoteInspector::sendMessageToRemote with null connection
Summary: REGRESSION(r192753): Remote Web Inspector: RemoteInspector::sendMessageToRemo...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-12-02 19:40 PST by Joseph Pecoraro
Modified: 2015-12-03 11:33 PST (History)
12 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (1.48 KB, patch)
2015-12-02 19:42 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-12-02 19:40:58 PST
* SUMMARY
Remote Web Inspector: RemoteInspector::sendMessageToRemote with null connection.

* STEPS TO REPRODUCE
1. Launch Application with JSContext
2. Launch Safari
3. Safari: Develop > Current Machine > App > Context
4. Close Remote Inspection window while doing stuff
  => Possible CRASH

* NOTES
Previously the connection was null checked (as it could have been removed by another thread). It seems we lost the null check.

(lldb) p connection
(Inspector::RemoteConnectionToTarget *) $3 = 0x0000000000000000

>    void RemoteInspector::sendMessageToRemote(unsigned identifier, const String& message)
>    {
>        ...
>        auto connection = m_connectionMap.get(identifier);
>
>        NSDictionary *userInfo = @{
>            WIRRawDataKey: [static_cast<NSString *>(message) dataUsingEncoding:NSUTF8StringEncoding],
>            WIRConnectionIdentifierKey: connection->connectionIdentifier(),
>            WIRDestinationKey: connection->destination()
>        };
>        ...
>    }
Comment 1 Radar WebKit Bug Importer 2015-12-02 19:41:12 PST
<rdar://problem/23737051>
Comment 2 Joseph Pecoraro 2015-12-02 19:42:53 PST
Created attachment 266501 [details]
[PATCH] Proposed Fix
Comment 3 WebKit Commit Bot 2015-12-03 11:33:30 PST
Comment on attachment 266501 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 266501

Committed r193355: <http://trac.webkit.org/changeset/193355>
Comment 4 WebKit Commit Bot 2015-12-03 11:33:33 PST
All reviewed patches have been landed.  Closing bug.