[MDEV-25389] Assertion `!is_thread_specific || (mysqld_server_initialized && thd)' failed in void my_malloc_size_cb_func(long long int, my_bool) Created: 2021-04-12  Updated: 2022-11-29  Resolved: 2022-10-10

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.4
Fix Version/s: 10.4.27

Type: Bug Priority: Minor
Reporter: Ramesh Sivaraman Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-19515 Improve connect speed Open

 Description   

SET GLOBAL debug_dbug='+d,simulate_failed_connection_1';
SET GLOBAL wsrep_slave_threads=12;

Leads to:

10.4.19 1ea6ac3c953f847da033254d5df67f57987a1884 (Debug)

mysqld: /test/10.4_dbg/sql/mysqld.cc:3735: void my_malloc_size_cb_func(long long int, my_bool): Assertion `!is_thread_specific || (mysqld_server_initialized && thd)' failed.

10.4.19 1ea6ac3c953f847da033254d5df67f57987a1884 (Debug)

Core was generated by `/test/GAL_MD150321-mariadb-10.4.19-linux-x86_64-dbg/bin/mysqld --defaults-file='.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x150a1c109700 (LWP 1486509))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x0000150a2dab3859 in __GI_abort () at abort.c:79
#2  0x0000150a2dab3729 in __assert_fail_base (fmt=0x150a2dc49588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5650217b8b88 "!is_thread_specific || (mysqld_server_initialized && thd)", file=0x5650217b5004 "/test/10.4_dbg/sql/mysqld.cc", line=3735, function=<optimized out>) at assert.c:92
#3  0x0000150a2dac4f36 in __GI___assert_fail (assertion=assertion@entry=0x5650217b8b88 "!is_thread_specific || (mysqld_server_initialized && thd)", file=file@entry=0x5650217b5004 "/test/10.4_dbg/sql/mysqld.cc", line=line@entry=3735, function=function@entry=0x5650217b8b50 "void my_malloc_size_cb_func(long long int, my_bool)") at assert.c:101
#4  0x0000565020a2d8f9 in my_malloc_size_cb_func (size=-256, is_thread_specific=<optimized out>) at /test/10.4_dbg/sql/mysqld.cc:3760
#5  0x00005650217027cc in my_free (ptr=0x15098c00a360) at /test/10.4_dbg/mysys/my_malloc.c:214
#6  0x00005650216defb3 in delete_dynamic (array=array@entry=0x15098c001408) at /test/10.4_dbg/mysys/array.c:303
#7  0x00005650216e32da in my_hash_free (hash=hash@entry=0x15098c0013e0) at /test/10.4_dbg/mysys/hash.c:158
#8  0x0000565020ad84a1 in THD::cleanup (this=this@entry=0x15098c000d90) at /test/10.4_dbg/sql/sql_class.cc:1569
#9  0x0000565020a2e842 in unlink_thd (thd=thd@entry=0x15098c000d90) at /test/10.4_dbg/sql/mysqld.cc:2603
#10 0x0000565020a2eb82 in one_thread_per_connection_end (thd=0x15098c000d90, put_in_cache=<optimized out>) at /test/10.4_dbg/sql/mysqld.cc:2752
#11 0x0000565020d534d8 in start_wsrep_THD (arg=0x1509a40275e0) at /test/10.4_dbg/sql/wsrep_mysqld.cc:2790
#12 0x0000150a2e070609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#13 0x0000150a2dbb0293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.2.38 (dbg), 10.3.29 (dbg), 10.4.19 (dbg)

Bug (or feature/syntax) confirmed not present in:
10.5.9-6 (dbg), 10.6.0 (dbg)



 Comments   
Comment by Marko Mäkelä [ 2022-10-12 ]

In 10.5, this code had been simplified as part of MDEV-19515.

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