Subject: Anyone using mysql replication on -current?
To: None <netbsd-users@netbsd.org>
From: Andrew Gillham <gillham@vaultron.com>
List: netbsd-users
Date: 06/28/2003 23:12:15
I have a 1.6R i386 machine running mysqld.  I setup a second, 1.6U 
(-current updated in the last 1-2 days) i386 system with mysqld as well.

When I enable replication, it works fine, but I can't shutdown mysqld 
any longer.  The replication thread won't die.  The process is in 
'sigwait' according to top, and I have to use 'kill -9' to stop the 
database.

I rebuilt mysqld with the include mit-pthreads and I don't have this 
problem.

So... Since this seems to be an issue with our native pthreads, and I am 
able to reproduce it on demand, how do I go about debugging it?

I have tried the following:

# setenv PTHREAD_ERRORMODE print
# setenv PTHREAD_DEBUGCOUNTERS 1
# setenv PTHREAD_DEBUGLOG 1
# /usr/pkg/etc/rc.d/mysqld start
# debuglog -r > log.txt

Attaching with gdb looks like this:
Switching to Thread 21 ()]
---Type <return> to continue, or q <return> to quit---
0x4823f49f in __sigtimedwait () from /usr/lib/libc.so.12
(gdb) where
#0  0x4823f49f in __sigtimedwait () from /usr/lib/libc.so.12
#1  0x4818cbbf in sigtimedwait () from /usr/lib/libpthread.so.0
#2  0x482119fb in sigwait () from /usr/lib/libc.so.12
#3  0x807b035 in dladdr ()
#4  0x481922e2 in pthread_create () from /usr/lib/libpthread.so.0
(gdb) info threads
   4 Thread 0 ()  0x482103d3 in select () from /usr/lib/libc.so.12
* 3 Thread 21 ()  0x4823f49f in __sigtimedwait () from /usr/lib/libc.so.12
   2 Thread 22 ()  0x4821041b in read () from /usr/lib/libc.so.12
   1 Thread 24 ()  0x4818c07b in pthread__locked_switch ()
    from /usr/lib/libpthread.so.0

With top the mysqld process is in 'sigwait' as Thread 21 is shown.

What else should I collect before using send-pr?

-Andrew