summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2010-12-13 12:19:30 +0100
committerTor Didriksen <tor.didriksen@oracle.com>2010-12-13 12:19:30 +0100
commit7c36c7e93cd154c8f154a1bc33c9a7557c5caa8d (patch)
treecaa89834fdf3ced0f320f17115472e03e2a68e0d
parent4096f35a395cee270218ae220b921af567ae26da (diff)
downloadmariadb-git-7c36c7e93cd154c8f154a1bc33c9a7557c5caa8d.tar.gz
Bug #58426 Crashing tests not failing as they are supposed to on Solaris 10 debug
On this platform we seem to get lots of other signals while waiting for SIGKILL to be delivered. Solution: use sigsuspend(<all signals blocked>)
-rw-r--r--dbug/dbug.c19
-rw-r--r--include/my_dbug.h3
2 files changed, 21 insertions, 1 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c
index fecdd4f8a6c..06a9f7b4bac 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -2276,6 +2276,25 @@ void _db_flush_()
}
+#ifndef __WIN__
+void _db_suicide_()
+{
+ int retval;
+ sigset_t new_mask;
+ sigfillset(&new_mask);
+
+ fprintf(stderr, "SIGKILL myself\n");
+ fflush(stderr);
+
+ retval= kill(getpid(), SIGKILL);
+ assert(retval == 0);
+ retval= sigsuspend(&new_mask);
+ fprintf(stderr, "sigsuspend returned %d errno %d \n", retval, errno);
+ assert(FALSE); /* With full signal mask, we should never return here. */
+}
+#endif /* ! __WIN__ */
+
+
void _db_lock_file_()
{
CODE_STATE *cs=0;
diff --git a/include/my_dbug.h b/include/my_dbug.h
index f08e94a1882..1ae9a50c76d 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -160,7 +160,8 @@ extern void _db_flush_();
#ifdef __WIN__
#define DBUG_SUICIDE() DBUG_ABORT()
#else
-#define DBUG_SUICIDE() (_db_flush_(), kill(getpid(), SIGKILL), pause())
+extern void _db_suicide_();
+#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_())
#endif
#else /* No debugger */