summaryrefslogtreecommitdiff
path: root/dbug/dbug.c
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2010-12-13 17:13:01 +0100
committerTor Didriksen <tor.didriksen@oracle.com>2010-12-13 17:13:01 +0100
commitfda629004112411c0bda78d1bb0ab9fe6d894a26 (patch)
tree2d21c3e909e033669e94ff609dc73456ac17c223 /dbug/dbug.c
parent1faf910eeb4e8f40253bf34b634af5332f367dc5 (diff)
downloadmariadb-git-fda629004112411c0bda78d1bb0ab9fe6d894a26.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>) dbug/dbug.c: New function _db_suicide_() which does kill(myself, -9) and then waits forever. include/my_dbug.h: Let DBUG_SUICE wait forever until the KILL signal is delivered, and process dies.
Diffstat (limited to 'dbug/dbug.c')
-rw-r--r--dbug/dbug.c19
1 files changed, 19 insertions, 0 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;