[MDEV-22448] SIGSEGV in I_P_List from MDL_context::release_lock on INSERT w/ BACKUP LOCK (on optimized builds) Created: 2020-05-04  Updated: 2020-05-04  Resolved: 2020-05-04

Status: Closed
Project: MariaDB Server
Component/s: Backup, Locking
Affects Version/s: 10.4, 10.5
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Roel Van de Paar Assignee: Sergey Vojtovich
Resolution: Duplicate Votes: 0
Labels: not-10.1, not-10.2, not-10.3

Issue Links:
Duplicate
duplicates MDEV-20945 BACKUP UNLOCK + FTWRL assertion failu... Closed

 Description   

USE test;
CREATE TABLE t1(a INT);
CREATE TABLE t2(b INT);
LOCK TABLES t2 AS a2 WRITE;
BACKUP LOCK t1;
UNLOCK TABLES;
INSERT INTO t1 VALUES(0);

Leads to:

10.5.3 f544a712c8a2ef3f3ecba80cb2782b1839fb36ab

Core was generated by `/test/MD010520-mariadb-10.5.3-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x7f0eac431700 (LWP 1009641))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x0000557891aabac7 in my_write_core (sig=sig@entry=11) at /test/10.5_opt/mysys/stacktrace.c:518
#2  0x000055789146d7ca in handle_fatal_signal (sig=11) at /test/10.5_opt/sql/signal_handler.cc:329
#3  <signal handler called>
#4  0x0000557891370721 in I_P_List<MDL_ticket, I_P_List_adapter<MDL_ticket, &MDL_ticket::next_in_context, &MDL_ticket::prev_in_context>, I_P_List_null_counter, I_P_List_no_push_back<MDL_ticket> >::remove (this=<optimized out>, a=0x7f0e79c44150) at /test/10.5_opt/sql/sql_plist.h:126
#5  MDL_context::release_lock (this=<optimized out>, duration=<optimized out>, ticket=0x7f0e79c44150) at /test/10.5_opt/sql/mdl.cc:2879
#6  0x0000557891370752 in MDL_context::release_lock (this=<optimized out>, ticket=<optimized out>) at /test/10.5_opt/sql/mdl.cc:2897
#7  0x00005578913f5594 in backup_unlock (thd=thd@entry=0x7f0e79c12018) at /test/10.5_opt/sql/backup.cc:397
#8  0x000055789122bd34 in THD::cleanup (this=this@entry=0x7f0e79c12018) at /test/10.5_opt/sql/sql_class.cc:1562
#9  0x00005578911b1b85 in unlink_thd (thd=0x7f0e79c12018) at /test/10.5_opt/sql/mysqld.cc:2617
#10 0x00005578913670a1 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x7f0eaa0329b8, put_in_cache=put_in_cache@entry=true) at /test/10.5_opt/sql/sql_connect.cc:1433
#11 0x0000557891367444 in handle_one_connection (arg=arg@entry=0x7f0eaa0329b8) at /test/10.5_opt/sql/sql_connect.cc:1319
#12 0x00005578916d353a in pfs_spawn_thread (arg=0x7f0eaa04b018) at /test/10.5_opt/storage/perfschema/pfs.cc:2201
#13 0x00007f0eab8586db in start_thread (arg=0x7f0eac431700) at pthread_create.c:463
#14 0x00007f0eaac5688f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.4.13 (dbg), 10.4.13 (opt), 10.5.2 (dbg), 10.5.2 (opt), 10.5.3 (dbg), 10.5.3 (opt)

Bug confirmed not present in:
MariaDB: 10.1.45 (dbg), 10.1.45 (opt), 10.2.32 (dbg), 10.2.32 (opt), 10.3.23 (dbg), 10.3.23 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

BACKUP LOCK is not available in 10.3 and the testcase does not fail there.



 Comments   
Comment by Sergey Vojtovich [ 2020-05-04 ]

A duplicate of MDEV-20945.

Comment by Roel Van de Paar [ 2020-05-04 ]

Marked as duplicate, updated MDEV-20945 and ported testcase.

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