[MDEV-22847] Server crashes in handler::check_duplicate_long_entry_key upon executing row event Created: 2020-06-09  Updated: 2022-01-20  Resolved: 2020-06-09

Status: Closed
Project: MariaDB Server
Component/s: Replication, Server, Virtual Columns
Affects Version/s: 10.5
Fix Version/s: N/A

Type: Bug Priority: Blocker
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: regression

Issue Links:
Duplicate
is duplicated by MDEV-22722 Assertion "inited==NONE" failed in h... Closed
Relates
relates to MDEV-27554 Server crashes in handler::check_dupl... Closed

 Description   

--source include/have_binlog_format_row.inc
--source include/master-slave.inc
 
CREATE TABLE t1 (a TEXT, UNIQUE(a));
INSERT INTO t1 VALUES ('foo');
 
--sync_slave_with_master
 
# Cleanup
--connection master
DROP TABLE t1;
--source include/rpl_end.inc

10.5 01e8459d

#3  <signal handler called>
#4  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:286
#5  0x0000557e3975e788 in handler::check_duplicate_long_entry_key (this=0x7f81cc038d60, new_rec=0x7f81cc035808 "\374\003", key_no=0) at /data/src/10.5/sql/handler.cc:6645
#6  0x0000557e3975efd1 in handler::check_duplicate_long_entries (this=0x7f81cc038d60, new_rec=0x7f81cc035808 "\374\003") at /data/src/10.5/sql/handler.cc:6726
#7  0x0000557e3975fdc9 in handler::ha_write_row (this=0x7f81cc038d60, buf=0x7f81cc035808 "\374\003") at /data/src/10.5/sql/handler.cc:6996
#8  0x0000557e398c2af2 in Rows_log_event::write_row (this=0x7f81cc033e98, rgi=0x7f81cc000a90, overwrite=false) at /data/src/10.5/sql/log_event_server.cc:7260
#9  0x0000557e398c3747 in Write_rows_log_event::do_exec_row (this=0x7f81cc033e98, rgi=0x7f81cc000a90) at /data/src/10.5/sql/log_event_server.cc:7480
#10 0x0000557e398bd3d5 in Rows_log_event::do_apply_event (this=0x7f81cc033e98, rgi=0x7f81cc000a90) at /data/src/10.5/sql/log_event_server.cc:5650
#11 0x0000557e392f3feb in Log_event::apply_event (this=0x7f81cc033e98, rgi=0x7f81cc000a90) at /data/src/10.5/sql/log_event.h:1496
#12 0x0000557e392e6a58 in apply_event_and_update_pos_apply (ev=0x7f81cc033e98, thd=0x7f81cc001598, rgi=0x7f81cc000a90, reason=0) at /data/src/10.5/sql/slave.cc:4003
#13 0x0000557e392e703e in apply_event_and_update_pos (ev=0x7f81cc033e98, thd=0x7f81cc001598, rgi=0x7f81cc000a90) at /data/src/10.5/sql/slave.cc:4165
#14 0x0000557e392e7990 in exec_relay_log_event (thd=0x7f81cc001598, rli=0x557e3c2f6218, serial_rgi=0x7f81cc000a90) at /data/src/10.5/sql/slave.cc:4482
#15 0x0000557e392eb2fd in handle_slave_sql (arg=0x557e3c2f4550) at /data/src/10.5/sql/slave.cc:5659
#16 0x0000557e39accb56 in pfs_spawn_thread (arg=0x7f81e01fafd8) at /data/src/10.5/storage/perfschema/pfs.cc:2201
#17 0x00007f821cb614a4 in start_thread (arg=0x7f820ffff700) at pthread_create.c:456
#18 0x00007f821ac95d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Reproducible with InnoDB and MyISAM, on release-, debug- and asan builds alike.
Not reproducible on 10.4.



 Comments   
Comment by Elena Stepanova [ 2020-06-09 ]

Replacing unique blob with an invisible virtual column makes the failure go away:

--source include/have_binlog_format_row.inc
--source include/master-slave.inc
 
CREATE TABLE t1 (a blob c blob as (left (a , 20)) invisible);
INSERT INTO t1 VALUES ('foo');
 
--sync_slave_with_master
 
# Cleanup
--connection master
DROP TABLE t1;
--source include/rpl_end.inc

include/master-slave.inc
[connection master]
CREATE TABLE t1 (a blob, c blob as (left (a , 20)) invisible);
INSERT INTO t1 VALUES ('foo');
connection slave;
connection master;
DROP TABLE t1;
include/rpl_end.inc
bug.t 'row'                              [ pass ]    309
--------------------------------------------------------------------------

Comment by Elena Stepanova [ 2020-06-09 ]

The failure appeared in 10.5 branch with this commit:

commit 0515577d128318e1b62511846d88d0c56226168d
Author: Sergei Golubchik
Date:   Thu Mar 5 19:19:57 2020 +0100
 
    cleanup: prepare "update_handler" for WITHOUT OVERLAPS
    
    * rename to a generic name
    * move remaning initializations from query exec to prepare time
    * simplify/unify key handling in open_table_from_share and delayed
    * remove dead code
    * move tests where they belong

Comment by Elena Stepanova [ 2020-06-09 ]

Closed as a duplicate of MDEV-22722

Generated at Thu Feb 08 09:17:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.