Bug #83068 MySQL crash with invalid query pointer
Submitted: 21 Sep 2016 7:15 Modified: 24 Nov 2016 12:52
Reporter: Luis V Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:5.7.14 OS:MacOS
Assigned to: CPU Architecture:Any

[21 Sep 2016 7:15] Luis V
Description:
I'm using MySQL 5.7.14 on Mac OS X (10.11)
This is a very simple set up, where the DB is used by a POS (unicenta POS), so all access from the POS to the DB is local. Both the POS software and the DB are running on the same computer.

The MySQL server keeps crashing for some reason I haven't been able to figure out. By looking at the error file, I found the following logs

00:21:06 UTC - mysqld got signal 6 ;
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.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

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

Thread pointer: 0x7fa11ac86c00
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 = 124043e90 thread_stack 0x40000
0   mysqld                              0x000000010cd5076d my_print_stacktrace + 61
1   mysqld                              0x000000010ccadcf0 handle_fatal_signal + 688
2   libsystem_platform.dylib            0x00007fff90ff0f1a _sigtramp + 26
3   ???                                 0x0000000000000004 0x0 + 4
4   libsystem_c.dylib                   0x00007fff980899b3 abort + 129
5   mysqld                              0x000000010cfe51f1 _Z23ut_dbg_assertion_failedPKcS0_m + 161
6   mysqld                              0x000000010cd962aa _Z20btr_cur_latch_leavesP11buf_block_tRK9page_id_tRK11page_size_tmP9btr_cur_tP5mtr_t + 2282
7   mysqld                              0x000000010cd9814b _Z27btr_cur_search_to_nth_levelP12dict_index_tmPK8dtuple_t15page_cur_mode_tmP9btr_cur_tmPKcmP5mtr_t + 5963
8   mysqld                              0x000000010cf3c060 _Z29row_ins_clust_index_entry_lowmmP12dict_index_tmP8dtuple_tmP9que_thr_tb + 1216
9   mysqld                              0x000000010cf3fcdb _Z25row_ins_clust_index_entryP12dict_index_tP8dtuple_tP9que_thr_tmb + 411
10  mysqld                              0x000000010cf40c7c _Z12row_ins_stepP9que_thr_t + 1164
11  mysqld                              0x000000010cf51210 _Z20row_insert_for_mysqlPKhP14row_prebuilt_t + 4976
12  mysqld                              0x000000010ce812fa _ZN11ha_innobase9write_rowEPh + 1098
13  mysqld                              0x000000010c47ce8e _ZN7handler12ha_write_rowEPh + 206
14  mysqld                              0x000000010cb83573 _Z12write_recordP3THDP5TABLEP9COPY_INFOS4_ + 1283
15  mysqld                              0x000000010cb821cd _ZN14Sql_cmd_insert12mysql_insertEP3THDP10TABLE_LIST + 2717
16  mysqld                              0x000000010cb85ff0 _ZN14Sql_cmd_insert7executeEP3THD + 208
17  mysqld                              0x000000010cbb6929 _Z21mysql_execute_commandP3THDb + 2889
18  mysqld                              0x000000010cbb544c _Z11mysql_parseP3THDP12Parser_state + 860
19  mysqld                              0x000000010cbb411e _Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command + 3822
20  mysqld                              0x000000010cbb4efa _Z10do_commandP3THD + 490
21  mysqld                              0x000000010cc918f4 handle_connection + 468
22  mysqld                              0x000000010d047f04 pfs_spawn_thread + 308
23  libsystem_pthread.dylib             0x00007fff8a67605a _pthread_body + 131
24  libsystem_pthread.dylib             0x00007fff8a675fd7 _pthread_body + 0
25  libsystem_pthread.dylib             0x00007fff8a6733ed thread_start + 13

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fa11adb3030): is an invalid pointer
Connection ID (thread ID): 2
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

I can see 15 similar stacktraces in my error log file (although some of them are slightly different). I can provide all of them if necessary, but here's a summary of what I think can be useful

6 instances of "mysqld got signal 11"
11 instances of "mysqld got signal 6"
16 instances of "Query (xxx) is an invalid pointer"

How to repeat:
I can repro this issue 100% of the times on my DB by

1) Doing a "SELECT * " on a given table
2) By trying to dump the DB schema and data with mysqldump
[24 Oct 2016 12:52] MySQL Verification Team
Thank you for the bug report. Please try 5.7.16 and if you still get the issue provide the data create/insert for repeatable test. Thanks in advance.
[25 Nov 2016 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".