Bug 183224 - WebProcessProxy should handle its completion handler at destruction time
Summary: WebProcessProxy should handle its completion handler at destruction time
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-02-28 14:22 PST by youenn fablet
Modified: 2018-03-02 09:49 PST (History)
4 users (show)

See Also:


Attachments
Patch (2.13 KB, patch)
2018-02-28 14:27 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 youenn fablet 2018-02-28 14:22:56 PST
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.JavaScriptCore      	0x0000000110da3f44 WTFCrash + 36 (Assertions.cpp:271)
1   com.apple.WebKit              	0x00000001140e80d7 WTF::CompletionHandler<void ()>::~CompletionHandler() + 87 (CompletionHandler.h:51)
2   com.apple.WebKit              	0x00000001140e29f5 WTF::CompletionHandler<void ()>::~CompletionHandler() + 21 (CompletionHandler.h:52)
3   com.apple.WebKit              	0x0000000114d6cda9 WTF::KeyValuePair<unsigned long long, WTF::CompletionHandler<void ()> >::~KeyValuePair() + 25 (KeyValuePair.h:33)
4   com.apple.WebKit              	0x0000000114d6cd75 WTF::KeyValuePair<unsigned long long, WTF::CompletionHandler<void ()> >::~KeyValuePair() + 21 (KeyValuePair.h:33)
5   com.apple.WebKit              	0x0000000114d6cd0a WTF::HashTable<unsigned long long, WTF::KeyValuePair<unsigned long long, WTF::CompletionHandler<void ()> >, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<unsigned long long, WTF::CompletionHandler<void ()> > >, WTF::IntHash<unsigned long long>, WTF::HashMap<unsigned long long, WTF::CompletionHandler<void ()>, WTF::IntHash<unsigned long long>, WTF::HashTraits<unsigned long long>, WTF::HashTraits<WTF::CompletionHandler<void ()> > >::KeyValuePairTraits, WTF::HashTraits<unsigned long long> >::deallocateTable(WTF::KeyValuePair<unsigned long long, WTF::CompletionHandler<void ()> >*, unsigned int) + 90 (HashTable.h:1159)
6   com.apple.WebKit              	0x0000000114d6caf9 WTF::HashTable<unsigned long long, WTF::KeyValuePair<unsigned long long, WTF::CompletionHandler<void ()> >, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<unsigned long long, WTF::CompletionHandler<void ()> > >, WTF::IntHash<unsigned long long>, WTF::HashMap<unsigned long long, WTF::CompletionHandler<void ()>, WTF::IntHash<unsigned long long>, WTF::HashTraits<unsigned long long>, WTF::HashTraits<WTF::CompletionHandler<void ()> > >::KeyValuePairTraits, WTF::HashTraits<unsigned long long> >::~HashTable() + 57
7   com.apple.WebKit              	0x0000000114d6cab5 WTF::HashTable<unsigned long long, WTF::KeyValuePair<unsigned long long, WTF::CompletionHandler<void ()> >, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<unsigned long long, WTF::CompletionHandler<void ()> > >, WTF::IntHash<unsigned long long>, WTF::HashMap<unsigned long long, WTF::CompletionHandler<void ()>, WTF::IntHash<unsigned long long>, WTF::HashTraits<unsigned long long>, WTF::HashTraits<WTF::CompletionHandler<void ()> > >::KeyValuePairTraits, WTF::HashTraits<unsigned long long> >::~HashTable() + 21 (HashTable.h:365)
8   com.apple.WebKit              	0x0000000114d6ca95 WTF::HashMap<unsigned long long, WTF::CompletionHandler<void ()>, WTF::IntHash<unsigned long long>, WTF::HashTraits<unsigned long long>, WTF::HashTraits<WTF::CompletionHandler<void ()> > >::~HashMap() + 21 (HashMap.h:36)
9   com.apple.WebKit              	0x0000000114d5fb25 WTF::HashMap<unsigned long long, WTF::CompletionHandler<void ()>, WTF::IntHash<unsigned long long>, WTF::HashTraits<unsigned long long>, WTF::HashTraits<WTF::CompletionHandler<void ()> > >::~HashMap() + 21 (HashMap.h:36)
10  com.apple.WebKit              	0x0000000114d5f7cc WebKit::WebProcessProxy::~WebProcessProxy() + 444 (WebProcessProxy.cpp:149)
11  com.apple.WebKit              	0x0000000114677a55 WebKit::ServiceWorkerProcessProxy::~ServiceWorkerProcessProxy() + 21 (ServiceWorkerProcessProxy.cpp:58)
12  com.apple.WebKit              	0x0000000114677a75 WebKit::ServiceWorkerProcessProxy::~ServiceWorkerProcessProxy() + 21 (ServiceWorkerProcessProxy.cpp:58)
13  com.apple.WebKit              	0x0000000114677b19 WebKit::ServiceWorkerProcessProxy::~ServiceWorkerProcessProxy() + 25 (ServiceWorkerProcessProxy.cpp:57)
14  com.apple.WebKit              	0x000000011458c9df WTF::ThreadSafeRefCounted<WebKit::ChildProcessProxy>::deref() const + 79 (ThreadSafeRefCounted.h:71)
15  com.apple.WebKit              	0x0000000114b9cf83 WTF::Ref<WebKit::WebProcessProxy, WTF::DumbPtrTraits<WebKit::WebProcessProxy> >::~Ref() + 51 (Ref.h:62)
16  com.apple.WebKit              	0x0000000114b21165 WTF::Ref<WebKit::WebProcessProxy, WTF::DumbPtrTraits<WebKit::WebProcessProxy> >::~Ref() + 21 (Ref.h:62)
17  com.apple.WebKit              	0x0000000114d64647 WebKit::WebProcessProxy::didClose(IPC::Connection&) + 567 (WebProcessProxy.cpp:680)
18  com.apple.WebKit              	0x0000000114d6478c non-virtual thunk to WebKit::WebProcessProxy::didClose(IPC::Connection&) + 44
19  com.apple.WebKit              	0x000000011417a2d6 IPC::Connection::connectionDidClose()::$_13::operator()() + 246 (Connection.cpp:812)
Comment 2 youenn fablet 2018-02-28 14:27:38 PST
Created attachment 334770 [details]
Patch
Comment 3 youenn fablet 2018-02-28 14:33:00 PST
So there are two completion handlers.
It seems to me the first one can be moved to a Function.
I kept the second one as completion handler at is seems healthier to respond as if there was no process proxy at the moment the request was made.
Comment 4 Chris Dumez 2018-03-01 14:56:42 PST
Comment on attachment 334770 [details]
Patch

I'll let Brady review this one as I am not familiar enough with this part of the code to be sure this is the behavior we want.
Comment 5 WebKit Commit Bot 2018-03-02 09:48:11 PST
Comment on attachment 334770 [details]
Patch

Clearing flags on attachment: 334770

Committed r229178: <https://trac.webkit.org/changeset/229178>
Comment 6 WebKit Commit Bot 2018-03-02 09:48:13 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2018-03-02 09:49:26 PST
<rdar://problem/38071544>