Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-41243

Assertion `(mem_root->flags & 4) == 0' failed

    XMLWordPrintable

Details

    • Can result in hang or crash
    • Q4/2026 Server Maintenance

    Description

      Issue:

      ---------
      mariadbd: /home/ppandith/wl-39226/mysys/my_alloc.c:280: alloc_root: Assertion `(mem_root->flags & 4) == 0' failed.
      260921 16:15:15 [ERROR] ./sql/mariadbd got signal 6 ;

      Version used:

      ----------------
      Branch : 13.2-MDEV-39226-direct-multi_table-update-delete
      commit: 5992b3d00bec6bdaee4c7dcd3efd9bb8e39e4911
      Version : 13.1.0

      Stack trace:

      ---------------

      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:89
      #3  my_write_core (sig=6) at /home/ppandith/wl-39226/mysys/stacktrace.c:424
      #4  handle_fatal_signal (sig=6) at /home/ppandith/wl-39226/sql/signal_handler.cc:298
      #5  <signal handler called>
      #6  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
      #7  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
      #8  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
      #9  __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #10 __GI_abort () at ./stdlib/abort.c:79
      #11 __assert_fail_base (fmt="%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry="(mem_root->flags & 4) == 0", 
          file=file@entry="/home/ppandith/wl-39226/mysys/my_alloc.c", line=line@entry=280, 
          function=function@entry=<__PRETTY_FUNCTION__.1> "alloc_root") at ./assert/assert.c:96
      #12 __assert_fail (assertion="(mem_root->flags & 4) == 0", file="/home/ppandith/wl-39226/mysys/my_alloc.c", line=280, 
          function=<__PRETTY_FUNCTION__.1> "alloc_root") at ./assert/assert.c:105
      #13 alloc_root (mem_root=, length=16) at /home/ppandith/wl-39226/mysys/my_alloc.c:280
      #14 Sql_alloc::operator new (size=16, mem_root=) at /home/ppandith/wl-39226/sql/sql_alloc.h:37
      #15 base_list::push_back (this=, info=, mem_root=) at /home/ppandith/wl-39226/sql/sql_list.h:190
      #16 List<TABLE_LIST>::push_back (this=, a=, mem_root=) at /home/ppandith/wl-39226/sql/sql_list.h:518
      #17 simplify_joins (join=, join_list=, conds=, top=true, in_sj=false) at /home/ppandith/wl-39226/sql/sql_select.cc:20120
      #18 JOIN::optimize_inner (this=) at /home/ppandith/wl-39226/sql/sql_select.cc:2363
      #19 JOIN::optimize (this=) at /home/ppandith/wl-39226/sql/sql_select.cc:2017
      #20 Sql_cmd_dml::execute_inner (this=, thd=) at /home/ppandith/wl-39226/sql/sql_select.cc:35049
      #21 Sql_cmd_delete::execute_inner (this=, thd=) at /home/ppandith/wl-39226/sql/sql_delete.cc:2215
      #22 Sql_cmd_dml::execute (this=, thd=) at /home/ppandith/wl-39226/sql/sql_select.cc:34978
      #23 mysql_execute_command (thd=, is_called_from_prepared_stmt=true) at /home/ppandith/wl-39226/sql/sql_parse.cc:4452
      #24 Prepared_statement::execute (this=, expanded_query=, open_cursor=false, result_arg=, cursor_arg=)
          at /home/ppandith/wl-39226/sql/sql_prepare.cc:5505
      #25 Prepared_statement::execute_loop (this=, expanded_query=, open_cursor=false, result_arg=, cursor_arg=, instrs_set_placeholder=..., 
          packet=, packet_end=) at /home/ppandith/wl-39226/sql/sql_prepare.cc:4863
      #26 mysql_sql_stmt_execute (thd=, name=..., cmd="EXECUTE", open_dynamic_cursor=false, result_arg=, cursor_arg=)
          at /home/ppandith/wl-39226/sql/sql_prepare.cc:3777
      #27 mysql_sql_stmt_execute (thd=) at /home/ppandith/wl-39226/sql/sql_prepare.cc:3800
      #28 mysql_execute_command (thd=, is_called_from_prepared_stmt=false) at /home/ppandith/wl-39226/sql/sql_parse.cc:4013
      #29 mysql_parse (thd=, rawbuf="EXECUTE pstmt", length=13, parser_state=) at /home/ppandith/wl-39226/sql/sql_parse.cc:7968
      #30 dispatch_command (command=COM_QUERY, thd=, packet="EXECUTE pstmt", packet_length=13, blocking=true)
          at /home/ppandith/wl-39226/sql/sql_parse.cc:1903
      #31 do_command (thd=, blocking=true) at /home/ppandith/wl-39226/sql/sql_parse.cc:1437
      #32 do_handle_one_connection (connect=, put_in_cache=true) at /home/ppandith/wl-39226/sql/sql_connect.cc:1514
      #33 handle_one_connection (arg=) at /home/ppandith/wl-39226/sql/sql_connect.cc:1426
      #34 pfs_spawn_thread (arg=) at /home/ppandith/wl-39226/storage/perfschema/pfs.cc:2198
      #35 start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
      #36 clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      How to repeat:

      ----------------
      Slave:

      create table s1( a int);
      create table s2(a int);
      

      Master: Start server with federated engine enabled

      create table s1(a int)  ENGINE="FEDERATED" CONNECTION='mysql://u3:pass1@127.0.0.1:3306/m8/s1';
      create table s2(a int)  ENGINE="FEDERATED" CONNECTION='mysql://u3:pass1@127.0.0.1:3306/m8/s2';
       
      SET GLOBAL federated_pushdown = 1;
      PREPARE pstmt FROM "DELETE s1 FROM s1 JOIN s2 ON (1)";
      EXECUTE pstmt;
      SET GLOBAL federated_pushdown = 0;
      EXECUTE pstmt;
      

      Attachments

        Issue Links

          Activity

            People

              bsrikanth Srikanth Bondalapati
              mariadb-pavithrapandith Pavithra Pandith
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 1.9d
                  1.9d
                  Remaining:
                  Remaining Estimate - 1.9d
                  1.9d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.