Skip to content

Commit 7c36c7e

Browse files
author
Tor Didriksen
committed
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>)
1 parent 4096f35 commit 7c36c7e

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

dbug/dbug.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,6 +2276,25 @@ void _db_flush_()
22762276
}
22772277

22782278

2279+
#ifndef __WIN__
2280+
void _db_suicide_()
2281+
{
2282+
int retval;
2283+
sigset_t new_mask;
2284+
sigfillset(&new_mask);
2285+
2286+
fprintf(stderr, "SIGKILL myself\n");
2287+
fflush(stderr);
2288+
2289+
retval= kill(getpid(), SIGKILL);
2290+
assert(retval == 0);
2291+
retval= sigsuspend(&new_mask);
2292+
fprintf(stderr, "sigsuspend returned %d errno %d \n", retval, errno);
2293+
assert(FALSE); /* With full signal mask, we should never return here. */
2294+
}
2295+
#endif /* ! __WIN__ */
2296+
2297+
22792298
void _db_lock_file_()
22802299
{
22812300
CODE_STATE *cs=0;

include/my_dbug.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ extern void _db_flush_();
160160
#ifdef __WIN__
161161
#define DBUG_SUICIDE() DBUG_ABORT()
162162
#else
163-
#define DBUG_SUICIDE() (_db_flush_(), kill(getpid(), SIGKILL), pause())
163+
extern void _db_suicide_();
164+
#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_())
164165
#endif
165166

166167
#else /* No debugger */

0 commit comments

Comments
 (0)