Bug 1423261: Close the IPC channel during KillHard shutdowns to prevent shutdown crashes in the parent process. r=jimm
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -3185,27 +3185,36 @@ ContentParent::KillHard(const char* aRea
NS_LITERAL_CSTRING("ipc_channel_error"),
reason);
Telemetry::Accumulate(Telemetry::SUBPROCESS_KILL_HARD, reason, 1);
RefPtr<ContentParent> self = this;
std::function<void(bool)> callback = [self](bool aResult) {
self->OnGenerateMinidumpComplete(aResult);
+ MessageChannel* channel = self->GetIPCChannel();
+ if (channel) {
+ channel->Close();
+ }
};
// Generate the report and insert into the queue for submittal.
mCrashReporter->GenerateMinidumpAndPair(Process(),
nullptr,
NS_LITERAL_CSTRING("browser"),
Move(callback),
true);
return;
}
OnGenerateMinidumpComplete(false);
+
+ MessageChannel* channel = GetIPCChannel();
+ if (channel) {
+ channel->Close();
+ }
}
void
ContentParent::OnGenerateMinidumpComplete(bool aDumpResult)
{
if (mCrashReporter && aDumpResult) {
// CrashReporterHost::GenerateMinidumpAndPair() is successful.
mCreatedPairedMinidumps = mCrashReporter->FinalizeCrashReport();