Bug 139429 - [WK2] Crash when answering notification permission request after navigating
Summary: [WK2] Crash when answering notification permission request after navigating
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on: 139494
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-08 23:26 PST by Chris Dumez
Modified: 2014-12-10 09:54 PST (History)
5 users (show)

See Also:


Attachments
Patch (6.65 KB, patch)
2014-12-08 23:38 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2014-12-08 23:26:53 PST
Crash when answering notification permission request after navigating:
100 com.apple.WebKit:  WebCore::SecurityOriginHash::hash + 34 <==
        100 com.apple.WebKit:  WTF::KeyValuePair<WTF::RefPtr<WebCore::SecurityOrigin>, unsigned long long>* WTF::HashTable<WTF::RefPtr<WebCore::SecurityOrigin>, WTF::KeyValuePair<WTF::RefPtr<WebCore::SecurityOrigin>, unsigned long long>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WTF::RefPtr<WebCore::SecurityOrigin>, unsigned long long> >, WebCore::SecurityOriginHash, WTF::KeyValuePairHashTraits<WTF::HashTraits<WTF::RefPtr<WebCore::SecurityOrigin> >, WTF::HashTraits<unsigned long long> >, WTF::HashTraits<WTF::RefPtr<WebCore::SecurityOrigin> > >::lookup<WTF::IdentityHashTranslator<WebCore::SecurityOriginHash>, WTF::RefPtr<WebCore::SecurityOrigin> > + 36
          100 com.apple.WebKit:  WTF::HashTableIterator<WTF::RefPtr<WebCore::SecurityOrigin>, WTF::KeyValuePair<WTF::RefPtr<WebCore::SecurityOrigin>, unsigned long long>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WTF::RefPtr<WebCore::SecurityOrigin>, unsigned long long> >, WebCore::SecurityOriginHash, WTF::KeyValuePairHashTraits<WTF::HashTraits<WTF::RefPtr<WebCore::SecurityOrigin> >, WTF::HashTraits<unsigned long long> >, WTF::HashTraits<WTF::RefPtr<WebCore::SecurityOrigin> > > WTF::HashTable<WTF::RefPtr<WebCore::SecurityOrigin>, WTF::KeyValuePair<WTF::RefPtr<WebCore::SecurityOrigin>, unsigned long long>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<WTF::RefPtr<WebCore::SecurityOrigin>, unsigned long long> >, WebCore::SecurityOriginHash, WTF::KeyValuePairHashTraits<WTF::HashTraits<WTF::RefPtr<WebCore::SecurityOrigin> >, WTF::HashTraits<unsigned long long> >, WTF::HashTraits<WTF::RefPtr<WebCore::SecurityOrigin> > >::find<WTF::IdentityHashTranslator<WebCore::SecurityOriginHash>, WTF::RefPtr<WebCore::SecurityOrigin> > + 23
            100 com.apple.WebKit:  WTF::HashMap<WTF::RefPtr<WebCore::SecurityOrigin>, unsigned long long, WebCore::SecurityOriginHash, WTF::HashTraits<WTF::RefPtr<WebCore::SecurityOrigin> >, WTF::HashTraits<unsigned long long> >::remove + 14
              100 com.apple.WebKit:  WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision + 74
                100 com.apple.WebKit:  void IPC::handleMessage<Messages::WebPage::DidReceiveNotificationPermissionDecision, WebKit::WebPage, void  + 78
                  51 com.apple.WebKit:  WebKit::WebPage::didReceiveWebPageMessage + 10220
                  | 51 com.apple.WebKit:  IPC::MessageReceiverMap::dispatchMessage + 120
                  |   51 com.apple.WebKit:  WebKit::WebProcess::didReceiveMessage + 28

This is because the notification permission request is cancelled upon navigating. When the user responds to the permission request afterward, it looks for the request ID in the HashMap and the code wrongly assumes the ID exists in the HashMap.

Radar: <rdar://problem/18921122>
Comment 1 Chris Dumez 2014-12-08 23:38:44 PST
Created attachment 242886 [details]
Patch
Comment 2 Andreas Kling 2014-12-09 11:46:45 PST
Comment on attachment 242886 [details]
Patch

r=me
Comment 3 WebKit Commit Bot 2014-12-09 12:31:06 PST
Comment on attachment 242886 [details]
Patch

Clearing flags on attachment: 242886

Committed r177033: <http://trac.webkit.org/changeset/177033>
Comment 4 WebKit Commit Bot 2014-12-09 12:31:11 PST
All reviewed patches have been landed.  Closing bug.