List:Internals« Previous MessageNext Message »
From:Ethan Chang Date:March 3 2009 2:04pm
Subject:gdb debug kill by SIG32 and SIGKILL
View as plain text  
Hi All,

I'm trying to debug mysql-5.1.31 build from source. The build is
running OK without attach to gdb.
However mysqld server is always crashed even without backtrace and core dump.

CC=gcc CFLAGS="-ggdb3 -O0 -mtune=pentiumpro" CXX=gcc \
   CXXFLAGS="-ggdb3 -O0 -mtune=pentiumpro -felide-constructors
-fno-exceptions -fno-rtti" \
   ./configure --prefix=/usr/local/mysql --with-debug
--with-extra-charsets=complex \
   --prefix=/usr/local/mysql-5.1.31
--localstatedir=/usr/local/mysql-5.1.31/data \
   --with-unix-socket-path=/usr/local/mysql-5.1.31/tmp/mysql.sock \
   --libexecdir=/usr/local/mysql-5.1.31/bin --with-innodb \
   '--with-comment=MySQL Community Server Home Build (GPL)'
--with-server-suffix=-ethan \
   --enable-thread-safe-client --enable-local-infile
--enable-assembler --with-pic \
   --with-fast-mutexes --with-client-ldflags=-all-static
--with-mysqld-ldflags=-all-static \
   --with-zlib-dir=bundled  --with-big-tables  --with-readline --with-ssl \
   --without-ndbcluster  --with-csv-storage-engine --with-partition\
   --with-example-storage-engine  --with-debug

<=========== cat .gdb ============================>
set args --no-defaults
--basedir=/home/ethan/tmp/mysql-5.1.31/mysql-test
--character-sets-dir=/home/ethan/tmp/mysql-5.1.31/sql/share/charsets
--secure-file-priv=/home/ethan/tmp/mysql-5.1.31/mysql-test/var
--log-bin-trust-function-creators --default-character-set=latin1
--language=/home/ethan/tmp/mysql-5.1.31/sql/share/english
--tmpdir=/home/ethan/tmp/mysql-5.1.31/mysql-test/var/tmp
--connect-timeout=600
--pid-file=/home/ethan/tmp/mysql-5.1.31/mysql-test/var/run/master.pid
--port=9306 --socket=/home/ethan/tmp/mysql-5.1.31/mysql-test/var/tmp/master.sock
--datadir=/home/ethan/tmp/mysql-5.1.31/mysql-test/var/master-data
--log-output=table,file
--log=/home/ethan/tmp/mysql-5.1.31/mysql-test/var/log/master.log
--log-slow-queries=/home/ethan/tmp/mysql-5.1.31/mysql-test/var/log/master-slow.log
--server-id=1 --loose-innodb_data_file_path=ibdata1:10M:autoextend
--local-infile --loose-skip-ndbcluster --key_buffer_size=1M
--sort_buffer=256K --max_heap_table_size=1M --gdb --skip-stack-trace
--skip-log-bin --core-file --open-files-limit=1024
--thread_cache_size=5
set print sevenbit off
handle SIG32 nostop
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
<======================================================>

