Bug 1590034 - Use MOZ_CRASH_UNSAFE in AutoEnterOOMUnsafeRegion::crash. r=jonco

This way the |reason| string will be available on crash-stats.

Differential Revision: https://phabricator.services.mozilla.com/D49879

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jan de Mooij 2019-10-22 07:09:46 +00:00
Родитель 55616a415e
Коммит 29938be504
2 изменённых файлов: 8 добавлений и 4 удалений

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

@ -545,8 +545,7 @@ def check_output(out, err, rc, timed_out, test, options):
# Allow a non-zero exit code if we want to allow unhandlable OOM, but # Allow a non-zero exit code if we want to allow unhandlable OOM, but
# only if we actually got unhandlable OOM. # only if we actually got unhandlable OOM.
if test.allow_unhandlable_oom \ if test.allow_unhandlable_oom and 'MOZ_CRASH([unhandlable oom]' in err:
and 'Assertion failure: [unhandlable oom]' in err:
return True return True
# Allow a non-zero exit code if we want to all too-much-recursion and # Allow a non-zero exit code if we want to all too-much-recursion and

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

@ -1516,8 +1516,13 @@ void AutoEnterOOMUnsafeRegion::crash(const char* reason) {
char msgbuf[1024]; char msgbuf[1024];
js::NoteIntentionalCrash(); js::NoteIntentionalCrash();
SprintfLiteral(msgbuf, "[unhandlable oom] %s", reason); SprintfLiteral(msgbuf, "[unhandlable oom] %s", reason);
MOZ_ReportAssertionFailure(msgbuf, __FILE__, __LINE__); #ifndef DEBUG
MOZ_CRASH(); // In non-DEBUG builds MOZ_CRASH normally doesn't print to stderr so we have
// to do this explicitly (the jit-test allow-unhandlable-oom annotation and
// fuzzers depend on it).
MOZ_ReportCrash(msgbuf, __FILE__, __LINE__);
#endif
MOZ_CRASH_UNSAFE(msgbuf);
} }
AutoEnterOOMUnsafeRegion::AnnotateOOMAllocationSizeCallback AutoEnterOOMUnsafeRegion::AnnotateOOMAllocationSizeCallback