Bug #81497 Failing assertion:!cmp_rec_rec(r_cursor->old_rec,rec,offsets1,offsets2,index)
Submitted: 19 May 2016 6:22 Modified: 9 Nov 2017 6:25
Reporter: Roel Van de Paar Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:5.7.12 OS:Any
Assigned to: CPU Architecture:Any
Tags: regression

[19 May 2016 6:22] Roel Van de Paar
Description:
5.7 Crashes on import of Sakila DB...

[roel@localhost MS180516-mysql-5.7.12-linux-x86_64-debug]$ /sda/MS180516-mysql-5.7.12-linux-x86_64-debug/bin/mysql -A -uroot -S/sda/MS180516-mysql-5.7.12-linux-x86_64-debug/socket.sock test < ~/sakila.sql
ERROR 2013 (HY000) at line 880: Lost connection to MySQL server during query

Version: '5.7.12-debug'  socket: '/sda/MS180516-mysql-5.7.12-linux-x86_64-debug/socket.sock'  port: 16175  MySQL Community Server (GPL)
2016-05-19 16:05:41 0x7fe5b00ba700  InnoDB: Assertion failure in thread 140624477792000 in file gis0sea.cc line 1329
InnoDB: Failing assertion: !cmp_rec_rec(r_cursor->old_rec, rec, offsets1, offsets2, index)

