Commit 9ceb4d33 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5672 try adding some ways to crash that hopefully print a stacktrace


git-svn-id: file:///svn/toku/tokudb@50946 c7de825b-a66e-492c-adef-691d508d4ae1
parent 8b299e3e
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>
#include "toku_assert.h"
//Simulate as hard a crash as possible. //Simulate as hard a crash as possible.
//Choices: //Choices:
...@@ -77,8 +78,11 @@ toku_hard_crash_on_purpose(void) { ...@@ -77,8 +78,11 @@ toku_hard_crash_on_purpose(void) {
// 12 SIGSYS create core image // 12 SIGSYS create core image
// //
// We'll raise these in some sequence (common ones first), then try emulating the things that would cause these signals to be raised, then eventually just try to die normally and then loop like abort does. // We'll raise these in some sequence (common ones first), then try emulating the things that would cause these signals to be raised, then eventually just try to die normally and then loop like abort does.
// Start with a toku assert because that hopefully prints a stacktrace.
static void __attribute__((unused, noreturn)) static void __attribute__((unused, noreturn))
toku_crash_and_dump_core_on_purpose(void) { toku_crash_and_dump_core_on_purpose(void) {
assert(false);
invariant(0);
raise(SIGQUIT); raise(SIGQUIT);
raise(SIGILL); raise(SIGILL);
raise(SIGABRT); raise(SIGABRT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment