Bug 1481009 Part 6 - Cleanly shutdown middleman processes after a recording/replaying child crashes, r=froydnj.

--HG--
extra : rebase_source : bbdd58e8db173030c25fd2905be3b24d8d71f599
This commit is contained in:
Brian Hackett 2018-08-13 20:47:49 +00:00
Родитель 71986ca9f7
Коммит ed1cb3c6c3
4 изменённых файлов: 16 добавлений и 5 удалений

Просмотреть файл

@ -578,6 +578,11 @@ ProxyStreamValid:
Set to "false" when encountering an invalid IPC proxy stream.
type: string
RecordReplayError:
description: >
Any fatal error that occurred while recording/replaying a tab.
type: string
ReleaseChannel:
description: >
Application release channel (e.g. default, beta, ...)

Просмотреть файл

@ -164,7 +164,13 @@ Channel::SendMessage(const Message& aMsg)
size_t nbytes = aMsg.mSize;
while (nbytes) {
int rv = HANDLE_EINTR(send(mFd, ptr, nbytes, 0));
MOZ_RELEASE_ASSERT((size_t) rv <= nbytes);
if (rv < 0) {
// If the other side of the channel has crashed, don't send the message.
// Avoid crashing in this process too, so that we don't generate another
// minidump that masks the original crash.
MOZ_RELEASE_ASSERT(errno == EPIPE);
return;
}
ptr += rv;
nbytes -= rv;
}

Просмотреть файл

@ -550,9 +550,9 @@ ChildProcessInfo::AttemptRestart(const char* aWhy)
PrintSpew("Warning: Child process died [%d]: %s\n", (int) GetId(), aWhy);
if (!CanRestart()) {
nsAutoCString why(aWhy);
dom::ContentChild::GetSingleton()->SendRecordReplayFatalError(why);
Thread::WaitForeverNoIdle();
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::RecordReplayError,
nsAutoCString(aWhy));
Shutdown();
}
mNumRestarts++;

Просмотреть файл

@ -322,7 +322,7 @@ public:
}
virtual void OnChannelError() override {
MOZ_CRASH("MiddlemanProtocol::OnChannelError");
MainThreadMessageLoop()->PostTask(NewRunnableFunction("Shutdown", Shutdown));
}
};