RESOLVED FIXED 183224
WebProcessProxy should handle its completion handler at destruction time
https://bugs.webkit.org/show_bug.cgi?id=183224
Summary WebProcessProxy should handle its completion handler at destruction time
Attachments
Patch (2.13 KB, patch)
2018-02-28 14:27 PST, youenn fablet
no flags
youenn fablet
Comment 1 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)
youenn fablet
Comment 2 2018-02-28 14:27:38 PST
youenn fablet
Comment 3 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.
Chris Dumez
Comment 4 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.
WebKit Commit Bot
Comment 5 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>
WebKit Commit Bot
Comment 6 2018-03-02 09:48:13 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 7 2018-03-02 09:49:26 PST
Note You need to log in before you can comment on or make changes to this bug.