Bug 1201994 - Replace mozalloc_abort() with MOZ_CRASH_UNSAFE() in NS_DebugBreak(). r=xpcom-reviewers,mccr8

mozalloc_abort() implies OOM. NS_DebugBreak() is used for other debug breaks and aborts. Calling MOZ_CRASH_UNSAFE(aMsg) instead of MOZ_CRASH() is unlikely to cause new OOM crashes because NS_DebugBreak() already did a lot of work to format aMsg and walk the stack before calling Abort() and MOZ_CRASH_UNSAFE(aMsg).

Differential Revision: https://phabricator.services.mozilla.com/D129116
This commit is contained in:
Chris Peterson 2021-10-22 02:14:57 +00:00
Родитель 0050ecda2d
Коммит cdadc6c4db
1 изменённых файлов: 1 добавлений и 3 удалений

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

@ -80,8 +80,6 @@
# define KP_FLAGS p_flag
#endif
#include "mozilla/mozalloc_abort.h"
static void Abort(const char* aMsg);
static void RealBreak();
@ -449,7 +447,7 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr,
static void Abort(const char* aMsg) {
NoteIntentionalCrash(XRE_GetProcessTypeString());
mozalloc_abort(aMsg);
MOZ_CRASH_UNSAFE(aMsg);
}
static void RealBreak() {