Title: [258285] branches/safari-610.1.7-branch/Source
Revision
258285
Author
[email protected]
Date
2020-03-11 14:32:13 -0700 (Wed, 11 Mar 2020)

Log Message

Cherry-pick r258284. rdar://problem/60341123

    [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
    https://bugs.webkit.org/show_bug.cgi?id=208945
    Source/WebKit:

    <rdar://problem/60330751>

    Reviewed by Brent Fulgham.

    Check that accessibility library is present before attempting to use constants from it.

    No new tests, since I am unable to reproduce.

    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
    (WebKit::WebProcessPool::registerNotificationObservers):
    (WebKit::WebProcessPool::unregisterNotificationObservers):

    Source/WTF:

    Reviewed by Brent Fulgham.

    Add macro to optionally soft link library.

    * wtf/cocoa/SoftLinking.h:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258284 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-610.1.7-branch/Source/WTF/ChangeLog (258284 => 258285)


--- branches/safari-610.1.7-branch/Source/WTF/ChangeLog	2020-03-11 21:25:24 UTC (rev 258284)
+++ branches/safari-610.1.7-branch/Source/WTF/ChangeLog	2020-03-11 21:32:13 UTC (rev 258285)
@@ -1,3 +1,47 @@
+2020-03-11  Alan Coon  <[email protected]>
+
+        Cherry-pick r258284. rdar://problem/60341123
+
+    [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
+    https://bugs.webkit.org/show_bug.cgi?id=208945
+    Source/WebKit:
+    
+    <rdar://problem/60330751>
+            
+    Reviewed by Brent Fulgham.
+    
+    Check that accessibility library is present before attempting to use constants from it.
+    
+    No new tests, since I am unable to reproduce.
+    
+    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+    (WebKit::WebProcessPool::registerNotificationObservers):
+    (WebKit::WebProcessPool::unregisterNotificationObservers):
+    
+    Source/WTF:
+    
+    
+    Reviewed by Brent Fulgham.
+    
+    Add macro to optionally soft link library.
+    
+    * wtf/cocoa/SoftLinking.h:
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258284 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-03-11  Per Arne Vollan  <[email protected]>
+
+            [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
+            https://bugs.webkit.org/show_bug.cgi?id=208945
+
+            Reviewed by Brent Fulgham.
+
+            Add macro to optionally soft link library.
+
+            * wtf/cocoa/SoftLinking.h:
+
 2020-03-08  Brady Eidson  <[email protected]>
 
         Remember completed subranges during incremental PDF loading.

Modified: branches/safari-610.1.7-branch/Source/WTF/wtf/cocoa/SoftLinking.h (258284 => 258285)


--- branches/safari-610.1.7-branch/Source/WTF/wtf/cocoa/SoftLinking.h	2020-03-11 21:25:24 UTC (rev 258284)
+++ branches/safari-610.1.7-branch/Source/WTF/wtf/cocoa/SoftLinking.h	2020-03-11 21:32:13 UTC (rev 258285)
@@ -42,6 +42,16 @@
         return dylib; \
     }
 
+#define SOFT_LINK_LIBRARY_OPTIONAL(lib) \
+static void* lib##Library() \
+{ \
+    static void* dylib = ^{ \
+        void *result = dlopen("/usr/lib/" #lib ".dylib", RTLD_NOW); \
+        return result; \
+    }(); \
+    return dylib; \
+}
+
 #define SOFT_LINK_FRAMEWORK(framework) \
     static void* framework##Library() \
     { \

Modified: branches/safari-610.1.7-branch/Source/WebKit/ChangeLog (258284 => 258285)


--- branches/safari-610.1.7-branch/Source/WebKit/ChangeLog	2020-03-11 21:25:24 UTC (rev 258284)
+++ branches/safari-610.1.7-branch/Source/WebKit/ChangeLog	2020-03-11 21:32:13 UTC (rev 258285)
@@ -1,5 +1,54 @@
 2020-03-11  Alan Coon  <[email protected]>
 
+        Cherry-pick r258284. rdar://problem/60341123
+
+    [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
+    https://bugs.webkit.org/show_bug.cgi?id=208945
+    Source/WebKit:
+    
+    <rdar://problem/60330751>
+            
+    Reviewed by Brent Fulgham.
+    
+    Check that accessibility library is present before attempting to use constants from it.
+    
+    No new tests, since I am unable to reproduce.
+    
+    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+    (WebKit::WebProcessPool::registerNotificationObservers):
+    (WebKit::WebProcessPool::unregisterNotificationObservers):
+    
+    Source/WTF:
+    
+    
+    Reviewed by Brent Fulgham.
+    
+    Add macro to optionally soft link library.
+    
+    * wtf/cocoa/SoftLinking.h:
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258284 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-03-11  Per Arne Vollan  <[email protected]>
+
+            [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
+            https://bugs.webkit.org/show_bug.cgi?id=208945
+            <rdar://problem/60330751>
+
+            Reviewed by Brent Fulgham.
+
+            Check that accessibility library is present before attempting to use constants from it.
+
+            No new tests, since I am unable to reproduce.
+
+            * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+            (WebKit::WebProcessPool::registerNotificationObservers):
+            (WebKit::WebProcessPool::unregisterNotificationObservers):
+
+2020-03-11  Alan Coon  <[email protected]>
+
         Cherry-pick r258252. rdar://problem/60310741
 
     [iOS] A syscall is denied by the sandbox

Modified: branches/safari-610.1.7-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (258284 => 258285)


--- branches/safari-610.1.7-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2020-03-11 21:25:24 UTC (rev 258284)
+++ branches/safari-610.1.7-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2020-03-11 21:32:13 UTC (rev 258285)
@@ -118,6 +118,10 @@
 SOFT_LINK(BackBoardServices, BKSDisplayBrightnessGetCurrent, float, (), ());
 #endif
 
+#if PLATFORM(COCOA)
+SOFT_LINK_LIBRARY_OPTIONAL(libAccessibility)
+#endif
+
 #define WEBPROCESSPOOL_RELEASE_LOG(channel, fmt, ...) RELEASE_LOG(channel, "%p - WebProcessPool::" fmt, this, ##__VA_ARGS__)
 
 namespace WebKit {
@@ -662,12 +666,14 @@
 #endif
 #endif // PLATFORM(IOS)
 #endif // !PLATFORM(IOS_FAMILY)
-    m_accessibilityEnabledObserver = [[NSNotificationCenter defaultCenter] addObserverForName:(__bridge id)kAXSApplicationAccessibilityEnabledNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *) {
-        for (size_t i = 0; i < m_processes.size(); ++i) {
-            m_processes[i]->unblockPreferenceServiceIfNeeded();
-            m_processes[i]->unblockAccessibilityServerIfNeeded();
-        }
-    }];
+    if (libAccessibilityLibrary()) {
+        m_accessibilityEnabledObserver = [[NSNotificationCenter defaultCenter] addObserverForName:(__bridge id)kAXSApplicationAccessibilityEnabledNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *) {
+            for (size_t i = 0; i < m_processes.size(); ++i) {
+                m_processes[i]->unblockPreferenceServiceIfNeeded();
+                m_processes[i]->unblockAccessibilityServerIfNeeded();
+            }
+        }];
+    }
 }
 
 void WebProcessPool::unregisterNotificationObservers()
@@ -692,7 +698,8 @@
 #endif
 #endif // PLATFORM(IOS)
 #endif // !PLATFORM(IOS_FAMILY)
-    [[NSNotificationCenter defaultCenter] removeObserver:m_accessibilityEnabledObserver.get()];
+    if (m_accessibilityEnabledObserver.get())
+        [[NSNotificationCenter defaultCenter] removeObserver:m_accessibilityEnabledObserver.get()];
 }
 
 static CFURLStorageSessionRef privateBrowsingSession()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to