Bug #78292 Assertion `pfs->m_processlist_id != 0' failed in table_session_connect.cc:254
Submitted: 31 Aug 2015 16:48 Modified: 13 Nov 2015 13:48
Reporter: Ramesh Sivaraman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.6.22 OS:CentOS (CentOS 7)
Assigned to: CPU Architecture:Any
Tags: debug

[31 Aug 2015 16:48] Ramesh Sivaraman
Description:
** GDB info

#0  0x00007f5254600771 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000000a965ee in my_write_core (sig=6) at /ssd/ramesh/mysql-server/mysql-5.6/mysys/stacktrace.c:422
#2  0x0000000000726728 in handle_fatal_signal (sig=6) at /ssd/ramesh/mysql-server/mysql-5.6/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x00007f525340c5d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f525340dcc8 in __GI_abort () at abort.c:90
#6  0x00007f5253405546 in __assert_fail_base (fmt=0x7f5253555128 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xfeee9f "pfs->m_processlist_id != 0", file=file@entry=0xfeee50 "/ssd/ramesh/mysql-server/mysql-5.6/storage/perfschema/table_session_connect.cc", line=line@entry=254, function=function@entry=0xfeefc0 <table_session_connect::make_row(PFS_thread*, unsigned int)::__PRETTY_FUNCTION__> "virtual void table_session_connect::make_row(PFS_thread*, uint)") at assert.c:92
#7  0x00007f52534055f2 in __GI___assert_fail (assertion=0xfeee9f "pfs->m_processlist_id != 0", file=0xfeee50 "/ssd/ramesh/mysql-server/mysql-5.6/storage/perfschema/table_session_connect.cc", line=254, function=0xfeefc0 <table_session_connect::make_row(PFS_thread*, unsigned int)::__PRETTY_FUNCTION__> "virtual void table_session_connect::make_row(PFS_thread*, uint)") at assert.c:101
#8  0x0000000000ae77a3 in table_session_connect::make_row (this=0x7f523d3fe000, pfs=0x7f5251446b00, ordinal=0) at /ssd/ramesh/mysql-server/mysql-5.6/storage/perfschema/table_session_connect.cc:254
#9  0x0000000000ae6ecc in cursor_by_thread_connect_attr::rnd_next (this=0x7f523d3fe000) at /ssd/ramesh/mysql-server/mysql-5.6/storage/perfschema/cursor_by_thread_connect_attr.cc:36
#10 0x0000000000aa86df in ha_perfschema::rnd_next (this=0x7f523d3aa810, buf=0x7f523d3ba010 "\377") at /ssd/ramesh/mysql-server/mysql-5.6/storage/perfschema/ha_perfschema.cc:332
#11 0x000000000063b16e in handler::ha_rnd_next (this=0x7f523d3aa810, buf=0x7f523d3ba010 "\377") at /ssd/ramesh/mysql-server/mysql-5.6/sql/handler.cc:2687
#12 0x000000000097a206 in rr_sequential (info=0x7f523d3ecbd0) at /ssd/ramesh/mysql-server/mysql-5.6/sql/records.cc:478
#13 0x00000000007a5ebd in join_init_read_record (tab=0x7f523d3ecb40) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_executor.cc:2395
#14 0x00000000007a36c3 in sub_select (join=0x7f523d3eb8b8, join_tab=0x7f523d3ecb40, end_of_records=false) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_executor.cc:1256
#15 0x00000000007a30ad in do_select (join=0x7f523d3eb8b8) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_executor.cc:933
#16 0x00000000007a1009 in JOIN::exec (this=0x7f523d3eb8b8) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_executor.cc:194
#17 0x0000000000801713 in mysql_execute_select (thd=0x7f5243fee000, select_lex=0x7f5243ff0878, free_join=true) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_select.cc:1100
#18 0x0000000000801a0f in mysql_select (thd=0x7f5243fee000, tables=0x7f523d3eb280, wild_num=1, fields=..., conds=0x0, order=0x7f5243ff0a40, group=0x7f5243ff0978, having=0x0, select_options=2147748608, result=0x7f523d3eb890, unit=0x7f5243ff0230, select_lex=0x7f5243ff0878) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_select.cc:1221
#19 0x00000000007ffa97 in handle_select (thd=0x7f5243fee000, result=0x7f523d3eb890, setup_tables_done_option=0) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_select.cc:110
#20 0x00000000007d98f4 in execute_sqlcom_select (thd=0x7f5243fee000, all_tables=0x7f523d3eb280) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:5103
#21 0x00000000007d26a4 in mysql_execute_command (thd=0x7f5243fee000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:2649
#22 0x00000000007dc4be in mysql_parse (thd=0x7f5243fee000, rawbuf=0x7f523d3eb010 "select * from performance_schema.session_connect_attrs", length=54, parser_state=0x7fffcfc60c30) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:6357
#23 0x00000000007cf630 in dispatch_command (command=COM_QUERY, thd=0x7f5243fee000, packet=0x7f523d3e1001 "", packet_length=54) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:1332
#24 0x00000000007ce71f in do_command (thd=0x7f5243fee000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:1034
#25 0x0000000000796b09 in do_handle_one_connection (thd_arg=0x7f5243fee000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_connect.cc:982
#26 0x0000000000623130 in handle_connection_in_main_thread (thd=0x7f5243fee000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/mysqld.cc:6031
#27 0x00000000006236cd in create_new_thread (thd=0x7f5243fee000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/mysqld.cc:6159
#28 0x0000000000623e52 in handle_connections_sockets () at /ssd/ramesh/mysql-server/mysql-5.6/sql/mysqld.cc:6437
#29 0x0000000000622ba1 in mysqld_main (argc=12, argv=0x7f52528262c0) at /ssd/ramesh/mysql-server/mysql-5.6/sql/mysqld.cc:5668
#30 0x0000000000617df0 in main (argc=12, argv=0x7fffcfc62078) at /ssd/ramesh/mysql-server/mysql-5.6/sql/main.cc:25

How to repeat:
** Testcase

# mysqld options required for replay: --thread-handling=no-threads
DROP DATABASE test;CREATE DATABASE test;USE test;
select * from performance_schema.session_connect_attrs;

The attached tarball (1440997028.tar.gz) gives the testcase as an exact
match of our system, including some handy utilities

$ vi 1440997028_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
$ ./1440997028_init        # STEP2: Initializes the data dir
$ ./1440997028_start       # STEP3: Starts mysqld
$ ./1440997028_cl          # STEP4: To check mysqld is up
$ ./1440997028_run_pquery  # STEP5: Run the testcase with the pquery
binary
$ ./1440997028_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/1440997028/error.log.out  # STEP6: Verify the error log
$ ./1440997028_gdb         # OPTIONAL: Brings you to a gdb prompt with gdb attached to the used mysqld and attached to the generated core
$ ./1440997028_parse_core  # STEP7: Create 1440997028_STD.gdb and
1440997028_FULL.gdb; standard and full variables gdb stack traces
[31 Aug 2015 16:48] Ramesh Sivaraman
Testcase bundle

Attachment: 1440997028_bug_bundle.tar.gz (application/gzip, text), 1012.32 KiB.

[31 Aug 2015 21:11] MySQL Verification Team
Thank you for the bug report. No repeatable on 5.7 version.

