From: Date: May 18 2006 5:39pm Subject: bk commit into 4.1 tree (msvensson:1.2472) BUG#15869 List-Archive: http://lists.mysql.com/commits/6574 X-Bug: 15869 Message-Id: <20060518153906.8CE7286DE76@localhost.localdomain> Below is the list of changes that have just been committed into a local 4.1 repository of msvensson. When msvensson does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2472 06/05/18 17:39:01 msvensson@neptunus.(none) +2 -0 Bug#15869 Cannot shutdown the server - it restarts - A segfault occured when the function 'kill_server' called 'my_sigset' with signal number 0. 'my_sigset' is a macro which uses 'sigaction' to install the signal handler with an invalid signal number will on most platforms return EINVAL but yields a segfauilt on IRIX 6.5 - The server crash was detected by mysqld_safe and it was restarted although a shutdown was requested. sql/mysqld.cc 1.612 06/05/18 17:38:58 msvensson@neptunus.(none) +2 -1 Don't call my_sigset if signo is 0 include/my_pthread.h 1.82 06/05/18 17:38:58 msvensson@neptunus.(none) +4 -2 Check return value from sigaction with a DBUG_ASSERT Also DBUG_ASSERT if signla number 0 is passed # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: msvensson # Host: neptunus.(none) # Root: /home/msvensson/mysql/my41-bug13711 --- 1.81/include/my_pthread.h 2005-10-11 18:12:09 +02:00 +++ 1.82/include/my_pthread.h 2006-05-18 17:38:58 +02:00 @@ -329,12 +329,14 @@ we want to make sure that no such flags are set. */ #if defined(HAVE_SIGACTION) && !defined(my_sigset) -#define my_sigset(A,B) do { struct sigaction s; sigset_t set; \ +#define my_sigset(A,B) do { struct sigaction s; sigset_t set; int rc; \ + DBUG_ASSERT((A) != 0); \ sigemptyset(&set); \ s.sa_handler = (B); \ s.sa_mask = set; \ s.sa_flags = 0; \ - sigaction((A), &s, (struct sigaction *) NULL); \ + rc= sigaction((A), &s, (struct sigaction *) NULL);\ + DBUG_ASSERT(rc == 0); \ } while (0) #elif defined(HAVE_SIGSET) && !defined(my_sigset) #define my_sigset(A,B) sigset((A),(B)) --- 1.611/sql/mysqld.cc 2006-04-13 12:06:37 +02:00 +++ 1.612/sql/mysqld.cc 2006-05-18 17:38:58 +02:00 @@ -884,7 +884,8 @@ RETURN_FROM_KILL_SERVER; kill_in_progress=TRUE; abort_loop=1; // This should be set - my_sigset(sig,SIG_IGN); + if (sig != 0) // 0 is not a valid signal number + my_sigset(sig,SIG_IGN); if (sig == MYSQL_KILL_SIGNAL || sig == 0) sql_print_information(ER(ER_NORMAL_SHUTDOWN),my_progname); else