<=============== gdb ../sql/mysqld -x .gdb =============>
GNU gdb Red Hat Linux (6.3.0.0-1.143.el4rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host
libthread_db library "/lib/libthread_db.so.1".

(gdb) i b
No breakpoints or watchpoints.
(gdb) b mysql_parse
Breakpoint 1 at 0x813814e: file sql_parse.cc, line 5741.
(gdb) b open
Breakpoint 2 at 0x8438a22: file ha_myisammrg.cc, line 108.
(gdb) i b
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x0813814e in mysql_parse(THD*, char
const*, unsigned int, char const**)
                                       at sql_parse.cc:5741
2   breakpoint     keep y   0x08438a22 in myrg_rnext_same at ha_myisammrg.cc:108
(gdb) r
Starting program: /home/ethan/tmp/mysql-5.1.31/sql/mysqld
--no-defaults --basedir=/home/ethan/tmp/mysql-5.1.31/mysql-test
--character-sets-dir=/home/ethan/tmp/mysql-5.1.31/sql/share/charsets
--secure-file-priv=/home/ethan/tmp/mysql-5.1.31/mysql-test/var
--log-bin-trust-function-creators --default-character-set=latin1
--language=/home/ethan/tmp/mysql-5.1.31/sql/share/english
--tmpdir=/home/ethan/tmp/mysql-5.1.31/mysql-test/var/tmp
--connect-timeout=600
--pid-file=/home/ethan/tmp/mysql-5.1.31/mysql-test/var/run/master.pid
--port=9306 --socket=/home/ethan/tmp/mysql-5.1.31/mysql-test/var/tmp/master.sock
--datadir=/home/ethan/tmp/mysql-5.1.31/mysql-test/var/master-data
--log-output=table,file
--log=/home/ethan/tmp/mysql-5.1.31/mysql-test/var/log/master.log
--log-slow-queries=/home/ethan/tmp/mysql-5.1.31/mysql-test/var/log/master-slow.log
--server-id=1 --loose-innodb_data_file_path=ibdata1:10M:autoextend
--local-infile --loose-skip-ndbcluster --key_buffer_size=1M
--sort_buffer=256K --max_heap_table_size=1M --gdb --skip-stack-trace
--skip-log-bin --core-file --open-files-limit=1024
--thread_cache_size=5
090303 21:30:34 [Warning] The syntax '--log' is deprecated and will be
removed in MySQL 7.0. Please use '--general_log'/'--general_log_file'
instead.
090303 21:30:34 [Warning] The syntax '--log_slow_queries' is
deprecated and will be removed in MySQL 7.0. Please use
'--slow_query_log'/'--slow_query_log_file' instead.

Program received signal SIG32, Real-time event 32.

Program received signal SIG32, Real-time event 32.

Program received signal SIG32, Real-time event 32.

Program received signal SIG32, Real-time event 32.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
090303 21:30:34  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...

Program received signal SIG32, Real-time event 32.

Program received signal SIG32, Real-time event 32.

Program received signal SIG32, Real-time event 32.

Program received signal SIG32, Real-time event 32.

Program received signal SIG32, Real-time event 32.

Program received signal SIG32, Real-time event 32.

Program received signal SIG32, Real-time event 32.
---Type <return> to continue, or q <return> to quit---

Program received signal SIG32, Real-time event 32.
090303 21:30:35  InnoDB: Started; log sequence number 0 46409
090303 21:30:35 [Warning] /home/ethan/tmp/mysql-5.1.31/sql/mysqld:
unknown option '--loose-skip-ndbcluster'

Program received signal SIG32, Real-time event 32.

Program received signal SIG32, Real-time event 32.
090303 21:30:35 [Note] Event Scheduler: Loaded 0 events
090303 21:30:35 [Note] /home/ethan/tmp/mysql-5.1.31/sql/mysqld: ready
for connections.
Version: '5.1.31-ethan-debug-log'  socket:
'/home/ethan/tmp/mysql-5.1.31/mysql-test/var/tmp/master.sock'  port:
9306  MySQL Community Server Home Build (GPL)
                <-- Here, I press CTRL+C to return gdb.
Program received signal SIGINT, Interrupt.
0x08520e0a in select ()
(gdb) c
Continuing. <-- First hung, If I exec "select 1;" from client, It got
signal, then crash.

Program received signal SIG32, Real-time event 32.

Program terminated with signal SIGKILL, Killed.
The program no longer exists.
(gdb)

<======================================================>

<<<<<<<<<<<<<<< MORE INFO
>>>>>>>>>>>>>>>>>>>>>>>>>>
I also set both the kernel for thread compatible
in both gdb and mysql console.

LD_ASSUME_KERNEL=2.4.1
export LD_ASSUME_KERNEL

ulimit -c 30

file -L /lib/libthread_db.so.1
/lib/libthread_db.so.1: ELF 32-bit LSB shared object, Intel 80386,
version 1 (SYSV), not stripped
file -L /lib/libthread_db-1.0.so
/lib/libthread_db-1.0.so: ELF 32-bit LSB shared object, Intel 80386,
version 1 (SYSV), not stripped

<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>

Hope someone can point me to the right direction.

Regards,
Ethan
Thread
gdb debug kill by SIG32 and SIGKILLEthan Chang3 Mar
  • Re: gdb debug kill by SIG32 and SIGKILLEthan Chang4 Mar