2015-08-31 17:52:57 8852 [Note] 5.6\bin\mysqld: ready for connections.
Version: '5.6.27-debug'  socket: ''  port: 3306  Source distribution PULL: 2015/08/14
Assertion failed: pfs->m_processlist_id != 0, file C:\ago14.2015\mysql-5.6\storage\perfschema\table_session_connect.cc, line 254
R6010
- abort() has been called
20:53:16 UTC - mysqld got exception 0x80000003 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=1
max_threads=1
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 10358 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x99e736b280
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
7ff607e5b0f5    mysqld.exe!my_sigabrt_handler()[my_thr_init.c:458]
7ff6084380cf    mysqld.exe!raise()[winsig.c:594]
7ff608444ee0    mysqld.exe!abort()[abort.c:82]
7ff608434948    mysqld.exe!_wassert()[assert.c:156]
7ff6083406be    mysqld.exe!table_session_connect::make_row()[table_session_connect.cc:254]
7ff608340e7e    mysqld.exe!cursor_by_thread_connect_attr::rnd_next()[cursor_by_thread_connect_attr.cc:37]
7ff6082fa152    mysqld.exe!ha_perfschema::rnd_next()[ha_perfschema.cc:332]
7ff6079651e2    mysqld.exe!handler::ha_rnd_next()[handler.cc:2688]
7ff607b94348    mysqld.exe!rr_sequential()[records.cc:480]
7ff607d1ef0d    mysqld.exe!join_init_read_record()[sql_executor.cc:2400]
7ff607d1dd42    mysqld.exe!sub_select()[sql_executor.cc:1256]
7ff607d239ac    mysqld.exe!do_select()[sql_executor.cc:933]
7ff607d220c5    mysqld.exe!JOIN::exec()[sql_executor.cc:194]
7ff607ca34ae    mysqld.exe!mysql_execute_select()[sql_select.cc:1103]
7ff607c962f9    mysqld.exe!mysql_select()[sql_select.cc:1221]
7ff607c95f0d    mysqld.exe!handle_select()[sql_select.cc:110]
7ff607aa4743    mysqld.exe!execute_sqlcom_select()[sql_parse.cc:5134]
7ff607a961a5    mysqld.exe!mysql_execute_command()[sql_parse.cc:2656]
7ff607a94c3a    mysqld.exe!mysql_parse()[sql_parse.cc:6389]
7ff607a9e282    mysqld.exe!dispatch_command()[sql_parse.cc:1343]
7ff607a9d345    mysqld.exe!do_command()[sql_parse.cc:1037]
7ff607aee7b2    mysqld.exe!do_handle_one_connection()[sql_connect.cc:982]
7ff60791289f    mysqld.exe!handle_connection_in_main_thread()[mysqld.cc:6036]
7ff607922247    mysqld.exe!create_new_thread()[mysqld.cc:6163]
7ff60791a279    mysqld.exe!handle_connections_sockets()[mysqld.cc:6442]
7ff60791a2f8    mysqld.exe!handle_connections_sockets_thread()[mysqld.cc:6452]
7ff6083113b5    mysqld.exe!pfs_spawn_thread()[pfs.cc:1862]
7ff607e59696    mysqld.exe!pthread_start()[my_winthread.c:62]
7ff608448725    mysqld.exe!_callthreadstartex()[threadex.c:376]
7ff608448977    mysqld.exe!_threadstartex()[threadex.c:359]
7ff867472d92    KERNEL32.DLL!BaseThreadInitThunk()
7ff867519f64    ntdll.dll!RtlUserThreadStart()

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (99e7646390): select * from performance_schema.session_connect_attrsConnection ID (thread ID): 1
Status: NOT_KILLED
[31 Aug 2015 21:12] MySQL Verification Team
c:\dbs>5.6\bin\mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.27-debug Source distribution PULL: 2015/08/14

Copyright (c) 2000, 2015, 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, 0 rows affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
mysql> select * from performance_schema.session_connect_attrs;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> exit
Bye
[13 Nov 2015 13:48] Paul DuBois
Noted in 5.6.29, 5.7.11, 5.8.0 changelogs.

If server was started with --thread-handling=no-threads, no
foreground thread was created for a client connection. The
Performance Schema did not account for the possibility of no
foreground threads for queries on the session_connect_attrs table,
causing an assertion to be raised.