mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
refs #5671 get cores on alarm failure
git-svn-id: file:///svn/toku/tokudb@50277 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
55894dacb4
commit
c44f2c3d78
1 changed files with 8 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <signal.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -1487,6 +1488,11 @@ static void *test_time(void *arg) {
|
||||||
return arg;
|
return arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void crashing_alarm_handler(int sig) {
|
||||||
|
assert(sig == SIGALRM);
|
||||||
|
toku_hard_crash_on_purpose();
|
||||||
|
}
|
||||||
|
|
||||||
static int run_workers(
|
static int run_workers(
|
||||||
struct arg *thread_args,
|
struct arg *thread_args,
|
||||||
int num_threads,
|
int num_threads,
|
||||||
|
@ -1534,6 +1540,8 @@ static int run_workers(
|
||||||
void *ret;
|
void *ret;
|
||||||
r = toku_pthread_join(time_tid, &ret); assert_zero(r);
|
r = toku_pthread_join(time_tid, &ret); assert_zero(r);
|
||||||
if (verbose) printf("%lu joined\n", (unsigned long) time_tid);
|
if (verbose) printf("%lu joined\n", (unsigned long) time_tid);
|
||||||
|
sighandler_t old_alarm = signal(SIGALRM, crashing_alarm_handler);
|
||||||
|
assert(old_alarm != SIG_ERR);
|
||||||
// Set an alarm that will kill us if it takes too long to join all the
|
// Set an alarm that will kill us if it takes too long to join all the
|
||||||
// threads (i.e. there is some runaway thread).
|
// threads (i.e. there is some runaway thread).
|
||||||
unsigned int remaining = alarm(cli_args->join_timeout);
|
unsigned int remaining = alarm(cli_args->join_timeout);
|
||||||
|
|
Loading…
Add table
Reference in a new issue