Crash data indicates that we are frequently crashing while performing 'String::isolatedCopy' inside topPrivatelyControlledDomain calls. This seem to be primarily related to multiple threads attempting to initialize RegistrableDomain members at the same time. Code review showed the potential for a thread contention issue. This patch resolves the problem in two ways: (1) A thread safety issue in the implementation of WebCore::topPrivatelyControlledDomain is corrected. (Note: This is an issue because we build WebKit with --fno-threadsafe-statics). (2) I added a call during NetworkProcess initialization (before spawning multiple threads) to initialize the domain cache. This change is probably not needed, but adds another layer of defense.
<rdar://problem/51428162>
Created attachment 372575 [details] Patch
Comment on attachment 372575 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=372575&action=review > Source/WebKit/ChangeLog:17 > + (2) Call WebCore::topPrivatelyControlledDomain during NetworkProcess initialization (before We probably do not need 2 given we have 1.
Comment on attachment 372575 [details] Patch Rejecting attachment 372575 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'validate-changelog', '--check-oops', '--non-interactive', 372575, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit ChangeLog entry in Source/WebKit/ChangeLog contains OOPS!. Full output: https://webkit-queues.webkit.org/results/12534056
Committed r246652: <https://trac.webkit.org/changeset/246652>
Comment on attachment 372575 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=372575&action=review > Source/WebKit/NetworkProcess/NetworkProcess.cpp:293 > + UNUSED_PARAM(initialized); This is not a parameter, so using the UNUSED_PARAM macro is incorrect.
(In reply to Alexey Proskuryakov from comment #6) > Comment on attachment 372575 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=372575&action=review > > > Source/WebKit/NetworkProcess/NetworkProcess.cpp:293 > > + UNUSED_PARAM(initialized); > > This is not a parameter, so using the UNUSED_PARAM macro is incorrect. I removed that code.