Title: [281511] trunk/Source/WebKit
Revision
281511
Author
[email protected]
Date
2021-08-24 12:11:15 -0700 (Tue, 24 Aug 2021)

Log Message

Crash in [RBSTarget targetWithPid:] during WebProcessProxy::shutDown
https://bugs.webkit.org/show_bug.cgi?id=229444

Reviewed by Alex Christensen.

It appears xpc_connection_get_pid() may be able to return a PID that is less than 0
(likely when the process has just exited) and this causes RunningBoard to throw an
exception because the PID is invalid. Tweak the WebKit PID validation to use '>= 0'
instead of simply '!= 0', so that our validation is identical to the one used by
RunningBoard.

* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::ProcessAssertion::ProcessAssertion):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (281510 => 281511)


--- trunk/Source/WebKit/ChangeLog	2021-08-24 19:08:51 UTC (rev 281510)
+++ trunk/Source/WebKit/ChangeLog	2021-08-24 19:11:15 UTC (rev 281511)
@@ -1,3 +1,19 @@
+2021-08-24  Chris Dumez  <[email protected]>
+
+        Crash in [RBSTarget targetWithPid:] during WebProcessProxy::shutDown
+        https://bugs.webkit.org/show_bug.cgi?id=229444
+
+        Reviewed by Alex Christensen.
+
+        It appears xpc_connection_get_pid() may be able to return a PID that is less than 0
+        (likely when the process has just exited) and this causes RunningBoard to throw an
+        exception because the PID is invalid. Tweak the WebKit PID validation to use '>= 0'
+        instead of simply '!= 0', so that our validation is identical to the one used by
+        RunningBoard.
+
+        * UIProcess/ios/ProcessAssertionIOS.mm:
+        (WebKit::ProcessAssertion::ProcessAssertion):
+
 2021-08-24  Adrian Perez de Castro  <[email protected]>
 
         Non-unified build fixes, late August 2021

Modified: trunk/Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm (281510 => 281511)


--- trunk/Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm	2021-08-24 19:08:51 UTC (rev 281510)
+++ trunk/Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm	2021-08-24 19:11:15 UTC (rev 281511)
@@ -331,8 +331,8 @@
 {
     NSString *runningBoardAssertionName = runningBoardNameForAssertionType(assertionType);
     ASSERT(runningBoardAssertionName);
-    if (!pid) {
-        RELEASE_LOG_ERROR(ProcessSuspension, "%p - ProcessAssertion: Failed to acquire RBS %{public}@ assertion '%{public}s' for process because PID is invalid", this, runningBoardAssertionName, reason.utf8().data());
+    if (pid <= 0) {
+        RELEASE_LOG_ERROR(ProcessSuspension, "%p - ProcessAssertion: Failed to acquire RBS %{public}@ assertion '%{public}s' for process because PID %d is invalid", this, runningBoardAssertionName, reason.utf8().data(), pid);
         m_wasInvalidated = true;
         return;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to