diff --git a/js/src/tests/lib/jittests.py b/js/src/tests/lib/jittests.py index ce7585b85267..7ba9bdba60df 100755 --- a/js/src/tests/lib/jittests.py +++ b/js/src/tests/lib/jittests.py @@ -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 # only if we actually got unhandlable OOM. - if test.allow_unhandlable_oom \ - and 'Assertion failure: [unhandlable oom]' in err: + if test.allow_unhandlable_oom and 'MOZ_CRASH([unhandlable oom]' in err: return True # Allow a non-zero exit code if we want to all too-much-recursion and diff --git a/js/src/vm/JSContext.cpp b/js/src/vm/JSContext.cpp index eee75f0bdc74..56ed64c053b1 100644 --- a/js/src/vm/JSContext.cpp +++ b/js/src/vm/JSContext.cpp @@ -1516,8 +1516,13 @@ void AutoEnterOOMUnsafeRegion::crash(const char* reason) { char msgbuf[1024]; js::NoteIntentionalCrash(); SprintfLiteral(msgbuf, "[unhandlable oom] %s", reason); - MOZ_ReportAssertionFailure(msgbuf, __FILE__, __LINE__); - MOZ_CRASH(); +#ifndef DEBUG + // 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