[MDEV-22706] Assertion `!current' failed in PROFILING::start_new_query Created: 2020-05-26  Updated: 2020-06-25  Resolved: 2020-06-25

Status: Closed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 10.1, 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.1.46, 10.2.33, 10.3.24, 10.4.14, 10.5.5

Type: Bug Priority: Major
Reporter: Roel Van de Paar Assignee: Sujatha Sivakumar (Inactive)
Resolution: Fixed Votes: 0
Labels: reset_master


 Description   

SET GLOBAL init_slave='SELECT 1';
SET GLOBAL profiling=ON;
CHANGE MASTER TO master_host="0.0.0.0";
START SLAVE SQL_THREAD;
SELECT 1;

Leads to:

10.5.4 8569dac1ec9f6853a0b2f3ea9bcbda67644ead24

mysqld: /test/10.5_dbg/sql/sql_profile.h:297: void PROFILING::start_new_query(const char*): Assertion `!current' failed.

10.5.4 8569dac1ec9f6853a0b2f3ea9bcbda67644ead24

Core was generated by `/test/MD260520-mariadb-10.5.4-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x1527ba00f700 (LWP 652279))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x00005640adbe0d7a in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
#2  0x00005640ad386385 in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5  0x00001527b879e801 in __GI_abort () at abort.c:79
#6  0x00001527b878e39a in __assert_fail_base (fmt=0x1527b89157d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5640add5f5ba "!current", file=file@entry=0x5640add5f5c8 "/test/10.5_dbg/sql/sql_profile.h", line=line@entry=297, function=function@entry=0x5640add62640 <_ZZN9PROFILING15start_new_queryEPKcE19__PRETTY_FUNCTION__> "void PROFILING::start_new_query(const char*)") at assert.c:92
#7  0x00001527b878e412 in __GI___assert_fail (assertion=assertion@entry=0x5640add5f5ba "!current", file=file@entry=0x5640add5f5c8 "/test/10.5_dbg/sql/sql_profile.h", line=line@entry=297, function=function@entry=0x5640add62640 <_ZZN9PROFILING15start_new_queryEPKcE19__PRETTY_FUNCTION__> "void PROFILING::start_new_query(const char*)") at assert.c:101
#8  0x00005640ad0d48fa in PROFILING::start_new_query (initial_state=0x5640add5f5e9 "Starting", this=0x15279846b980) at /test/10.5_dbg/sql/sql_profile.h:297
#9  dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x152798468088, packet=packet@entry=0x1527984964b0 "SELECT 1", packet_length=packet_length@entry=8, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1574
#10 0x00005640ad0d2fbf in execute_init_command (thd=0x152798468088, init_command=<optimized out>, var_lock=<optimized out>) at /test/10.5_dbg/sql/sql_parse.cc:960
#11 0x00005640ad0064a0 in handle_slave_sql (arg=arg@entry=0x1527995d4000) at /test/10.5_dbg/sql/slave.cc:5580
#12 0x00005640ad68e14e in pfs_spawn_thread (arg=0x152798028388) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
#13 0x00001527b94816db in start_thread (arg=0x1527ba00f700) at pthread_create.c:463
#14 0x00001527b887f88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.1.46 (dbg), 10.2.33 (dbg), 10.3.24 (dbg), 10.4.14 (dbg), 10.5.4 (dbg)

Bug confirmed not present in:
MariaDB: 10.1.46 (opt), 10.2.33 (opt), 10.3.24 (opt), 10.4.14 (opt), 10.5.4 (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)



 Comments   
Comment by Sujatha Sivakumar (Inactive) [ 2020-05-29 ]

Hello Andrei,

Please review the fix for MDEV-22706.

Patch: https://github.com/MariaDB/server/commit/6badeb87f0ed7e3eee004bc47986a61fd5f9f58b

Build Bot Testing: http://buildbot.askmonty.org/buildbot/grid?category=main&branch=bb-10.1-sujatha

Thank you.

Comment by Andrei Elkin [ 2020-06-23 ]

Thanks for a proper analysis. Approved with the Runtime consent.

Comment by Sujatha Sivakumar (Inactive) [ 2020-06-25 ]

Fix is pushed in version 10.1.46.

Patch has been tested in higher versions.
10.2:Result file needs to be re-recorded as connection log is enabled in 10.2.
Patch: https://github.com/MariaDB/server/commit/264c8c54abd201154f43e1d0851eb634165c1dfa

10.3: Test needs to be moved to main/ directory.
Patch: https://github.com/MariaDB/server/commit/833b123eec679980727bcaa1e2617e86b50972a1

The patch remains the same for higher versions.

Comment by Roel Van de Paar [ 2020-06-25 ]

Thank you all.

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