WebKit Bugzilla
Attachment 372575 Details for
Bug 199072
: Resolve frequent crashes in String::isolatedCopy inside topPrivatelyControlledDomain call
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199072-20190620114213.patch (text/plain), 4.42 KB, created by
Brent Fulgham
on 2019-06-20 11:42:14 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Brent Fulgham
Created:
2019-06-20 11:42:14 PDT
Size:
4.42 KB
patch
obsolete
>Subversion Revision: 246640 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f57a17d04d4bfc2dd98085169da69770bf82049b..1c7ddab5ff7e58ddc389f99677703ecb775df142 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,26 @@ >+2019-06-20 Brent Fulgham <bfulgham@apple.com> >+ >+ Resolve frequent crashes in topPrivatelyControlledDomain >+ https://bugs.webkit.org/show_bug.cgi?id=199072 >+ <rdar://problem/51428162> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Crash data indicates that we are frequently crashing when multiple threads call >+ WebCore::topPrivatelyControlledDomain. >+ >+ Code review showed the potential for a thread contention issue, since WebKit builds >+ with '--fno-threadsafe-statics'. >+ >+ This patch resolves the problem in two ways: >+ (1) Correct the thread safety issue in WebCore::topPrivatelyControlledDomain. >+ (2) Call WebCore::topPrivatelyControlledDomain during NetworkProcess initialization (before >+ other threads are spawned in the process) to initialize the domain cache. >+ >+ * platform/mac/PublicSuffixMac.mm: >+ (WebCore::topPrivatelyControlledDomain): Only instantiate the static cache after the >+ current thread has achieved its lock. >+ > 2019-06-20 Saam Barati <sbarati@apple.com> > > Unreviewed. Speculative build fix for watchOS after r246631. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4d853a146b7da1afffe23c4f49fd8235215af7b1..638efb51710f5c25054e090ab8a5f168e3c41546 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,27 @@ >+2019-06-20 Brent Fulgham <bfulgham@apple.com> >+ >+ Resolve frequent crashes in topPrivatelyControlledDomain >+ https://bugs.webkit.org/show_bug.cgi?id=199072 >+ <rdar://problem/51428162> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Crash data indicates that we are frequently crashing when multiple threads call >+ WebCore::topPrivatelyControlledDomain. >+ >+ Code review showed the potential for a thread contention issue, since WebKit builds >+ with '--fno-threadsafe-statics'. >+ >+ This patch resolves the problem in two ways: >+ (1) Correct the thread safety issue in WebCore::topPrivatelyControlledDomain. >+ (2) Call WebCore::topPrivatelyControlledDomain during NetworkProcess initialization (before >+ other threads are spawned in the process) to initialize the domain cache. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * NetworkProcess/NetworkProcess.cpp: >+ (WebKit::NetworkProcess::initializeNetworkProcess): Initialize the domain cache during launch. >+ > 2019-06-20 Alexander Mikhaylenko <exalm7659@gmail.com> > > [GTK] Enable navigation swipe layout tests >diff --git a/Source/WebCore/platform/mac/PublicSuffixMac.mm b/Source/WebCore/platform/mac/PublicSuffixMac.mm >index 668dce09face558873bbeb85dd0497ba5d344dcf..b8506ab76e3248c559de59bebd8abc1abf665da5 100644 >--- a/Source/WebCore/platform/mac/PublicSuffixMac.mm >+++ b/Source/WebCore/platform/mac/PublicSuffixMac.mm >@@ -50,13 +50,13 @@ String topPrivatelyControlledDomain(const String& domain) > if (!domain.isAllASCII()) > return domain; > >- static NeverDestroyed<HashMap<String, String, ASCIICaseInsensitiveHash>> cache; > static Lock cacheLock; >- >- auto isolatedDomain = domain.isolatedCopy(); >- > auto locker = holdLock(cacheLock); > >+ static NeverDestroyed<HashMap<String, String, ASCIICaseInsensitiveHash>> cache; >+ >+ auto isolatedDomain = domain.isolatedCopy(); >+ > constexpr auto maximumSizeToPreventUnlimitedGrowth = 128; > if (cache.get().size() == maximumSizeToPreventUnlimitedGrowth) > cache.get().remove(cache.get().random()); >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >index e2ed15e25ef6e42dd4828906188aee0ad77594fb..9546736030933fe54d2c8f51b111574a59919431 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >@@ -289,6 +289,8 @@ void NetworkProcess::initializeNetworkProcess(NetworkProcessCreationParameters&& > > WTF::Thread::setCurrentThreadIsUserInitiated(); > AtomString::init(); >+ auto initialized = topPrivatelyControlledDomain("nullOrigin"_s); >+ UNUSED_PARAM(initialized); > > m_suppressMemoryPressureHandler = parameters.shouldSuppressMemoryPressureHandler; > if (!m_suppressMemoryPressureHandler) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
youennf
:
review+
commit-queue
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199072
: 372575