Title: [238478] trunk/Source/WTF
Revision
238478
Author
mcatanz...@igalia.com
Date
2018-11-25 10:22:30 -0800 (Sun, 25 Nov 2018)

Log Message

CRASH() should call abort() except on Darwin and in developer builds
https://bugs.webkit.org/show_bug.cgi?id=184408

Reviewed by Daniel Bates.

CRASH() should call abort() except on Darwin and in developer builds, as discussed on
webkit-dev. This should be slightly nicer than dereferencing 0xbadbeef.

On Darwin, CRASH() uses a breakpoint trap, which seems to corrupt the stack on Linux, so we
can't do that.

Continue to call WTFCrash() in developer mode, and make no changes to WTFCrash(), since it
is reportedly useful in nightmare scenarios where core dumps are unavailable.

We also have to define CRASH_UNDER_CONSTEXPR_CONTEXT(). It's a bit odd that it's possible to
use a non-constexpr function here, but it works. Currently this macro uses WTFCrash(), which
is also non-constexpr.

* wtf/Assertions.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (238477 => 238478)


--- trunk/Source/WTF/ChangeLog	2018-11-25 16:22:46 UTC (rev 238477)
+++ trunk/Source/WTF/ChangeLog	2018-11-25 18:22:30 UTC (rev 238478)
@@ -1,5 +1,27 @@
 2018-11-25  Michael Catanzaro  <mcatanz...@igalia.com>
 
+        CRASH() should call abort() except on Darwin and in developer builds
+        https://bugs.webkit.org/show_bug.cgi?id=184408
+
+        Reviewed by Daniel Bates.
+
+        CRASH() should call abort() except on Darwin and in developer builds, as discussed on
+        webkit-dev. This should be slightly nicer than dereferencing 0xbadbeef.
+
+        On Darwin, CRASH() uses a breakpoint trap, which seems to corrupt the stack on Linux, so we
+        can't do that.
+
+        Continue to call WTFCrash() in developer mode, and make no changes to WTFCrash(), since it
+        is reportedly useful in nightmare scenarios where core dumps are unavailable.
+
+        We also have to define CRASH_UNDER_CONSTEXPR_CONTEXT(). It's a bit odd that it's possible to
+        use a non-constexpr function here, but it works. Currently this macro uses WTFCrash(), which
+        is also non-constexpr.
+
+        * wtf/Assertions.h:
+
+2018-11-25  Michael Catanzaro  <mcatanz...@igalia.com>
+
         Unreviewed, rolling out r238469.
 
         Broke the build

Modified: trunk/Source/WTF/wtf/Assertions.h (238477 => 238478)


--- trunk/Source/WTF/wtf/Assertions.h	2018-11-25 16:22:46 UTC (rev 238477)
+++ trunk/Source/WTF/wtf/Assertions.h	2018-11-25 18:22:30 UTC (rev 238478)
@@ -44,6 +44,7 @@
 #include <stdarg.h>
 #include <stdbool.h>
 #include <stddef.h>
+#include <stdlib.h>
 #include <wtf/ExportMacros.h>
 
 #if USE(OS_LOG)
@@ -239,6 +240,9 @@
     WTFBreakpointTrapUnderConstexprContext(); \
     __builtin_unreachable(); \
 } while (0)
+#elif !ENABLE(DEVELOPER_MODE) && !OS(DARWIN)
+#define CRASH() abort()
+#define CRASH_UNDER_CONSTEXPR_CONTEXT() abort()
 #else
 #define CRASH() WTFCrash()
 #define CRASH_UNDER_CONSTEXPR_CONTEXT() WTFCrash()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to