Skip to content

Commit

Permalink
Bug #58426 Crashing tests not failing as they are supposed to on Sola…
Browse files Browse the repository at this point in the history
…ris 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>)
  • Loading branch information
Tor Didriksen committed Dec 13, 2010
1 parent 4096f35 commit 7c36c7e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions dbug/dbug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion include/my_dbug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 7c36c7e

Please sign in to comment.