From be343871b9496b24fd0b97c8850efd08dd4ed170 Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Mon, 3 Sep 2012 22:01:24 -0400 Subject: [PATCH] Bug 787675 - When jemalloc hits a fatal assertion, crash within a new stack frame, in the hopes of making the crashstats more understandable. r=glandium --- memory/mozjemalloc/jemalloc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/memory/mozjemalloc/jemalloc.c b/memory/mozjemalloc/jemalloc.c index 631e736ed2e..289c25e07d0 100644 --- a/memory/mozjemalloc/jemalloc.c +++ b/memory/mozjemalloc/jemalloc.c @@ -1551,11 +1551,21 @@ void (*_malloc_message)(const char *p1, const char *p2, const char *p3, #endif #include +#include + +/* RELEASE_ASSERT calls jemalloc_crash() instead of calling MOZ_CRASH() + * directly because we want crashing to add a frame to the stack. This makes + * it easier to find the failing assertion in crash stacks. */ +MOZ_NEVER_INLINE static void +jemalloc_crash() +{ + MOZ_CRASH(); +} #if defined(MOZ_JEMALLOC_HARD_ASSERTS) # define RELEASE_ASSERT(assertion) do { \ if (!(assertion)) { \ - MOZ_CRASH(); \ + jemalloc_crash(); \ } \ } while (0) #else