File README.debug of Package mariadb
xxxxxxxxxx
1
Debugging mysqld crashes
2
========================
3
Author: Michal Marek <mmarek@suse.cz>
4
Last modified: 2014-11-21
5
6
Contents
7
--------
8
1) Query log
9
2) Coredumps and Backtraces
10
3) Trace files
11
12
In case your MySQL server crashes, here are some hints on what to
13
include in a bugreport at https://bugzilla.novell.com/ . Please report
14
there only bugs in the MySQL packages packaged by Novell/SUSE, bugs in
15
binaries / source provided by MySQL AB should be reported at
16
http://bugs.mysql.com/ .
17
18
1) Query log
19
------------
20
Note: Skip this chapter if you already have an exact query that
21
crashes the server
22
23
To find out which query possibly crashed the server, add the following
24
line to your /etc/my.cnf into section [mysqld]:
25
26
log=/var/lib/mysql/mysqld-query.log
27
28
Mysqld then will, at some performance cost, log all queries into this
29
file. After a server crash, you can examine the queries from the time it
30
crashed and try to reproduce the crash with single queries (this might
31
not allways work, eg. if the crash is caused by some race condition).
32
33
Note that this log file may become extremly large, so if you decide to
34
attach it whole to the bugzilla, don't forget to
35
36
xz -k9 /var/lib/mysql/mysqld-query.log
37
38
and attach the xzipped file instead.
39
40
2) Coredumps and Backtraces
41
---------------------------
42
Another valuable information for the developers is the backtrace. The
43
easies way to get one is to let mysqld produce a coredump. Add the
44
following line to your /etc/my.cnf into section [mysqld]:
45
46
core-file
47
48
The core file will be written to the /var/lib/mysql/ directory. I
49
suggest setting the kernel variable kernel.core_uses_pid to 1
50
51
sysctl -w kernel.core_uses_pid=1
52
53
so that the coredumps don't overwrite each other if you experience
54
multiple crashes.
55
56
After you got the core file, install the gdb and mysql-debuginfo
57
packages and run
58
59
gdb /usr/sbin/mysqld /var/lib/mysql/<core>
60
(gdb) bt
61
62
Replace the <core> with the actual name of the coredump.
63
64
3) Trace files
65
--------------
66
The trace file will contain various debug information and function
67
calls/returns and will become _extremly_ huge after a while, so don't
68
attach it to bugzilla unless requested.
69
70
Add the following line to your /etc/my.cnf into section [mysqld]:
71
72
stack-trace
73
74
The trace file will be then written to /var/lib/mysql directory.
75