+bt
#0  0x00007fe5afaaf741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000001816fa4 in my_write_core (sig=6) at /sda/mysql-5.7.12_dbg/mysys/stacktrace.c:247
#2  0x0000000000e6e794 in handle_fatal_signal (sig=6) at /sda/mysql-5.7.12_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007fe5ade485f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007fe5ade49ce8 in __GI_abort () at abort.c:90
#6  0x0000000001af818f in ut_dbg_assertion_failed (expr=0x21e9430 "!cmp_rec_rec(r_cursor->old_rec, rec, offsets1, offsets2, index)", file=0x21e89f0 "/sda/mysql-5.7.12_dbg/storage/innobase/gis/gis0sea.cc", line=1329) at /sda/mysql-5.7.12_dbg/storage/innobase/ut/ut0dbg.cc:67
#7  0x0000000001c46679 in rtr_cur_restore_position_func (latch_mode=34, btr_cur=0x7fe5b00b5f50, level=1, file=0x21e89f0 "/sda/mysql-5.7.12_dbg/storage/innobase/gis/gis0sea.cc", line=840, mtr=0x7fe5b00b6310) at /sda/mysql-5.7.12_dbg/storage/innobase/gis/gis0sea.cc:1327
#8  0x0000000001c44b92 in rtr_get_father_node (index=0x7fe4bcac05a0, level=1, tuple=0x7fe4bca74a10, sea_cur=0x7fe5b00b5f50, btr_cur=0x7fe5b00b5de0, page_no=11, mtr=0x7fe5b00b6310) at /sda/mysql-5.7.12_dbg/storage/innobase/gis/gis0sea.cc:840
#9  0x0000000001c447c2 in rtr_page_get_father_node_ptr_func (offsets=0x7fe4bca749d8, heap=0x7fe4bca74918, sea_cur=0x7fe5b00b5f50, cursor=0x7fe5b00b5de0, file=0x21e89f0 "/sda/mysql-5.7.12_dbg/storage/innobase/gis/gis0sea.cc", line=709, mtr=0x7fe5b00b6310) at /sda/mysql-5.7.12_dbg/storage/innobase/gis/gis0sea.cc:763
#10 0x0000000001c4456e in rtr_page_get_father_block (offsets=0x0, heap=0x7fe4bca74918, index=0x7fe4bcac05a0, block=0x7fe5549b9458, mtr=0x7fe5b00b6310, sea_cur=0x7fe5b00b5f50, cursor=0x7fe5b00b5de0) at /sda/mysql-5.7.12_dbg/storage/innobase/gis/gis0sea.cc:709
#11 0x0000000001c3c8c5 in rtr_ins_enlarge_mbr (btr_cur=0x7fe5b00b5f50, thr=0x7fe4bca47050, mtr=0x7fe5b00b6310) at /sda/mysql-5.7.12_dbg/storage/innobase/gis/gis0rtree.cc:1370
#12 0x00000000019fda72 in row_ins_sec_index_entry_low (flags=0, mode=33, index=0x7fe4bcac05a0, offsets_heap=0x7fe4bca73f18, heap=0x7fe4bca74418, entry=0x7fe4bcad50a0, trx_id=0, thr=0x7fe4bca47050, dup_chk_only=false) at /sda/mysql-5.7.12_dbg/storage/innobase/row/row0ins.cc:3032
#13 0x00000000019fe36d in row_ins_sec_index_entry (index=0x7fe4bcac05a0, entry=0x7fe4bcad50a0, thr=0x7fe4bca47050, dup_chk_only=false) at /sda/mysql-5.7.12_dbg/storage/innobase/row/row0ins.cc:3248
#14 0x00000000019fe4e9 in row_ins_index_entry (index=0x7fe4bcac05a0, entry=0x7fe4bcad50a0, thr=0x7fe4bca47050) at /sda/mysql-5.7.12_dbg/storage/innobase/row/row0ins.cc:3294
#15 0x00000000019fea0e in row_ins_index_entry_step (node=0x7fe4bca46b60, thr=0x7fe4bca47050) at /sda/mysql-5.7.12_dbg/storage/innobase/row/row0ins.cc:3442
#16 0x00000000019fed98 in row_ins (node=0x7fe4bca46b60, thr=0x7fe4bca47050) at /sda/mysql-5.7.12_dbg/storage/innobase/row/row0ins.cc:3584
#17 0x00000000019ff3bc in row_ins_step (thr=0x7fe4bca47050) at /sda/mysql-5.7.12_dbg/storage/innobase/row/row0ins.cc:3769
#18 0x0000000001a1d76b in row_insert_for_mysql_using_ins_graph (mysql_rec=0x7fe4bcac5430 "\374\t\002\027\065\066\070 Dhule (Dhulia) Loopnuetepec Avenue", '\217' <repeats 112 times>, prebuilt=0x7fe4bca464a0) at /sda/mysql-5.7.12_dbg/storage/innobase/row/row0mysql.cc:1732
#19 0x0000000001a1dccd in row_insert_for_mysql (mysql_rec=0x7fe4bcac5430 "\374\t\002\027\065\066\070 Dhule (Dhulia) Loopnuetepec Avenue", '\217' <repeats 112 times>, prebuilt=0x7fe4bca464a0) at /sda/mysql-5.7.12_dbg/storage/innobase/row/row0mysql.cc:1851
#20 0x00000000018cd642 in ha_innobase::write_row (this=0x7fe4bcac4830, record=0x7fe4bcac5430 "\374\t\002\027\065\066\070 Dhule (Dhulia) Loopnuetepec Avenue", '\217' <repeats 112 times>) at /sda/mysql-5.7.12_dbg/storage/innobase/handler/ha_innodb.cc:7484
#21 0x0000000000ef5b34 in handler::ha_write_row (this=0x7fe4bcac4830, buf=0x7fe4bcac5430 "\374\t\002\027\065\066\070 Dhule (Dhulia) Loopnuetepec Avenue", '\217' <repeats 112 times>) at /sda/mysql-5.7.12_dbg/sql/handler.cc:7844
#22 0x000000000170aeef in write_record (thd=0x7fe4bca16000, table=0x7fe4bca96a20, info=0x7fe5b00b80a0, update=0x7fe5b00b8120) at /sda/mysql-5.7.12_dbg/sql/sql_insert.cc:1860
#23 0x00000000017081bc in Sql_cmd_insert::mysql_insert (this=0x7fe4bc6c10a8, thd=0x7fe4bca16000, table_list=0x7fe4bc6b1140) at /sda/mysql-5.7.12_dbg/sql/sql_insert.cc:780
#24 0x000000000170e942 in Sql_cmd_insert::execute (this=0x7fe4bc6c10a8, thd=0x7fe4bca16000) at /sda/mysql-5.7.12_dbg/sql/sql_insert.cc:3092
#25 0x00000000014ec96f in mysql_execute_command (thd=0x7fe4bca16000, first_level=true) at /sda/mysql-5.7.12_dbg/sql/sql_parse.cc:3520
#26 0x00000000014f21d9 in mysql_parse (thd=0x7fe4bca16000, parser_state=0x7fe5b00b9560) at /sda/mysql-5.7.12_dbg/sql/sql_parse.cc:5519
#27 0x00000000014e7a93 in dispatch_command (thd=0x7fe4bca16000, com_data=0x7fe5b00b9cb0, command=COM_QUERY) at /sda/mysql-5.7.12_dbg/sql/sql_parse.cc:1429
#28 0x00000000014e695d in do_command (thd=0x7fe4bca16000) at /sda/mysql-5.7.12_dbg/sql/sql_parse.cc:997
#29 0x0000000001613aa7 in handle_connection (arg=0x7fe5665fd1c0) at /sda/mysql-5.7.12_dbg/sql/conn_handler/connection_handler_per_thread.cc:301
#30 0x0000000001c7d140 in pfs_spawn_thread (arg=0x7fe5801ffd20) at /sda/mysql-5.7.12_dbg/storage/perfschema/pfs.cc:2188
#31 0x00007fe5afaaadc5 in start_thread (arg=0x7fe5b00ba700) at pthread_create.c:308
#32 0x00007fe5adf0921d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
Reduced testcase attached
[19 May 2016 6:23] Roel Van de Paar
in.sql - just redirect into client

Attachment: in.sql (application/octet-stream, text), 93.38 KiB.

[19 May 2016 6:27] Roel Van de Paar
Credit for finding this one goes to Krunal Bauskar
[19 May 2016 10:10] MySQL Verification Team
Hello Roel,

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

Thanks,
Umesh
[4 Nov 2016 15:23] MySQL Verification Team
Still affects 5.7.16 !

Version: '5.7.16-debug'  MySQL Community Server - Debug (GPL)
InnoDB: Assertion failure in thread 8660 in file gis0sea.cc line 1331
InnoDB: Failing assertion: !cmp_rec_rec(r_cursor->old_rec, rec, offsets1, offsets2, index)
[9 Nov 2017 6:25] Erlend Dahl
Duplicate of

Bug#80939 Insert of GIS data into rtree hits assert in rtr_cur_restore_position_func()

fixed in 5.7.18, 8.0.1.