Commit b2c030e8 authored by monty@bitch.mysql.fi's avatar monty@bitch.mysql.fi

Fix to get core files on Solaris

parent afd8a6db
...@@ -6,7 +6,7 @@ aclocal && autoheader && aclocal && automake && autoconf ...@@ -6,7 +6,7 @@ aclocal && autoheader && aclocal && automake && autoconf
(cd bdb/dist && sh s_all) (cd bdb/dist && sh s_all)
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf) (cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
CFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-berkeley-db --with-innodb CFLAGS="-g -Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-berkeley-db --with-innodb
gmake -j 4 gmake -j 4
......
...@@ -1247,12 +1247,14 @@ static void init_signals(void) ...@@ -1247,12 +1247,14 @@ static void init_signals(void)
sigset(THR_KILL_SIGNAL,end_thread_signal); sigset(THR_KILL_SIGNAL,end_thread_signal);
sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called! sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called!
struct sigaction sa; sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL);
if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL)) if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL))
{ {
struct sigaction sa;
sa.sa_flags = SA_RESETHAND | SA_NODEFER;
sigemptyset(&sa.sa_mask);
sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL);
init_stacktrace(); init_stacktrace();
sa.sa_handler=handle_segfault; sa.sa_handler=handle_segfault;
sigaction(SIGSEGV, &sa, NULL); sigaction(SIGSEGV, &sa, NULL);
......
...@@ -205,11 +205,17 @@ resolve it\n"); ...@@ -205,11 +205,17 @@ resolve it\n");
/* Produce a core for the thread */ /* Produce a core for the thread */
#ifdef HAVE_WRITE_CORE #ifdef HAVE_LINUXTHREADS
void write_core(int sig) void write_core(int sig)
{ {
signal(sig, SIG_DFL); signal(sig, SIG_DFL);
if (fork() != 0) exit(1); // Abort main program if (fork() != 0) exit(1); // Abort main program
// Core will be written at exit // Core will be written at exit
} }
#endif /* HAVE_WRITE_CORE */ #else
void write_core(int sig)
{
signal(sig, SIG_DFL);
pthread_kill(pthread_self(), sig);
}
#endif
...@@ -30,9 +30,6 @@ extern char* heap_start; ...@@ -30,9 +30,6 @@ extern char* heap_start;
void print_stacktrace(gptr stack_bottom, ulong thread_stack); void print_stacktrace(gptr stack_bottom, ulong thread_stack);
void safe_print_str(const char* name, const char* val, int max_len); void safe_print_str(const char* name, const char* val, int max_len);
#endif /* (defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */ #endif /* (defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */
#define HAVE_WRITE_CORE
void write_core(int sig);
#endif /* HAVE_LINUXTHREADS */ #endif /* HAVE_LINUXTHREADS */
/* Define empty prototypes for functions that are not implemented */ /* Define empty prototypes for functions that are not implemented */
...@@ -42,9 +39,7 @@ void write_core(int sig); ...@@ -42,9 +39,7 @@ void write_core(int sig);
#define safe_print_str(A,B,C) {} #define safe_print_str(A,B,C) {}
#endif /* HAVE_STACKTRACE */ #endif /* HAVE_STACKTRACE */
#ifndef HAVE_WRITE_CORE void write_core(int sig);
#define write_core(A) {}
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment