mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
Bug 1481009 Part 6 - Cleanly shutdown middleman processes after a recording/replaying child crashes, r=froydnj.
--HG-- extra : rebase_source : 2147c889acf725dad16d2878ea77ce605a19f046
This commit is contained in:
parent
787cdfdba6
commit
6da96bb9e8
@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user