Merge lp:~linuxjedi/drizzle/drizzle-bug-625335 into lp:~drizzle-trunk/drizzle/development

Proposed by Andrew Hutchings
Status: Merged
Approved by: Monty Taylor
Approved revision: 1735
Merged at revision: 1739
Proposed branch: lp:~linuxjedi/drizzle/drizzle-bug-625335
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 45 lines (+4/-7)
2 files modified
drizzled/signal_handler.h (+1/-1)
plugin/signal_handler/signal_handler.cc (+3/-6)
To merge this branch: bzr merge lp:~linuxjedi/drizzle/drizzle-bug-625335
Reviewer Review Type Date Requested Status
Monty Taylor Approve
Review via email: mp+33987@code.launchpad.net

Description of the change

The signal handler thread executed the shutdown code rather than the main thread. This means the signal handler thread was exited then the main thread unloaded the plugin which again tried to kill the signal handler thread causing a segfault in pthread_kill.

This moves the shutdown back to the main thread.

To post a comment you must log in.
1735. By LinuxJedi <linuxjedi@linuxjedi-laptop>

Remove commented out line

Revision history for this message
Monty Taylor (mordred) wrote :

Good catch.

review: Approve
1736. By LinuxJedi <linuxjedi@linuxjedi-laptop>

Fix valgrind warnings (plus make exit clean up properly)

Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

Recommitted to fix valgrind warnings

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzled/signal_handler.h'
2--- drizzled/signal_handler.h 2010-04-01 18:07:18 +0000
3+++ drizzled/signal_handler.h 2010-08-30 16:52:57 +0000
4@@ -25,7 +25,7 @@
5
6 #include <cstdlib>
7 #include <cassert>
8-
9+static bool volatile signal_thread_in_use= false;
10 extern "C" void drizzled_print_signal_warning(int sig);
11 extern "C" void drizzled_handle_segfault(int sig);
12 extern "C" void drizzled_end_thread_signal(int sig);
13
14=== modified file 'plugin/signal_handler/signal_handler.cc'
15--- plugin/signal_handler/signal_handler.cc 2010-08-18 16:12:58 +0000
16+++ plugin/signal_handler/signal_handler.cc 2010-08-30 16:52:57 +0000
17@@ -25,12 +25,13 @@
18 #include "drizzled/plugin/daemon.h"
19 #include "drizzled/signal_handler.h"
20
21+#include "drizzled/drizzled.h"
22+
23 #include <sys/stat.h>
24 #include <fcntl.h>
25
26
27 static bool kill_in_progress= false;
28-static bool volatile signal_thread_in_use= false;
29 extern "C" pthread_handler_t signal_hand(void *);
30
31 namespace drizzled
32@@ -73,12 +74,8 @@
33 errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_NORMAL_SHUTDOWN)),internal::my_progname);
34 else
35 errmsg_printf(ERRMSG_LVL_ERROR, _(ER(ER_GOT_SIGNAL)),internal::my_progname,sig);
36-
37 close_connections();
38- if (sig != SIGTERM && sig != 0)
39- unireg_abort(1);
40- else
41- unireg_end();
42+ clean_up(1);
43 }
44
45 /**