• unknown's avatar
    Bug#31745 - crash handler does not work on Windows · 9624e880
    unknown authored
    - 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
    
    
    sql/CMakeLists.txt:
      Implement stack tracing on and generating crash dumps on Windows
    sql/mysqld.cc:
      Correct signal handling on Windows. 
      - For console events, like CTRL-C use SetConsoleCtrlHandler
      - For exceptions like access violation, use SetUnhandledExceptionFilter
      - For SIGABRT generate exception via __debugbreak() intrinsic
        if built with VS2005 and later , since default SIGABRT handler 
        replaces unhandled exception filter specified by user
      - make provisions to debug exception filter, as it is not trivial 
      (should be compiled with /DDEBUG_UNHANDLED_EXCEPTION_FILTER)
    sql/sql_parse.cc:
      Remove message box from windows signal handler.
      The only thread specific handler left is for SIGABRT,
      which is broken on VS2005 and later (user specified unhandled exception 
      filter gets overwritten)
    sql/stacktrace.c:
      Stack tracing and generating crash dumps on Windows
    sql/stacktrace.h:
      Implement print_stacktrace and write_core on Windows
    9624e880
sql_parse.cc 232 KB