Bug 1784039 - Remove the isLikelyOOM property from ipc:content-shutdown messages r=jld

Differential Revision: https://phabricator.services.mozilla.com/D154226
This commit is contained in:
Gabriele Svelto 2022-09-13 07:01:57 +00:00
parent d775441707
commit a7d2695d2a
6 changed files with 1 additions and 59 deletions

View file

@ -2095,11 +2095,7 @@ void ContentParent::ActorDestroy(ActorDestroyReason why) {
memWatcher->AddChildAnnotations(mCrashReporter);
#endif
if (mCrashReporter->GenerateCrashReport(OtherPid())) {
// Propagate `isLikelyOOM`.
Unused << props->SetPropertyAsBool(u"isLikelyOOM"_ns,
mCrashReporter->IsLikelyOOM());
}
mCrashReporter->GenerateCrashReport(OtherPid());
}
if (mCrashReporter->HasMinidump()) {

View file

@ -5,9 +5,3 @@ support-files =
[test_process_error.xhtml]
skip-if = !crashreporter
[test_process_error_oom.xhtml]
skip-if =
!crashreporter
os == "linux" && bits == 64 # Bug 1624397

View file

@ -32,10 +32,6 @@
if ('nsICrashReporter' in Ci) {
dumpID = subject.getPropertyAsAString('dumpID');
ok(dumpID, "dumpID is present and not an empty string");
// Let's check whether we have correctly reported OOM.
var isLikelyOOM = subject.getPropertyAsBool('isLikelyOOM');
is(isLikelyOOM, crashType == 'CRASH_OOM', 'isLikelyOOM is correct');
}
Services.obs.removeObserver(crashObserver, 'ipc:content-shutdown');

View file

@ -1,22 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script>
SimpleTest.waitForExplicitFinish();
SimpleTest.expectChildProcessCrash();
var w = window.browsingContext.topChromeWindow.openDialog('process_error.xhtml?crashType=CRASH_OOM', '_blank', 'chrome,resizable=yes,width=400,height=600', window);
function done()
{
w.close();
SimpleTest.finish();
}
</script>
<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;" />
</window>

View file

@ -177,19 +177,5 @@ void CrashReporterHost::AddAnnotation(CrashReporter::Annotation aKey,
mExtraAnnotations[aKey] = aValue;
}
bool CrashReporterHost::IsLikelyOOM() {
// The data is only populated during the call to `FinalizeCrashReport()`.
MOZ_ASSERT(mFinalized);
// If `OOMAllocationSize` was set, we know that the crash happened
// because an allocation failed (`malloc` returned `nullptr`).
//
// As Unix systems generally allow `malloc` to return a non-null value
// even when no virtual memory is available, this doesn't cover all
// cases of OOM under Unix (far from it).
return mExtraAnnotations[CrashReporter::Annotation::OOMAllocationSize]
.Length() > 0;
}
} // namespace ipc
} // namespace mozilla

View file

@ -93,14 +93,6 @@ class CrashReporterHost {
return mExtraAnnotations[CrashReporter::Annotation::additional_minidumps];
}
// Return `true` if this crash reporter has been identified as a likely OOM.
//
// At the time of this writing, OOMs detection is considered reliable under
// Windows but other platforms quite often return false negatives.
//
// `CrashReporterHost::FinalizeCrashReport()` MUST have been called already.
bool IsLikelyOOM();
// This is a static helper function to notify the crash service that a
// crash has occurred and record the crash with telemetry. This can be called
// from any thread, and if not called from the main thread, will post a