Bug #88751 void Query_cache::end_of_result(THD*): Assertion `0' failed.
Submitted: 5 Dec 2017 2:51 Modified: 5 Dec 2017 7:23
Reporter: Roel Van de Paar Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Query Cache Severity:S1 (Critical)
Version:5.5.58 OS:Any
Assigned to: CPU Architecture:Any

[5 Dec 2017 2:51] Roel Van de Paar
Description:
Version: '5.5.58-debug'  socket: '/sda/MS091117-mysql-5.5.58-linux-x86_64-debug/socket.sock'  port: 18611  MySQL Community Server (GPL)
171205 13:20:44 [Note] Event Scheduler: scheduler thread started with id 3
mysqld: /git/mysql-server_dbg/sql/sql_cache.cc:1041: void Query_cache::end_of_result(THD*): Assertion `0' failed.
02:20:44 UTC - mysqld got signal 6 ;

Core was generated by `/sda/MS091117-mysql-5.5.58-linux-x86_64-debug/bin/mysqld --no-defaults --core -'.
Program terminated with signal 6, Aborted.
#0  0x00007f3cef9229b1 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
61	  val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
(gdb) bt
#0  0x00007f3cef9229b1 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x00000000007dffb8 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.c:433
#2  0x00000000006a2f16 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:247
#3  <signal handler called>
#4  0x00007f3cee0581f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f3cee0598e8 in __GI_abort () at abort.c:90
#6  0x00007f3cee051266 in __assert_fail_base (fmt=0x7f3cee1a3e68 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0xad6237 "0", file=file@entry=0xa486f8 "/git/mysql-server_dbg/sql/sql_cache.cc", 
    line=line@entry=1041, 
    function=function@entry=0xa4ae80 <Query_cache::end_of_result(THD*)::__PRETTY_FUNCTION__> "void Query_cache::end_of_result(THD*)") at assert.c:92
#7  0x00007f3cee051312 in __GI___assert_fail (assertion=0xad6237 "0", file=0xa486f8 "/git/mysql-server_dbg/sql/sql_cache.cc", 
    line=1041, function=0xa4ae80 <Query_cache::end_of_result(THD*)::__PRETTY_FUNCTION__> "void Query_cache::end_of_result(THD*)")
    at assert.c:101
#8  0x000000000055ca2c in Query_cache::end_of_result (this=0x10fcfe0 <query_cache>, thd=thd@entry=0x7f3ccd028000)
    at /git/mysql-server_dbg/sql/sql_cache.cc:1041
#9  0x00000000007876dd in sp_instr_stmt::execute (this=<optimized out>, thd=0x7f3ccd028000, nextp=0x7f3cefe94534)
    at /git/mysql-server_dbg/sql/sp_head.cc:3151
#10 0x0000000000783529 in sp_head::execute (this=this@entry=0x7f3ccd421010, thd=thd@entry=0x7f3ccd028000, 
    merge_da_on_success=merge_da_on_success@entry=true) at /git/mysql-server_dbg/sql/sp_head.cc:1435
#11 0x0000000000784f61 in sp_head::execute_procedure (this=this@entry=0x7f3ccd421010, thd=thd@entry=0x7f3ccd028000, 
    args=args@entry=0x7f3cefe948b0) at /git/mysql-server_dbg/sql/sp_head.cc:2199
#12 0x0000000000628a75 in Event_job_data::execute (this=this@entry=0x7f3cefe94ca0, thd=thd@entry=0x7f3ccd028000, 
    drop=<optimized out>) at /git/mysql-server_dbg/sql/event_data_objects.cc:1434
#13 0x00000000007b8ef2 in Event_worker_thread::run (this=this@entry=0x7f3cefe94daf, thd=thd@entry=0x7f3ccd028000, 
    event=event@entry=0x7f3ccd014040) at /git/mysql-server_dbg/sql/event_scheduler.cc:325
#14 0x00000000007b900f in event_worker_thread (arg=0x7f3ccd014040) at /git/mysql-server_dbg/sql/event_scheduler.cc:282
#15 0x00007f3cef91de25 in start_thread (arg=0x7f3cefe95700) at pthread_create.c:308
#16 0x00007f3cee11b34d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
USE test;
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT * FROM t1;
SET @@global.query_cache_size=1355776;
create table t1(f1 int key,f2 BLOB,f3 BLOB)engine=InnoDB;
set global event_scheduler=1;
SELECT 1;  # Shows server is gone
[5 Dec 2017 2:52] Roel Van de Paar
Seen a lot in pquery runs. text_string; ZN11Query_cache13end_of_resultEP3THD
[5 Dec 2017 2:55] Roel Van de Paar
Likely duplicate of https://bugs.mysql.com/bug.php?id=47378 but please do fix this bug, it is seen regularly in QA runs.
[5 Dec 2017 6:54] MySQL Verification Team
Hello Roel,

Thank you for the report and test case.
Imho you have already reported this in the past with exact stack traces in  Bug#81448 and Bug#83188.  

- Quoting Jon and Staale's comment from Bug#83188

[28 Sep 2016 15:02] Jon Olav Hauglid
We tend to avoid changing an old GA release such as 5.5 to fix debug only issues - especially if they are not present in newer releases.

[29 Sep 2016 13:05] Ståle Deraas
Closed as dup of https://bugs.mysql.com/bug.php?id=47378 as Shane mentioned

Thanks,
Umesh
[5 Dec 2017 7:23] Roel Van de Paar
Sorry. If bugs do not get fixed in all releases, it is hard to either remove them from the filter list or leave them there. Hence, sometimes there are duplicates.