зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 3 changesets (bug 1880503) for causing build bustages in nsCOMPtr.h. CLOSED TREE
Backed out changeset 437063345a7b (bug 1880503) Backed out changeset 9665aa5e821d (bug 1880503) Backed out changeset 44d08ce97ae6 (bug 1880503)
This commit is contained in:
Родитель
250455b0be
Коммит
ad459e5cb0
|
@ -4513,7 +4513,7 @@ void ContentParent::GeneratePairedMinidump(const char* aReason) {
|
|||
CrashReporter::Annotation::ipc_channel_error, reason);
|
||||
|
||||
// Generate the report and insert into the queue for submittal.
|
||||
if (mCrashReporter->GenerateMinidumpAndPair(mSubprocess, "browser"_ns)) {
|
||||
if (mCrashReporter->GenerateMinidumpAndPair(this, "browser"_ns)) {
|
||||
mCrashReporter->FinalizeCrashReport();
|
||||
mCreatedPairedMinidumps = true;
|
||||
}
|
||||
|
|
|
@ -111,33 +111,6 @@ bool GPUChild::EnsureGPUReady() {
|
|||
|
||||
void GPUChild::OnUnexpectedShutdown() { mUnexpectedShutdown = true; }
|
||||
|
||||
void GPUChild::GeneratePairedMinidump() {
|
||||
// At most generate the paired minidumps twice per session in order to
|
||||
// avoid accumulating a large number of unsubmitted minidumps on disk.
|
||||
if (mCrashReporter && mNumPairedMinidumpsCreated < 2) {
|
||||
nsAutoCString additionalDumps("browser");
|
||||
mCrashReporter->AddAnnotationNSCString(
|
||||
CrashReporter::Annotation::additional_minidumps, additionalDumps);
|
||||
|
||||
nsAutoCString reason("GPUProcessKill");
|
||||
mCrashReporter->AddAnnotationNSCString(
|
||||
CrashReporter::Annotation::ipc_channel_error, reason);
|
||||
|
||||
if (mCrashReporter->GenerateMinidumpAndPair(mHost, "browser"_ns)) {
|
||||
mCrashReporter->FinalizeCrashReport();
|
||||
mCreatedPairedMinidumps = true;
|
||||
mNumPairedMinidumpsCreated++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GPUChild::DeletePairedMinidump() {
|
||||
if (mCrashReporter && mCreatedPairedMinidumps) {
|
||||
mCrashReporter->DeleteCrashReport();
|
||||
mCreatedPairedMinidumps = false;
|
||||
}
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult GPUChild::RecvInitComplete(const GPUDeviceData& aData) {
|
||||
// We synchronously requested GPU parameters before this arrived.
|
||||
if (mGPUReady) {
|
||||
|
@ -318,18 +291,14 @@ mozilla::ipc::IPCResult GPUChild::RecvAddMemoryReport(
|
|||
|
||||
void GPUChild::ActorDestroy(ActorDestroyReason aWhy) {
|
||||
if (aWhy == AbnormalShutdown || mUnexpectedShutdown) {
|
||||
nsAutoString dumpId;
|
||||
GenerateCrashReport(OtherPid(), &dumpId);
|
||||
|
||||
Telemetry::Accumulate(
|
||||
Telemetry::SUBPROCESS_ABNORMAL_ABORT,
|
||||
nsDependentCString(XRE_GeckoProcessTypeToString(GeckoProcessType_GPU)),
|
||||
1);
|
||||
|
||||
nsAutoString dumpId;
|
||||
if (!mCreatedPairedMinidumps) {
|
||||
GenerateCrashReport(OtherPid(), &dumpId);
|
||||
} else if (mCrashReporter) {
|
||||
dumpId = mCrashReporter->MinidumpID();
|
||||
}
|
||||
|
||||
// Notify the Telemetry environment so that we can refresh and do a
|
||||
// subsession split. This also notifies the crash reporter on geckoview.
|
||||
if (nsCOMPtr<nsIObserverService> obsvc = services::GetObserverService()) {
|
||||
|
|
|
@ -43,14 +43,6 @@ class GPUChild final : public ipc::CrashReporterHelper<GeckoProcessType_GPU>,
|
|||
// abnormal.
|
||||
void OnUnexpectedShutdown();
|
||||
|
||||
// Generates a minidump for the GPU process paired with one for the main
|
||||
// process. Called prior to force-killing the process.
|
||||
void GeneratePairedMinidump();
|
||||
|
||||
// Deletes a minidump created with GeneratePairedMinidump(). Should be called
|
||||
// if killing the process fails after generating the minidump.
|
||||
void DeletePairedMinidump();
|
||||
|
||||
// gfxVarReceiver overrides.
|
||||
void OnVarChanged(const GfxVarUpdate& aVar) override;
|
||||
|
||||
|
@ -108,13 +100,6 @@ class GPUChild final : public ipc::CrashReporterHelper<GeckoProcessType_GPU>,
|
|||
bool mGPUReady;
|
||||
bool mWaitForVarUpdate = false;
|
||||
bool mUnexpectedShutdown = false;
|
||||
// Whether a paired minidump has already been generated, meaning we do not
|
||||
// need to create a crash report in ActorDestroy().
|
||||
bool mCreatedPairedMinidumps = false;
|
||||
// The number of paired minidumps that have been created during this session.
|
||||
// Used to ensure we do not accumulate a large number of minidumps on disk
|
||||
// that may never be submitted.
|
||||
int mNumPairedMinidumpsCreated = 0;
|
||||
};
|
||||
|
||||
} // namespace gfx
|
||||
|
|
|
@ -181,7 +181,7 @@ void GPUProcessHost::Shutdown(bool aUnexpectedShutdown) {
|
|||
#ifndef NS_FREE_PERMANENT_DATA
|
||||
// No need to communicate shutdown, the GPU process doesn't need to
|
||||
// communicate anything back.
|
||||
KillHard(/* aGenerateMinidump */ false);
|
||||
KillHard("NormalShutdown");
|
||||
#endif
|
||||
|
||||
// If we're shutting down unexpectedly, we're in the middle of handling an
|
||||
|
@ -211,18 +211,9 @@ void GPUProcessHost::OnChannelClosed() {
|
|||
MOZ_ASSERT(!mGPUChild);
|
||||
}
|
||||
|
||||
void GPUProcessHost::KillHard(bool aGenerateMinidump) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (mGPUChild && aGenerateMinidump) {
|
||||
mGPUChild->GeneratePairedMinidump();
|
||||
}
|
||||
|
||||
const ProcessHandle handle = GetChildProcessHandle();
|
||||
void GPUProcessHost::KillHard(const char* aReason) {
|
||||
ProcessHandle handle = GetChildProcessHandle();
|
||||
if (!base::KillProcess(handle, base::PROCESS_END_KILLED_BY_USER)) {
|
||||
if (mGPUChild) {
|
||||
mGPUChild->DeletePairedMinidump();
|
||||
}
|
||||
NS_WARNING("failed to kill subprocess!");
|
||||
}
|
||||
|
||||
|
@ -231,9 +222,7 @@ void GPUProcessHost::KillHard(bool aGenerateMinidump) {
|
|||
|
||||
uint64_t GPUProcessHost::GetProcessToken() const { return mProcessToken; }
|
||||
|
||||
void GPUProcessHost::KillProcess(bool aGenerateMinidump) {
|
||||
KillHard(aGenerateMinidump);
|
||||
}
|
||||
void GPUProcessHost::KillProcess() { KillHard("DiagnosticKill"); }
|
||||
|
||||
void GPUProcessHost::CrashProcess() { mGPUChild->SendCrashProcess(); }
|
||||
|
||||
|
|
|
@ -104,9 +104,8 @@ class GPUProcessHost final : public mozilla::ipc::GeckoChildProcessHost {
|
|||
|
||||
void SetListener(Listener* aListener);
|
||||
|
||||
// Kills the GPU process. Used in normal operation to recover from an error,
|
||||
// as well as for tests and diagnostics.
|
||||
void KillProcess(bool aGenerateMinidump);
|
||||
// Kills the GPU process. Used for tests and diagnostics
|
||||
void KillProcess();
|
||||
|
||||
// Causes the GPU process to crash. Used for tests and diagnostics
|
||||
void CrashProcess();
|
||||
|
@ -129,7 +128,7 @@ class GPUProcessHost final : public mozilla::ipc::GeckoChildProcessHost {
|
|||
void OnChannelClosed();
|
||||
|
||||
// Kill the remote process, triggering IPC shutdown.
|
||||
void KillHard(bool aGenerateMinidump);
|
||||
void KillHard(const char* aReason);
|
||||
|
||||
void DestroyProcess();
|
||||
|
||||
|
|
|
@ -714,7 +714,7 @@ bool GPUProcessManager::DisableWebRenderConfig(wr::WebRenderError aError,
|
|||
// hopefully alleviate the situation.
|
||||
if (IsProcessStable(TimeStamp::Now())) {
|
||||
if (mProcess) {
|
||||
mProcess->KillProcess(/* aGenerateMinidump */ false);
|
||||
mProcess->KillProcess();
|
||||
} else {
|
||||
SimulateDeviceReset();
|
||||
}
|
||||
|
@ -1070,19 +1070,12 @@ void GPUProcessManager::CleanShutdown() {
|
|||
mVsyncIOThread = nullptr;
|
||||
}
|
||||
|
||||
void GPUProcessManager::KillProcess(bool aGenerateMinidump) {
|
||||
if (!NS_IsMainThread()) {
|
||||
RefPtr<Runnable> task = mTaskFactory.NewRunnableMethod(
|
||||
&GPUProcessManager::KillProcess, aGenerateMinidump);
|
||||
NS_DispatchToMainThread(task.forget());
|
||||
return;
|
||||
}
|
||||
|
||||
void GPUProcessManager::KillProcess() {
|
||||
if (!mProcess) {
|
||||
return;
|
||||
}
|
||||
|
||||
mProcess->KillProcess(aGenerateMinidump);
|
||||
mProcess->KillProcess();
|
||||
}
|
||||
|
||||
void GPUProcessManager::CrashProcess() {
|
||||
|
|
|
@ -178,9 +178,8 @@ class GPUProcessManager final : public GPUProcessHost::Listener {
|
|||
// true if the message was sent, false if not.
|
||||
bool NotifyGpuObservers(const char* aTopic);
|
||||
|
||||
// Kills the GPU process. Used in normal operation to recover from an error,
|
||||
// as well as for tests and diagnostics.
|
||||
void KillProcess(bool aGenerateMinidump = false);
|
||||
// Kills the GPU process. Used for tests and diagnostics
|
||||
void KillProcess();
|
||||
|
||||
// Causes the GPU process to crash. Used for tests and diagnostics
|
||||
void CrashProcess();
|
||||
|
|
|
@ -249,7 +249,7 @@ bool CompositorManagerChild::ShouldContinueFromReplyTimeout() {
|
|||
if (XRE_IsParentProcess()) {
|
||||
gfxCriticalNote << "Killing GPU process due to IPC reply timeout";
|
||||
MOZ_DIAGNOSTIC_ASSERT(GPUProcessManager::Get()->GetGPUChild());
|
||||
GPUProcessManager::Get()->KillProcess(/* aGenerateMinidump */ true);
|
||||
GPUProcessManager::Get()->KillProcess();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "mozilla/layers/UiCompositorControllerParent.h"
|
||||
#include "mozilla/gfx/GPUProcessManager.h"
|
||||
#include "mozilla/ipc/Endpoint.h"
|
||||
#include "mozilla/StaticPrefs_layers.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "nsBaseWidget.h"
|
||||
#include "nsProxyRelease.h"
|
||||
|
@ -288,8 +287,6 @@ void UiCompositorControllerChild::OpenForGPUProcess(
|
|||
return;
|
||||
}
|
||||
|
||||
SetReplyTimeout();
|
||||
|
||||
SendCachedValues();
|
||||
// Let Ui thread know the connection is open;
|
||||
RecvToolbarAnimatorMessageFromCompositor(COMPOSITOR_CONTROLLER_OPEN);
|
||||
|
@ -349,20 +346,5 @@ void UiCompositorControllerChild::OnCompositorSurfaceChanged(
|
|||
}
|
||||
#endif
|
||||
|
||||
void UiCompositorControllerChild::SetReplyTimeout() {
|
||||
#ifndef DEBUG
|
||||
// Add a timeout for release builds to kill GPU process when it hangs.
|
||||
const int32_t timeout =
|
||||
StaticPrefs::layers_gpu_process_ipc_reply_timeout_ms_AtStartup();
|
||||
SetReplyTimeoutMs(timeout);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool UiCompositorControllerChild::ShouldContinueFromReplyTimeout() {
|
||||
gfxCriticalNote << "Killing GPU process due to IPC reply timeout";
|
||||
gfx::GPUProcessManager::Get()->KillProcess(/* aGenerateMinidump */ true);
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -94,9 +94,6 @@ class UiCompositorControllerChild final
|
|||
void OpenForGPUProcess(Endpoint<PUiCompositorControllerChild>&& aEndpoint);
|
||||
void SendCachedValues();
|
||||
|
||||
void SetReplyTimeout();
|
||||
bool ShouldContinueFromReplyTimeout() override;
|
||||
|
||||
bool mIsOpen;
|
||||
uint64_t mProcessToken;
|
||||
Maybe<gfx::IntRect> mResize;
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "base/process.h"
|
||||
#include "nsExceptionHandler.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/ipc/GeckoChildProcessHost.h"
|
||||
#include "mozilla/ipc/ProtocolUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -56,7 +55,8 @@ class CrashReporterHost {
|
|||
// GenerateCrashReport does. After this, FinalizeCrashReport may be called.
|
||||
//
|
||||
// This calls TakeCrashedChildMinidump and FinalizeCrashReport.
|
||||
bool GenerateMinidumpAndPair(GeckoChildProcessHost* aChildProcessHost,
|
||||
template <typename Toplevel>
|
||||
bool GenerateMinidumpAndPair(Toplevel* aToplevelProtocol,
|
||||
const nsACString& aPairName) {
|
||||
auto childHandle = base::kInvalidProcessHandle;
|
||||
const auto cleanup = MakeScopeExit([&]() {
|
||||
|
@ -65,10 +65,10 @@ class CrashReporterHost {
|
|||
}
|
||||
});
|
||||
#ifdef XP_MACOSX
|
||||
childHandle = aChildProcessHost->GetChildTask();
|
||||
childHandle = aToplevelProtocol->Process()->GetChildTask();
|
||||
#else
|
||||
if (!base::OpenPrivilegedProcessHandle(
|
||||
aChildProcessHost->GetChildProcessId(), &childHandle)) {
|
||||
if (!base::OpenPrivilegedProcessHandle(aToplevelProtocol->OtherPid(),
|
||||
&childHandle)) {
|
||||
NS_WARNING("Failed to open child process handle.");
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1265,9 +1265,6 @@ class LayerViewSupport final
|
|||
void SyncPauseCompositor() {
|
||||
MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
|
||||
|
||||
// Set this true prior to attempting to pause the compositor, so that if
|
||||
// pausing fails the subsequent recovery knows to initialize the compositor
|
||||
// in a paused state.
|
||||
mCompositorPaused = true;
|
||||
|
||||
if (mUiCompositorControllerChild) {
|
||||
|
@ -1302,12 +1299,8 @@ class LayerViewSupport final
|
|||
void SyncResumeCompositor() {
|
||||
MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
|
||||
|
||||
// Set this false prior to attempting to resume the compositor, so that if
|
||||
// resumption fails the subsequent recovery knows to initialize the
|
||||
// compositor in a resumed state.
|
||||
mCompositorPaused = false;
|
||||
|
||||
if (mUiCompositorControllerChild) {
|
||||
mCompositorPaused = false;
|
||||
bool resumed = mUiCompositorControllerChild->Resume();
|
||||
if (!resumed) {
|
||||
gfxCriticalNote
|
||||
|
@ -1323,11 +1316,6 @@ class LayerViewSupport final
|
|||
jni::Object::Param aSurfaceControl) {
|
||||
MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
|
||||
|
||||
// Set this false prior to attempting to resume the compositor, so that if
|
||||
// resumption fails the subsequent recovery knows to initialize the
|
||||
// compositor in a resumed state.
|
||||
mCompositorPaused = false;
|
||||
|
||||
mX = aX;
|
||||
mY = aY;
|
||||
mWidth = aWidth;
|
||||
|
@ -1374,6 +1362,8 @@ class LayerViewSupport final
|
|||
|
||||
mRequestedNewSurface = false;
|
||||
|
||||
mCompositorPaused = false;
|
||||
|
||||
class OnResumedEvent : public nsAppShell::Event {
|
||||
GeckoSession::Compositor::GlobalRef mCompositor;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче