Title: [234778] trunk/Source
- Revision
- 234778
- Author
- [email protected]
- Date
- 2018-08-10 19:01:24 -0700 (Fri, 10 Aug 2018)
Log Message
[macOS] Multiple third party apps crash due to the thread safety check in TimerBase::setNextFireTime
https://bugs.webkit.org/show_bug.cgi?id=188480
Reviewed by Simon Fraser.
Source/WebCore:
Suppress the release assert in WebKit1 on macOS (isInWebProcess is always true in non-Cocoa platforms).
In the future, we should consider throwing Objective-C exceptions when third party apps call WebKit1
or WebKit2 APIs in non-main threads.
* platform/Timer.cpp:
(WebCore::shouldSuppressThreadSafetyCheck): Extracted out of ~TimerBase and setNextFireTime.
(WebCore::TimerBase::~TimerBase):
(WebCore::TimerBase::setNextFireTime):
Source/WTF:
Added the SDK version for macOS Mojave.
* wtf/spi/darwin/dyldSPI.h:
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (234777 => 234778)
--- trunk/Source/WTF/ChangeLog 2018-08-10 23:31:50 UTC (rev 234777)
+++ trunk/Source/WTF/ChangeLog 2018-08-11 02:01:24 UTC (rev 234778)
@@ -1,3 +1,14 @@
+2018-08-10 Ryosuke Niwa <[email protected]>
+
+ [macOS] Multiple third party apps crash due to the thread safety check in TimerBase::setNextFireTime
+ https://bugs.webkit.org/show_bug.cgi?id=188480
+
+ Reviewed by Simon Fraser.
+
+ Added the SDK version for macOS Mojave.
+
+ * wtf/spi/darwin/dyldSPI.h:
+
2018-08-10 Antti Koivisto <[email protected]>
Use OptionSet for various RenderLayer flags
Modified: trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h (234777 => 234778)
--- trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h 2018-08-10 23:31:50 UTC (rev 234777)
+++ trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h 2018-08-11 02:01:24 UTC (rev 234778)
@@ -45,6 +45,10 @@
#define DYLD_MACOSX_VERSION_10_13 0x000A0D00
#endif
+#ifndef DYLD_MACOSX_VERSION_10_14
+#define DYLD_MACOSX_VERSION_10_14 0x000A0E00
+#endif
+
#else
#define DYLD_IOS_VERSION_3_0 0x00030000
@@ -61,6 +65,7 @@
#define DYLD_MACOSX_VERSION_10_11 0x000A0B00
#define DYLD_MACOSX_VERSION_10_12 0x000A0C00
#define DYLD_MACOSX_VERSION_10_13 0x000A0D00
+#define DYLD_MACOSX_VERSION_10_14 0x000A0E00
#endif
Modified: trunk/Source/WebCore/ChangeLog (234777 => 234778)
--- trunk/Source/WebCore/ChangeLog 2018-08-10 23:31:50 UTC (rev 234777)
+++ trunk/Source/WebCore/ChangeLog 2018-08-11 02:01:24 UTC (rev 234778)
@@ -1,3 +1,20 @@
+2018-08-10 Ryosuke Niwa <[email protected]>
+
+ [macOS] Multiple third party apps crash due to the thread safety check in TimerBase::setNextFireTime
+ https://bugs.webkit.org/show_bug.cgi?id=188480
+
+ Reviewed by Simon Fraser.
+
+ Suppress the release assert in WebKit1 on macOS (isInWebProcess is always true in non-Cocoa platforms).
+
+ In the future, we should consider throwing Objective-C exceptions when third party apps call WebKit1
+ or WebKit2 APIs in non-main threads.
+
+ * platform/Timer.cpp:
+ (WebCore::shouldSuppressThreadSafetyCheck): Extracted out of ~TimerBase and setNextFireTime.
+ (WebCore::TimerBase::~TimerBase):
+ (WebCore::TimerBase::setNextFireTime):
+
2018-08-10 Daniel Bates <[email protected]>
Cleanup: Remove unnecessary code to resume animations from CachedFrameBase::restore()
Modified: trunk/Source/WebCore/platform/Timer.cpp (234777 => 234778)
--- trunk/Source/WebCore/platform/Timer.cpp 2018-08-10 23:31:50 UTC (rev 234777)
+++ trunk/Source/WebCore/platform/Timer.cpp 2018-08-11 02:01:24 UTC (rev 234778)
@@ -27,6 +27,7 @@
#include "config.h"
#include "Timer.h"
+#include "RuntimeApplicationChecks.h"
#include "SharedTimer.h"
#include "ThreadGlobalData.h"
#include "ThreadTimers.h"
@@ -36,6 +37,10 @@
#include <wtf/MainThread.h>
#include <wtf/Vector.h>
+#if USE(WEB_THREAD) || PLATFORM(MAC)
+#include <wtf/spi/darwin/dyldSPI.h>
+#endif
+
namespace WebCore {
class TimerHeapReference;
@@ -184,6 +189,17 @@
// ----------------
+static bool shouldSuppressThreadSafetyCheck()
+{
+#if USE(WEB_THREAD)
+ return WebThreadIsEnabled();
+#elif PLATFORM(MAC)
+ return !isInWebProcess() && applicationSDKVersion() < DYLD_MACOSX_VERSION_10_14;
+#else
+ return false;
+#endif
+}
+
TimerBase::TimerBase()
: m_heapIndex(-1)
, m_wasDeleted(false)
@@ -192,12 +208,8 @@
TimerBase::~TimerBase()
{
-#if USE(WEB_THREAD)
ASSERT(canAccessThreadLocalDataForThread(m_thread.get()));
- RELEASE_ASSERT(WebThreadIsEnabled() || canAccessThreadLocalDataForThread(m_thread.get()));
-#else
- RELEASE_ASSERT(canAccessThreadLocalDataForThread(m_thread.get()));
-#endif
+ RELEASE_ASSERT(canAccessThreadLocalDataForThread(m_thread.get()) || shouldSuppressThreadSafetyCheck());
stop();
ASSERT(!inHeap());
m_wasDeleted = true;
@@ -364,12 +376,8 @@
void TimerBase::setNextFireTime(MonotonicTime newTime)
{
-#if USE(WEB_THREAD)
ASSERT(canAccessThreadLocalDataForThread(m_thread.get()));
- RELEASE_ASSERT(WebThreadIsEnabled() || canAccessThreadLocalDataForThread(m_thread.get()));
-#else
- RELEASE_ASSERT(canAccessThreadLocalDataForThread(m_thread.get()));
-#endif
+ RELEASE_ASSERT(canAccessThreadLocalDataForThread(m_thread.get()) || shouldSuppressThreadSafetyCheck());
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!m_wasDeleted);
if (m_unalignedNextFireTime != newTime)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes