Bug #83188 void Query_cache::end_of_result(THD*): Assertion `0' failed.
Submitted: 28 Sep 2016 11:34 Modified: 29 Sep 2016 13:04
Reporter: Roel Van de Paar Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Query Cache Severity:S6 (Debug Builds)
Version:5.5.52 OS:Any
Assigned to: CPU Architecture:Any

[28 Sep 2016 11:34] Roel Van de Paar
Description:
+bt
#0  0x00007f0c7ab78741 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x00000000007e0548 in my_write_core (sig=6) at /git/mysql-server_dbg/mysys/stacktrace.c:433
#2  0x00000000006a3598 in handle_fatal_signal (sig=6) at /git/mysql-server_dbg/sql/signal_handler.cc:247
#3  <signal handler called>
#4  0x00007f0c7932d5f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f0c7932ece8 in __GI_abort () at abort.c:90
#6  0x00007f0c79326566 in __assert_fail_base (fmt=0x7f0c79476ce8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xada837 "0", file=file@entry=0xa48318 "/git/mysql-server_dbg/sql/sql_cache.cc", line=line@entry=1041, function=function@entry=0xa4aaa0 <Query_cache::end_of_result(THD*)::__PRETTY_FUNCTION__> "void Query_cache::end_of_result(THD*)") at assert.c:92
#7  0x00007f0c79326612 in __GI___assert_fail (assertion=0xada837 "0", file=0xa48318 "/git/mysql-server_dbg/sql/sql_cache.cc", line=1041, function=0xa4aaa0 <Query_cache::end_of_result(THD*)::__PRETTY_FUNCTION__> "void Query_cache::end_of_result(THD*)") at assert.c:101
#8  0x000000000055be4c in Query_cache::end_of_result (this=0x1101040 <query_cache>, thd=thd@entry=0x7f0c63028000) at /git/mysql-server_dbg/sql/sql_cache.cc:1041
#9  0x0000000000787d5d in sp_instr_stmt::execute (this=<optimized out>, thd=0x7f0c63028000, nextp=0x7f0c7b0ea534) at /git/mysql-server_dbg/sql/sp_head.cc:3151
#10 0x0000000000783ba9 in sp_head::execute (this=this@entry=0x7f0c6381f010, thd=thd@entry=0x7f0c63028000, merge_da_on_success=merge_da_on_success@entry=true) at /git/mysql-server_dbg/sql/sp_head.cc:1435
#11 0x00000000007855e1 in sp_head::execute_procedure (this=this@entry=0x7f0c6381f010, thd=thd@entry=0x7f0c63028000, args=args@entry=0x7f0c7b0ea8b0) at /git/mysql-server_dbg/sql/sp_head.cc:2199
#12 0x0000000000627cd5 in Event_job_data::execute (this=this@entry=0x7f0c7b0eaca0, thd=thd@entry=0x7f0c63028000, drop=<optimized out>) at /git/mysql-server_dbg/sql/event_data_objects.cc:1434
#13 0x00000000007b93a2 in Event_worker_thread::run (this=this@entry=0x7f0c7b0eadaf, thd=thd@entry=0x7f0c63028000, event=event@entry=0x7f0c63014040) at /git/mysql-server_dbg/sql/event_scheduler.cc:325
#14 0x00000000007b94bf in event_worker_thread (arg=0x7f0c63014040) at /git/mysql-server_dbg/sql/event_scheduler.cc:282
#15 0x00007f0c7ab73dc5 in start_thread (arg=0x7f0c7b0eb700) at pthread_create.c:308
#16 0x00007f0c793eeced in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
The attached tarball (1475058721_bug_bundle.tar.gz) gives the testcase as an exact match of our system, including some handy utilities

$ vi 1475058721_mybase         # STEP1: Update the base path in this file (usually the only change required!). If you use a non-binary distribution, please update SOURCE_DIR location also
$ ./1475058721_init            # STEP2: Initializes the data dir
$ ./1475058721_start           # STEP3: Starts mysqld
$ ./1475058721_cl              # STEP4: To check mysqld is up
$ ./1475058721_run_pquery      # STEP5: Run the testcase with the pquery binary
$ ./1475058721_run             # OPTIONAL: Run the testcase with the mysql CLI (may not reproduce the issue, as the pquery binary was used for the original testcase reduction)
$ vi /dev/shm/1475058721/error.log.out  # STEP6: Verify the error log
$ ./1475058721_gdb             # OPTIONAL: Brings you to a gdb prompt with gdb attached to the used mysqld and attached to the generated core
$ ./1475058721_parse_core      # OPTIONAL: Creates 1475058721_STD.gdb and 1475058721_FULL.gdb; standard and full variables gdb stack traces
[28 Sep 2016 11:35] Roel Van de Paar
1475058721_bug_bundle.tar.gz

