tmp->start_utime > now_utime impossibility leading to negative TIME_MS values in processlist
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Medium
|
Sergei Glushchenko | ||
5.1 |
Won't Fix
|
Undecided
|
Unassigned | ||
5.5 |
Fix Released
|
Medium
|
Sergei Glushchenko | ||
5.6 |
Fix Released
|
Medium
|
Sergei Glushchenko |
Bug Description
(gdb) bt
#0 0x00007fd5817e9771 in pthread_kill () from /lib64/
#1 0x00000000006beafd in handle_fatal_signal (sig=6) at /bzr/5.
#2 <signal handler called>
#3 0x00007fd57fd9c5c9 in raise () from /lib64/libc.so.6
#4 0x00007fd57fd9dcd8 in abort () from /lib64/libc.so.6
#5 0x00007fd57fd95536 in __assert_fail_base () from /lib64/libc.so.6
#6 0x00007fd57fd955e2 in __assert_fail () from /lib64/libc.so.6
#7 0x00000000007a5ee2 in fill_schema_
#8 0x00000000007a447a in do_fill_table (join_table=
#9 get_schema_
#10 0x000000000077f195 in JOIN::prepare_
#11 0x00000000007316e0 in JOIN::exec (this=0x7fd5000
#12 0x0000000000785125 in mysql_execute_
#13 mysql_select (thd=thd@
#14 0x0000000000785bd6 in handle_select (thd=thd@
#15 0x000000000058680c in execute_
#16 0x000000000075be71 in mysql_execute_
#17 0x0000000000760898 in mysql_parse (thd=thd@
#18 0x00000000007625f4 in dispatch_command (command=<optimized out>, command@
#19 0x000000000076408e in do_command (thd=0x25ab330) at /bzr/5.
#20 0x0000000000727fd2 in do_handle_
#21 0x00000000007280c0 in handle_
#22 0x00000000009fd663 in pfs_spawn_thread (arg=0x25ab130) at /bzr/5.
#23 0x00007fd5817e4df3 in start_thread () from /lib64/
#24 0x00007fd57fe5d01d in clone () from /lib64/libc.so.6
(gdb) f 7
#7 0x00000000007a5ee2 in fill_schema_
2304 /bzr/5.
(gdb) p (((now_utime - tmp->start_utime) / 1000) > 100000 )
+p (((now_utime - tmp->start_utime) / 1000) > 100000 )
$1 = true
(gdb) p ((now_utime - tmp->start_utime) / 1000)
+p ((now_utime - tmp->start_utime) / 1000)
$2 = 18446744073709547
(gdb) p now_utime
+p now_utime
$3 = 1412938018519405
(gdb) p tmp->start_utime
+p tmp->start_utime
$4 = 1412938018523469
(gdb) # started in the future, impossible
======= ======= ======= Testcase
1. Patch code
$ bzr diff
table-> field[8] ->store( ((tmp-> start_utime ?
now_ utime - tmp->start_utime : 0)/ 1000));
=== modified file 'sql/sql_show.cc'
--- sql/sql_show.cc 2014-09-26 04:43:24 +0000
+++ sql/sql_show.cc 2014-10-10 10:15:06 +0000
@@ -2301,6 +2301,8 @@
+DBUG_ASSERT( (tmp->start_utime != 0) && (((now_utime - tmp->start_utime) / 1000) > 100000 ) );
mysql_mutex_ lock(&tmp- >LOCK_thd_ data);
table-> field[9] ->store( (ulonglong) tmp->get_ sent_row_ count() );
+
/* ROWS_SENT */
2. Recompile
3. Modify uploaded pquery-run-hack.sh to set correct BASEDIR (point to modded build) and INFILE; /sda/Percona- Server- 5.6.21- rel69.0- 676-debug. Linux.x86_ 64 /sda/814189/ high_time0. sql # See upload
BASEDIR=
INFILE=
======= ======= ======= core/mysqld/ldd
See upload