RESOLVED FIXED200189
Try fixing crash at com.apple.WebKit.Networking: NetworkProcess::setSharedHTTPCookieStorage
https://bugs.webkit.org/show_bug.cgi?id=200189
Summary Try fixing crash at com.apple.WebKit.Networking: NetworkProcess::setSharedHTT...
Sihui Liu
Reported 2019-07-26 19:14:59 PDT
Attachments
Patch (3.81 KB, patch)
2019-07-28 23:24 PDT, Sihui Liu
no flags
Patch (5.33 KB, patch)
2019-07-29 12:42 PDT, Sihui Liu
no flags
Patch (5.40 KB, patch)
2019-07-29 13:11 PDT, Sihui Liu
no flags
Patch for landing (5.63 KB, patch)
2019-07-29 16:54 PDT, Sihui Liu
no flags
Sihui Liu
Comment 1 2019-07-28 23:24:30 PDT
Chris Dumez
Comment 2 2019-07-29 09:56:24 PDT
Comment on attachment 375064 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375064&action=review > Source/WebKit/UIProcess/WebProcessPool.cpp:624 > + swap(m_networkProcess, networkProcess); Indentation problem? Also, why swap instead of a WTFMove()? If you're right about the reason for the crash, wouldn't it mean that ensureNetworkProcess() is now likely to re-enter and re-construct m_networkProcess?
Sihui Liu
Comment 3 2019-07-29 12:42:54 PDT
Chris Dumez
Comment 4 2019-07-29 13:06:00 PDT
Comment on attachment 375092 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375092&action=review > Source/WebKit/UIProcess/WebProcessPool.cpp:475 > + if (!RunLoop::isMain()) { Can we at lease add a ASSERT(RunLoop::isMain()); debug assertion? > Source/WebKit/UIProcess/WebProcessPool.cpp:476 > + callOnMainRunLoopAndWait([this] { I am not convinced |this| is guaranteed to still be alive by the time you get to the main runloop. We likely this to protect/ref it in the lambda.
Sihui Liu
Comment 5 2019-07-29 13:11:06 PDT
(In reply to Chris Dumez from comment #4) > Comment on attachment 375092 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=375092&action=review > > > Source/WebKit/UIProcess/WebProcessPool.cpp:475 > > + if (!RunLoop::isMain()) { > > Can we at lease add a ASSERT(RunLoop::isMain()); debug assertion? Okay. > > > Source/WebKit/UIProcess/WebProcessPool.cpp:476 > > + callOnMainRunLoopAndWait([this] { > > I am not convinced |this| is guaranteed to still be alive by the time you > get to the main runloop. We likely this to protect/ref it in the lambda. Will add.
Sihui Liu
Comment 6 2019-07-29 13:11:51 PDT
Chris Dumez
Comment 7 2019-07-29 13:13:06 PDT
Comment on attachment 375093 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375093&action=review r=me > Source/WebKit/UIProcess/WebProcessPool.cpp:476 > + if (!RunLoop::isMain()) { We may want to put in a comment explaining this is a temporary workaround for apps using our API on non-main threads.
Geoffrey Garen
Comment 8 2019-07-29 13:32:35 PDT
Comment on attachment 375093 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375093&action=review >> Source/WebKit/UIProcess/WebProcessPool.cpp:476 >> + if (!RunLoop::isMain()) { > > We may want to put in a comment explaining this is a temporary workaround for apps using our API on non-main threads. Yes, let's please do that, with a link to a bug report. That way, future programmers have context, and will know under what conditions they can remove this / what they should test if they remove this.
Sihui Liu
Comment 9 2019-07-29 15:03:13 PDT
(In reply to Geoffrey Garen from comment #8) > Comment on attachment 375093 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=375093&action=review > > >> Source/WebKit/UIProcess/WebProcessPool.cpp:476 > >> + if (!RunLoop::isMain()) { > > > > We may want to put in a comment explaining this is a temporary workaround for apps using our API on non-main threads. > > Yes, let's please do that, with a link to a bug report. That way, future > programmers have context, and will know under what conditions they can > remove this / what they should test if they remove this. Sure, will add after the last bot turns green.
Sihui Liu
Comment 10 2019-07-29 16:54:34 PDT
Created attachment 375127 [details] Patch for landing
WebKit Commit Bot
Comment 11 2019-07-29 17:21:51 PDT
Comment on attachment 375127 [details] Patch for landing Clearing flags on attachment: 375127 Committed r247933: <https://trac.webkit.org/changeset/247933>
WebKit Commit Bot
Comment 12 2019-07-29 17:21:52 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 13 2019-07-29 17:22:15 PDT
Note You need to log in before you can comment on or make changes to this bug.