Attachment: 1475058721_bug_bundle.tar.gz (application/x-gzip, text), 1.79 MiB.

[28 Sep 2016 12:06] MySQL Verification Team
Hello Roel,

Thank you for the report and test case.
Observed that 5.5.52 debug build is affected.

Thanks,
Umesh
[28 Sep 2016 12:07] MySQL Verification Team
-- debug build affected(release build didn't crash)

rm -rf 83188
scripts/mysql_install_db --basedir=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.5.52 --datadir=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.5.52/83188
bin/mysqld-debug --no-defaults --basedir=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.5.52 --datadir=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.5.52/83188 --core-file --socket=/tmp/mysql_ushastry.sock  --port=3306 --log-error=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.5.52/83188/log.err --event-scheduler=ON 2>&1 &

[umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.5.52: bin/mysql -uroot -S /tmp/mysql_ushastry.sock  --force test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.52-enterprise-commercial-advanced-debug MySQL Enterprise Server - Advanced Edition Debug (Commercial)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> DROP DATABASE test;CREATE DATABASE test;USE test;
Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
mysql> set GLOBAL query_cache_size=1048576;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE t1(c1 INT,c2 BINARY,c3 INT,c4 BINARY KEY,c5 INT UNIQUE KEY,c6 NUMERIC(0,0)DEFAULT 3.141592);
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT * FROM t1;
Query OK, 0 rows affected (0.00 sec)

mysql> \q
Bye
[3]-  Aborted                 (core dumped) bin/mysqld-debug --no-defaults --basedir=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.5.52 --datadir=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.5.52/83188 --core-file --socket=/tmp/mysql_ushastry.sock --port=3306 --log-error=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.5.52/83188/log.err --event-scheduler=ON 2>&1

(gdb) bt
#0  0x00007f197a937771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000007ee7f6 in my_write_core (sig=6) at /pb2/build/sb_0-20200118-1472211409.06/mysqlcom-pro-5.5.52/mysys/stacktrace.c:433
#2  0x00000000006a648c in handle_fatal_signal (sig=6) at /pb2/build/sb_0-20200118-1472211409.06/mysqlcom-pro-5.5.52/sql/signal_handler.cc:247
#3  <signal handler called>
#4  0x00007f1979a5a5d7 in raise () from /lib64/libc.so.6
#5  0x00007f1979a5bcc8 in abort () from /lib64/libc.so.6
#6  0x00007f1979a53546 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f1979a535f2 in __assert_fail () from /lib64/libc.so.6
#8  0x000000000055a9aa in Query_cache::end_of_result (this=0x103ee00 <query_cache>, thd=0x7f195c000b40) at /pb2/build/sb_0-20200118-1472211409.06/mysqlcom-pro-5.5.52/sql/sql_cache.cc:1041
#9  0x000000000079428e in sp_instr_stmt::execute (this=0x7f1958002d80, thd=0x7f195c000b40, nextp=0x7f19659428f8)
    at /pb2/build/sb_0-20200118-1472211409.06/mysqlcom-pro-5.5.52/sql/sp_head.cc:3151
#10 0x0000000000792120 in sp_head::execute (this=0x7f1958000ee0, thd=0x7f195c000b40, merge_da_on_success=true) at /pb2/build/sb_0-20200118-1472211409.06/mysqlcom-pro-5.5.52/sql/sp_head.cc:1435
#11 0x0000000000792c37 in sp_head::execute_procedure (this=0x7f1958000ee0, thd=0x7f195c000b40, args=0x7f1965942d20)
    at /pb2/build/sb_0-20200118-1472211409.06/mysqlcom-pro-5.5.52/sql/sp_head.cc:2199
#12 0x00000000006260da in Event_job_data::execute (this=0x7f1965942db0, thd=0x7f195c000b40, drop=false)
    at /pb2/build/sb_0-20200118-1472211409.06/mysqlcom-pro-5.5.52/sql/event_data_objects.cc:1434
#13 0x00000000007c883f in Event_worker_thread::run (this=0x7f1965942ef7, thd=0x7f195c000b40, event=0x7f195c000a00)
    at /pb2/build/sb_0-20200118-1472211409.06/mysqlcom-pro-5.5.52/sql/event_scheduler.cc:325
#14 0x00000000007c8969 in event_worker_thread (arg=<optimized out>) at /pb2/build/sb_0-20200118-1472211409.06/mysqlcom-pro-5.5.52/sql/event_scheduler.cc:282
#15 0x00007f197a932df5 in start_thread () from /lib64/libpthread.so.0
#16 0x00007f1979b1b60d in clone () from /lib64/libc.so.6
(gdb)
[28 Sep 2016 14:12] MySQL Verification Team
see this:
https://bugs.mysql.com/bug.php?id=81448
https://bugs.mysql.com/bug.php?id=47378
[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