Comment 5 for bug 625335

Revision history for this message
Andrew Hutchings (linuxjedi) wrote : Re: Server crashes on shutdown with PBXT enabled

ok ignore my last comment (never mess with GDB late at night), there are a few problems here. This is the sequence of events:

1. a SIGTERM or whatever is triggered
2. the signal handler thread catches this
3. the signal handler thread kills the server inside its own thread
4. this means the signal handler thread is now dead
5. the main thread (which should have been killed) now removes the signal handler plugin
6. the signal handler plugin destructor tries to kill the signal handler thread (which is already dead at this point)
7. pthread_kill segfaults because thread_id doesn't exist

OK, so the problems are:
1. a signal handler thread shouldn't do any processing/shutdown, just mark a flag (this is a _big_ mysqld problem too).
2. the main thread should do the shutdown, not the signal handler thread.