Oracle 5.0 Reference Manual page 2844

Table of Contents

Advertisement

hangs during startup (before it writes
mysqld
crashes during a
mysqld
In this case, you should set the following environment variable in the shell before starting gdb:
LD_ASSUME_KERNEL=2.4.1
export LD_ASSUME_KERNEL
When running
mysqld
[422]
to be able to catch segfaults within gdb.
trace
In MySQL 4.0.14 and above you should use the
interrupt handler for
SIGINT
tracing and core file handling.
It is very hard to debug MySQL under
doesn't free the memory for old threads. You can avoid this problem by starting
gdb
thread_cache_size
using
--thread_cache_size=5'
If you want to get a core dump on Linux if
with the
--core-file
find out why
died:
mysqld
shell>
gdb mysqld core
gdb>
backtrace full
gdb>
quit
See
Section C.5.4.2, "What to Do If MySQL Keeps
If you are using
4.17.x or above on Linux, you should install a
gdb
information, in your current directory:
set print sevenbit off
handle SIGUSR1 nostop noprint
handle SIGUSR2 nostop noprint
handle SIGWAITING nostop noprint
handle SIGLWP nostop noprint
handle SIGPIPE nostop
handle SIGALRM nostop
handle SIGHUP nostop
handle SIGTERM nostop noprint
If you have problems debugging threads with gdb, you should download gdb 5.x and try this instead.
The new
version has very improved thread handling!
gdb
Here is an example how to debug mysqld:
shell>
gdb /usr/local/libexec/mysqld
gdb> run
...
backtrace full # Do this when mysqld crashes
Include the above output in a bug report, which you can file using the instructions in
to Report Bugs or
Problems".
If
hangs you can try to use some system tools like
mysqld
examine where
mysqld
strace /tmp/log libexec/mysqld
If you are using the Perl
method or by setting the
Debugging a MySQL Server
pthread_mutex_lock()
under gdb, you should disable the stack trace with
(needed to stop
mysqld
if you do a lot of new connections the whole time as
gdb
[499]
set to a value equal to
[499]
helps a lot!
mysqld
[404]
option. This core file can be used to make a backtrace that may help you
has hung.
interface, you can turn on debugging information by using the
DBI
environment variable.
DBI_TRACE
2824
ready for
connections).
or
pthread_mutex_unlock()
[408]
option to mysqld. This installs an
--gdb
with
to set breakpoints) and disable stack
^C
max_connections
dies with a SIGSEGV signal, you can start
Crashing".
.gdb
or
strace
/usr/proc/bin/pstack
call.
--skip-stack-
with
mysqld
[467]
+ 1. In most cases just
mysqld
file, with the following
Section 1.7, "How
trace
to

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents