Title: [238469] trunk/Source/WTF
Revision
238469
Author
mcatanz...@igalia.com
Date
2018-11-24 07:13:15 -0800 (Sat, 24 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.

* wtf/Assertions.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (238468 => 238469)


--- trunk/Source/WTF/ChangeLog	2018-11-24 07:17:35 UTC (rev 238468)
+++ trunk/Source/WTF/ChangeLog	2018-11-24 15:13:15 UTC (rev 238469)
@@ -1,3 +1,21 @@
+2018-11-24  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.
+
+        * wtf/Assertions.h:
+
 2018-11-23  Sam Weinig  <s...@webkit.org>
 
         Add raw pointer overloads to ListHashSet via SmartPtr specialized functions

Modified: trunk/Source/WTF/wtf/Assertions.h (238468 => 238469)


--- trunk/Source/WTF/wtf/Assertions.h	2018-11-24 07:17:35 UTC (rev 238468)
+++ trunk/Source/WTF/wtf/Assertions.h	2018-11-24 15:13:15 UTC (rev 238469)
@@ -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,8 @@
     WTFBreakpointTrapUnderConstexprContext(); \
     __builtin_unreachable(); \
 } while (0)
+#elif !ENABLE(DEVELOPER_MODE) && !OS(DARWIN)
+#define CRASH() 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