Title: [249273] trunk/Source/WTF
Revision
249273
Author
[email protected]
Date
2019-08-29 08:25:32 -0700 (Thu, 29 Aug 2019)

Log Message

Crash when mach_port_deallocate() returns KERN_INVALID_NAME
https://bugs.webkit.org/show_bug.cgi?id=201248
<rdar://problem/54813890>

Reviewed by Alex Christensen.

* wtf/cocoa/MachSendRight.cpp:
(WTF::deallocateSendRightSafely):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (249272 => 249273)


--- trunk/Source/WTF/ChangeLog	2019-08-29 14:54:54 UTC (rev 249272)
+++ trunk/Source/WTF/ChangeLog	2019-08-29 15:25:32 UTC (rev 249273)
@@ -1,3 +1,14 @@
+2019-08-29  Chris Dumez  <[email protected]>
+
+        Crash when mach_port_deallocate() returns KERN_INVALID_NAME
+        https://bugs.webkit.org/show_bug.cgi?id=201248
+        <rdar://problem/54813890>
+
+        Reviewed by Alex Christensen.
+
+        * wtf/cocoa/MachSendRight.cpp:
+        (WTF::deallocateSendRightSafely):
+
 2019-08-25  Fujii Hironori  <[email protected]>
 
         Regression(r248533) Assertion hit in isMainThread() for some clients using WTF because the main thread is not initialized

Modified: trunk/Source/WTF/wtf/cocoa/MachSendRight.cpp (249272 => 249273)


--- trunk/Source/WTF/wtf/cocoa/MachSendRight.cpp	2019-08-29 14:54:54 UTC (rev 249272)
+++ trunk/Source/WTF/wtf/cocoa/MachSendRight.cpp	2019-08-29 15:25:32 UTC (rev 249273)
@@ -30,8 +30,16 @@
 #include <mach/mach_init.h>
 #include <utility>
 
+#define LOG_CHANNEL_PREFIX Log
+
 namespace WTF {
 
+#if RELEASE_LOG_DISABLED
+WTFLogChannel LogProcess = { WTFLogChannelState::On, "Process", WTFLogLevel::Error };
+#else
+WTFLogChannel LogProcess = { WTFLogChannelState::On, "Process", WTFLogLevel::Error, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
+#endif
+
 static void retainSendRight(mach_port_t port)
 {
     if (port == MACH_PORT_NULL)
@@ -65,8 +73,8 @@
     if (kr == KERN_SUCCESS)
         return;
 
-    LOG_ERROR("mach_port_deallocate error for port %d: %s (%#x)", port, mach_error_string(kr), kr);
-    if (kr == KERN_INVALID_RIGHT)
+    RELEASE_LOG_ERROR(Process, "mach_port_deallocate error for port %d: %{private}s (%#x)", port, mach_error_string(kr), kr);
+    if (kr == KERN_INVALID_RIGHT || kr == KERN_INVALID_NAME)
         CRASH();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to