Title: [229330] trunk/Source/WTF
Revision
229330
Author
mcatanz...@igalia.com
Date
2018-03-06 11:10:52 -0800 (Tue, 06 Mar 2018)

Log Message

Remove unused crash hook functionality
https://bugs.webkit.org/show_bug.cgi?id=183369

Reviewed by Alexey Proskuryakov.

WTFSetCrashHook and WTFInstallReportBacktraceOnCrashHook are not used on any platforms and
can be removed.

* wtf/Assertions.cpp:
* wtf/Assertions.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (229329 => 229330)


--- trunk/Source/WTF/ChangeLog	2018-03-06 18:48:04 UTC (rev 229329)
+++ trunk/Source/WTF/ChangeLog	2018-03-06 19:10:52 UTC (rev 229330)
@@ -1,3 +1,16 @@
+2018-03-06  Michael Catanzaro  <mcatanz...@igalia.com>
+
+        Remove unused crash hook functionality
+        https://bugs.webkit.org/show_bug.cgi?id=183369
+
+        Reviewed by Alexey Proskuryakov.
+
+        WTFSetCrashHook and WTFInstallReportBacktraceOnCrashHook are not used on any platforms and
+        can be removed.
+
+        * wtf/Assertions.cpp:
+        * wtf/Assertions.h:
+
 2018-03-05  Yusuke Suzuki  <utatane....@gmail.com>
 
         Fix std::make_unique / new[] using system malloc

Modified: trunk/Source/WTF/wtf/Assertions.cpp (229329 => 229330)


--- trunk/Source/WTF/wtf/Assertions.cpp	2018-03-06 18:48:04 UTC (rev 229329)
+++ trunk/Source/WTF/wtf/Assertions.cpp	2018-03-06 19:10:52 UTC (rev 229330)
@@ -251,19 +251,9 @@
     out.print(stackTrace);
 }
 
-static WTFCrashHookFunction globalHook = 0;
-
-void WTFSetCrashHook(WTFCrashHookFunction function)
-{
-    globalHook = function;
-}
-
 #if !defined(NDEBUG) || !OS(DARWIN)
 void WTFCrash()
 {
-    if (globalHook)
-        globalHook();
-
     WTFReportBacktrace();
 #if ASAN_ENABLED
     __builtin_trap();
@@ -292,42 +282,6 @@
     CRASH();
 }
 
-#if HAVE(SIGNAL_H)
-static NO_RETURN void dumpBacktraceSignalHandler(int sig)
-{
-    WTFReportBacktrace();
-    exit(128 + sig);
-}
-
-static void installSignalHandlersForFatalErrors(void (*handler)(int))
-{
-    signal(SIGILL, handler); //    4: illegal instruction (not reset when caught).
-    signal(SIGTRAP, handler); //   5: trace trap (not reset when caught).
-    signal(SIGFPE, handler); //    8: floating point exception.
-    signal(SIGBUS, handler); //   10: bus error.
-    signal(SIGSEGV, handler); //  11: segmentation violation.
-    signal(SIGSYS, handler); //   12: bad argument to system call.
-    signal(SIGPIPE, handler); //  13: write on a pipe with no reader.
-    signal(SIGXCPU, handler); //  24: exceeded CPU time limit.
-    signal(SIGXFSZ, handler); //  25: exceeded file size limit.
-}
-
-static void resetSignalHandlersForFatalErrors()
-{
-    installSignalHandlersForFatalErrors(SIG_DFL);
-}
-#endif
-
-void WTFInstallReportBacktraceOnCrashHook()
-{
-#if HAVE(SIGNAL_H)
-    // Needed otherwise we are going to dump the stack trace twice
-    // in case we hit an assertion.
-    WTFSetCrashHook(&resetSignalHandlersForFatalErrors);
-    installSignalHandlersForFatalErrors(&dumpBacktraceSignalHandler);
-#endif
-}
-
 bool WTFIsDebuggerAttached()
 {
 #if OS(DARWIN)

Modified: trunk/Source/WTF/wtf/Assertions.h (229329 => 229330)


--- trunk/Source/WTF/wtf/Assertions.h	2018-03-06 18:48:04 UTC (rev 229329)
+++ trunk/Source/WTF/wtf/Assertions.h	2018-03-06 19:10:52 UTC (rev 229330)
@@ -200,10 +200,6 @@
 WTF_EXPORT_PRIVATE void WTFReportBacktrace(void);
 WTF_EXPORT_PRIVATE void WTFPrintBacktrace(void** stack, int size);
 
-typedef void (*WTFCrashHookFunction)(void);
-WTF_EXPORT_PRIVATE void WTFSetCrashHook(WTFCrashHookFunction);
-WTF_EXPORT_PRIVATE void WTFInstallReportBacktraceOnCrashHook(void);
-
 WTF_EXPORT_PRIVATE bool WTFIsDebuggerAttached(void);
 
 #if ASAN_ENABLED
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to