mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug#31745 - crash handler does not work on Windows
- Replace per-thread signal()'s with SetUnhandledExceptionFilter(). The only remaining signal() is for SIGABRT (default abort() handler in VS2005 is broken, i.e removes user exception filter) - remove MessageBox()'es from error handling code - Windows port for print_stacktrace() and write_core() - Cleanup, removed some unused functions
This commit is contained in:
@@ -98,22 +98,7 @@ static bool do_command(THD *thd);
|
||||
#endif // EMBEDDED_LIBRARY
|
||||
|
||||
#ifdef __WIN__
|
||||
static void test_signal(int sig_ptr)
|
||||
{
|
||||
#if !defined( DBUG_OFF)
|
||||
MessageBox(NULL,"Test signal","DBUG",MB_OK);
|
||||
#endif
|
||||
#if defined(OS2)
|
||||
fprintf(stderr, "Test signal %d\n", sig_ptr);
|
||||
fflush(stderr);
|
||||
#endif
|
||||
}
|
||||
static void init_signals(void)
|
||||
{
|
||||
int signals[7] = {SIGINT,SIGILL,SIGFPE,SIGSEGV,SIGTERM,SIGBREAK,SIGABRT } ;
|
||||
for (int i=0 ; i < 7 ; i++)
|
||||
signal( signals[i], test_signal) ;
|
||||
}
|
||||
extern void win_install_sigabrt_handler(void);
|
||||
#endif
|
||||
|
||||
static void unlock_locked_tables(THD *thd)
|
||||
@@ -1124,7 +1109,7 @@ pthread_handler_t handle_one_connection(void *arg)
|
||||
/* now that we've called my_thread_init(), it is safe to call DBUG_* */
|
||||
|
||||
#if defined(__WIN__)
|
||||
init_signals();
|
||||
win_install_sigabrt_handler();
|
||||
#elif !defined(OS2) && !defined(__NETWARE__)
|
||||
sigset_t set;
|
||||
VOID(sigemptyset(&set)); // Get mask in use
|
||||
|
||||
Reference in New Issue
Block a user