[MDEV-33426] Assertion `status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory' failed in THD::~THD from handle_slave_sql on slave after RESET MASTER Created: 2024-02-08  Updated: 2024-02-08

Status: Open
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4
Fix Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3

Type: Bug Priority: Major
Reporter: Roel Van de Paar Assignee: Andrei Elkin
Resolution: Unresolved Votes: 0
Labels: mtr_hang, regression

Issue Links:
Relates
relates to MDEV-33291 Slave SQL: Could not execute Delete_r... Open

 Description   

-- source include/master-slave.inc
CREATE TEMPORARY SEQUENCE SEQ0 ENGINE=Aria ROW_FORMAT=REDUNDANT;
RESET MASTER;
CREATE TABLE t (c INT AUTO_INCREMENT KEY);
INSERT INTO t SELECT * FROM t;
FLUSH LOGS;
INSERT INTO t VALUES (0);
--sync_slave_with_master
--source include/rpl_end.inc

Leads to:

11.4.0 9b1ea6904965dd345478dedd80e181ad54c767da (Debug)

Core was generated by `/test/MD060224-mariadb-11.4.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=23110348633664)
    at ./nptl/pthread_kill.c:44
[Current thread is 1 (LWP 3493193)]
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=23110348633664) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=23110348633664) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=23110348633664, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00001504ee642476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00001504ee6287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00001504ee62871b in __assert_fail_base (fmt=0x1504ee7dd130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x558e7f559e20 "status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory", file=0x558e7f5585b8 "/test/11.4_dbg/sql/sql_class.cc", line=1751, function=<optimized out>) at ./assert/assert.c:92
#6  0x00001504ee639e96 in __GI___assert_fail (assertion=0x558e7f559e20 "status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory", file=0x558e7f5585b8 "/test/11.4_dbg/sql/sql_class.cc", line=1751, function=0x558e7f55a67e "virtual THD::~THD()") at ./assert/assert.c:101
#7  0x0000558e7e8ec13e in THD::~THD (this=0x150490001b08, __in_chrg=<optimized out>) at /test/11.4_dbg/sql/sql_class.cc:1751
#8  0x0000558e7e8ec171 in THD::~THD (this=0x150490001b08, __in_chrg=<optimized out>) at /test/11.4_dbg/sql/sql_class.cc:1757
#9  0x0000558e7e87ebc4 in handle_slave_sql (arg=arg@entry=0x558e822805a0) at /test/11.4_dbg/sql/slave.cc:5931
#10 0x0000558e7ef08e9a in pfs_spawn_thread (arg=0x15049802a2f8) at /test/11.4_dbg/storage/perfschema/pfs.cc:2201
#11 0x00001504ee694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#12 0x00001504ee726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81



 Comments   
Comment by Roel Van de Paar [ 2024-02-08 ]

It seems to be a regression introduced somewhere after 10.6. 10.11 Is the first current version to crash.

However, I have also listed 10.4 to 10.6 as, oddly, MTR hangs after displaying the final INSERT query.

Generated at Thu Feb 08 10:38:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.