Querying GLOBAL_TEMPORARY_TABLES crashes if temp-table owning threads execute new queries
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Fix Released
|
High
|
Laurynas Biveinis | |||
5.6 |
Fix Released
|
High
|
Laurynas Biveinis | |||
5.7 |
Fix Released
|
High
|
Laurynas Biveinis |
Bug Description
One of our production DB server was constantly crashing. Service is extensively using temporary tables in sessions and randomly server would crash if we were selecting information from GLOBAL_
Select:
SELECT engine, data_length, index_length FROM GLOBAL_
How to reproduce issue:
1. In loop start selecting data from GLOBAL_
2. In second session - start creating lots of temporary tables
Simple script (sorry not mysql test suite):
1. In one session start such simple select (better reproducible if several sessions do the same):
watch -n 0.1 "mysql information_schema -e 'SELECT engine, data_length, index_length FROM GLOBAL_
2. In another session start creating lots of temporary tables (tested with 300, but usually mysql crashes faster, from time to time creation has to be repeated):
```
echo "Create temporary table a1(a varchar(
```
Mysql error log:
```
11:29:47 UTC - mysqld got signal 11 ;
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.
Please help us make Percona Server better by reporting any
bugs at http://
key_buffer_
read_buffer_
max_used_
max_threads=4098
thread_count=8
connection_count=6
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x7fec12b09000
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...
stack_bottom = 7fec690dae48 thread_stack 0x30000
/usr/sbin/
/usr/sbin/
/lib/x86_
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/lib/x86_
/lib/x86_
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7febd541d010): is an invalid pointer
Connection ID (thread ID): 430
Status: NOT_KILLED
```
We also have core dump, stack trace from core dump is in attached file.
We also have core dump from original crash, stack trace is actually different and is caused by null reference during `SELECT engine, data_length, index_length FROM GLOBAL_
summary: |
- Reproducible Percona Server 5.6 by selecting data from - GLOBAL_TEMPORARY_TABLES when Temporary Tables are created + Querying GLOBAL_TEMPORARY_TABLES crashes if temp-table owning threads + execute new queries |
We're using percona 5.6.29-76.2 (latest 5.6 at the moment)