commit 997f74380e12abbd697e6f85c06c0cb5cb3b3a38 parent 97ba1a3a46a1f3e1839162df339e21c951c96ad1 Author: Jamie Nicol <jnicol@mozilla.com> Date: Tue, 7 Oct 2025 16:32:48 +0000 Bug 1992951 - Annotate crash reports with reason for GPU process launch failure on Android. r=gfx-reviewers,geckoview-reviewers,ohall,aosmond In bug 1992573 we are seeing a lot of failures when attempting to launch the GPU process on Android. If we had previously had a stable GPU process we now crash the parent process rather than disabling the GPU process. This patch ensures that we log any java exception messages to gfxCriticalNote when we fail to launch the GPU process. This will hopefully mean that the crash reports will contain useful information regarding why the process failed to launch. Differential Revision: https://phabricator.services.mozilla.com/D267763 Diffstat:
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java @@ -1791,4 +1791,7 @@ public class GeckoAppShell { @WrapForJNI(dispatchTo = "gecko") public static native void onTimezoneChanged(); + + @WrapForJNI + public static native void logGpuProcessLaunchFailure(String aMessage); } diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java @@ -788,7 +788,14 @@ public final class GeckoProcessManager extends IProcessManager.Stub { () -> { INSTANCE .start(info) - .accept(result::complete, result::completeExceptionally) + .accept( + result::complete, + exception -> { + if (type == GeckoProcessType.GPU) { + GeckoAppShell.logGpuProcessLaunchFailure(exception.getMessage()); + } + result.completeExceptionally(exception); + }) .finally_(info::cleanup); }); diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp @@ -36,6 +36,7 @@ #include "mozilla/dom/BrowserChild.h" #include "mozilla/dom/Document.h" #include "mozilla/gfx/gfxVars.h" +#include "mozilla/gfx/Logging.h" #include "mozilla/intl/OSPreferences.h" #include "mozilla/ipc/GeckoChildProcessHost.h" #include "mozilla/java/GeckoAppShellNatives.h" @@ -362,6 +363,11 @@ class GeckoAppShellSupport final nsBaseAppShell::OnSystemTimezoneChange(); } + + static void LogGpuProcessLaunchFailure(jni::String::Param aMessage) { + gfxCriticalNote << "Error launching GPU process: " + << aMessage->ToCString().get(); + } }; class XPCOMEventTargetWrapper final