Segfault on INSERT DELAYED and wsrep_replicate_myisam=1 due to unchecked dereference of NULL pointer
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL patches by Codership |
Fix Released
|
Medium
|
Yan Zhang | |||
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.5 |
Fix Released
|
Undecided
|
Unassigned | |||
5.6 |
New
|
Undecided
|
Unassigned |
Bug Description
User reported a segfault, easily reproducible in his environment:
(gdb) bt
#0 0x000000344540c65c in __pthread_kill (threadid=
at ../nptl/
#1 0x00000000006650f2 in handle_fatal_signal (sig=11)
at /home/devel/
#2 <signal handler called>
#3 0x000000000053faff in open_tables (thd=0x2385320, start=0x7f87fc6
counter=
at /home/devel/
#4 0x0000000000540517 in open_and_
tables=0x0, derived=true, flags=0, prelocking_
at /home/devel/
#5 0x000000000055f075 in open_and_
tables=
at /home/devel/
#6 open_and_
table_
at /home/devel/
#7 0x0000000000560208 in mysql_insert (thd=0x2385320,
table_
update_
at /home/devel/
#8 0x0000000000570c28 in mysql_execute_
at /home/devel/
#9 0x00000000005748e9 in mysql_parse (thd=0x2385320, rawbuf=<optimized out>,
length=106, parser_
at /home/devel/
#10 0x0000000000575710 in wsrep_mysql_parse (thd=0x2385320,
rawbuf=
parser_
at /home/devel/
#11 0x00000000005770d3 in dispatch_command (command=COM_QUERY, thd=0x2385320,
packet=
at /home/devel/
#12 0x000000000057783f in do_command (thd=0x2385320)
at /home/devel/
#13 0x00000000006039ae in do_handle_
at /home/devel/
#14 0x0000000000603a2a in handle_
at /home/devel/
#15 0x0000003445407d15 in start_thread (arg=0x7f87fc63
at pthread_
#16 0x00000034448f246d in clone ()
at ../sysdeps/
Offending line at /home/devel/
if ((thd->
wsrep_
(
Relevant variables:
(gdb) p thd->lex-
$1 = SQLCOM_INSERT
(gdb) p wsrep_replicate
$2 = 1 '\001'
(gdb) p *start
$3 = (TABLE_LIST *) 0x0
(gdb) p thd->query
Cannot take address of method query.
(gdb) p thd->query_string
$4 = {string = {
str = 0x7f87a0004ba0 "INSERT DELAYED INTO throttle_
cs = 0xf0ec40 <my_charset_
(gdb) p thd->rli_slave
$5 = (Relay_log_info *) 0x0
(gdb) p thd->slave_thread
$6 = false
(gdb) p thd->wsrep_applier
$7 = false
Table specification:
CREATE TABLE `throttle_
`_instance` char(60) NOT NULL DEFAULT '',
`_from` char(60) NOT NULL DEFAULT '',
`_expire` int(10) unsigned NOT NULL DEFAULT '0',
UNIQUE KEY `_instance` (`_instance`),
KEY `_expire` (`_expire`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Related branches
Changed in codership-mysql: | |
milestone: | 5.5.30-24.8 → 5.5.31-23.7.4 |
Changed in codership-mysql: | |
milestone: | 5.5.31-23.7.5 → 5.5.32-23.7.6 |
Changed in codership-mysql: | |
milestone: | 5.5.33-23.7.6 → 5.5.34-24.9 |
importance: | Undecided → Medium |
Changed in codership-mysql: | |
milestone: | 5.5.34-25.9 → 5.5.34-25.10 |
Changed in codership-mysql: | |
status: | Fix Committed → Fix Released |
it only happens on 5.5, not on 5.6.
fixed in http:// bazaar. launchpad. net/~codership/ codership- mysql/wsrep- 5.5/revision/ 3973
to reproduce bug, the table specification should be MyISAM instead of InnoDB. from_instance` (
```
CREATE TABLE `throttle_
`_instance` char(60) NOT NULL DEFAULT '',
`_from` char(60) NOT NULL DEFAULT '',
`_expire` int(10) unsigned NOT NULL DEFAULT '0',
UNIQUE KEY `_instance` (`_instance`),
KEY `_expire` (`_expire`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
```