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

Assertion `!mysql_bin_log.is_open()' failed in THD::mark_tmp_table_as_free_for_reuse on UPDATE

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      Same assert as MDEV-37785, however this particular testcase is GTT only and does not reproduce with the same testcase using a TT table instead.

      # mysqld options required for replay:  --log_bin=binlog
      SET binlog_format='STATEMENT';
      CREATE GLOBAL TEMPORARY TABLE gtt (x INT) ON COMMIT PRESERVE ROWS;
      INSERT INTO gtt VALUES (1);
      CREATE TABLE t (x INT, y INT);
      CREATE TABLE tc LIKE t;
      BEGIN;
      CREATE TEMPORARY TABLE t LIKE tc;
      INSERT t VALUES (1, 2);
      UPDATE t, gtt SET t.y=1;
      

      Leads to:

      MDEV-35915-7 CS 12.2.0 87e89a3e8300009e00c1c480ffbb2062db9a87ec (Debug, Clang 21.1.3-20250923) Build 14/10/2025

      mariadbd: /test/bb-12.2-nikita-global-tmp_dbg/sql/temporary_tables.cc:958: void THD::mark_tmp_table_as_free_for_reuse(TABLE *): Assertion `!mysql_bin_log.is_open()' failed.
      

      MDEV-35915-7 CS 12.2.0 87e89a3e8300009e00c1c480ffbb2062db9a87ec (Debug, Clang 21.1.3-20250923) Build 14/10/2025

      Core was generated by `/test/MDEV-35915_7_MD141025-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd --no-d'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 2314114)]
      (gdb) bt
      #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=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x00007d3abbc4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007d3abbc288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007d3abbc2881b in __assert_fail_base (fmt=0x7d3abbdd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5b51851f4fad "!mysql_bin_log.is_open()", file=file@entry=0x5b51850a91e9 "/test/bb-12.2-nikita-global-tmp_dbg/sql/temporary_tables.cc", line=line@entry=958, function=function@entry=0x5b51850c52f6 "void THD::mark_tmp_table_as_free_for_reuse(TABLE *)") at ./assert/assert.c:94
      #6  0x00007d3abbc3b507 in __assert_fail (assertion=0x5b51851f4fad "!mysql_bin_log.is_open()", file=0x5b51850a91e9 "/test/bb-12.2-nikita-global-tmp_dbg/sql/temporary_tables.cc", line=958, function=0x5b51850c52f6 "void THD::mark_tmp_table_as_free_for_reuse(TABLE *)") at ./assert/assert.c:103
      #7  0x00005b5186086b26 in THD::mark_tmp_table_as_free_for_reuse (this=0x7d3988000d58, table=0x7d39880603f8)at /test/bb-12.2-nikita-global-tmp_dbg/sql/temporary_tables.cc:958
      #8  0x00005b5186086927 in THD::mark_tmp_tables_as_free_for_reuse (this=0x7d3988000d58)at /test/bb-12.2-nikita-global-tmp_dbg/sql/temporary_tables.cc:906
      #9  0x00005b5185be185f in close_thread_tables (thd=0x7d3988000d58)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.cc:960
      #10 0x00005b5185be145d in close_thread_tables_for_query (thd=0x7d3988000d58)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.cc:833
      #11 0x00005b5185d4c6bf in mysql_execute_command (thd=0x7d3988000d58, is_called_from_prepared_stmt=false)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:5954
      #12 0x00005b5185d3d538 in mysql_parse (thd=0x7d3988000d58, rawbuf=0x7d3988019f20 "UPDATE t, gtt SET t.y=1", length=23, parser_state=0x7d3ab8ae6a10)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:7895
      #13 0x00005b5185d3ad19 in dispatch_command (command=COM_QUERY, thd=0x7d3988000d58, packet=0x7d398800b299 "UPDATE t, gtt SET t.y=1", packet_length=23, blocking=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:1882
      #14 0x00005b5185d3dfba in do_command (thd=0x7d3988000d58, blocking=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:1421
      #15 0x00005b5185f309ee in do_handle_one_connection (connect=0x5b5189b7a1d8, put_in_cache=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_connect.cc:1414
      #16 0x00005b5185f307d1 in handle_one_connection (arg=0x5b5189b82b38)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_connect.cc:1326
      #17 0x00007d3abbc9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #18 0x00007d3abbd29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      MDEV-35915-7 CS 12.2.0 87e89a3e8300009e00c1c480ffbb2062db9a87ec (Debug, UBASAN, Clang 21.1.3-20250923) Build 14/10/2025

      mariadbd: /test/bb-12.2-nikita-global-tmp_dbg_san/sql/temporary_tables.cc:958: void THD::mark_tmp_table_as_free_for_reuse(TABLE *): Assertion `!mysql_bin_log.is_open()' failed.
      

      ^C

      MDEV-35915-7 CS 12.2.0 87e89a3e8300009e00c1c480ffbb2062db9a87ec (Debug, UBASAN, Clang 21.1.3-20250923) Build 14/10/2025

      Core was generated by `/test/MDEV-35915_7_UBASAN_MD141025-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 2314348)]
      (gdb) bt
      #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  0x00006462965be300 in handle_fatal_signal (sig=<optimized out>)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/signal_handler.cc:298
      #4  <signal handler called>
      #5  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #6  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #7  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #8  0x00007f69b024526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #9  0x00007f69b02288ff in __GI_abort () at ./stdlib/abort.c:79
      #10 0x00007f69b022881b in __assert_fail_base (fmt=0x7f69b03d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x646295378200 <str> "!mysql_bin_log.is_open()", file=file@entry=0x646295376c20 "/test/bb-12.2-nikita-global-tmp_dbg_san/sql/temporary_tables.cc", line=line@entry=958, function=function@entry=0x6462953781a0 <__PRETTY_FUNCTION__._ZN3THD32mark_tmp_table_as_free_for_reuseEP5TABLE> "void THD::mark_tmp_table_as_free_for_reuse(TABLE *)") at ./assert/assert.c:94
      #11 0x00007f69b023b507 in __assert_fail (assertion=0x646295378200 <str> "!mysql_bin_log.is_open()", file=0x646295376c20 "/test/bb-12.2-nikita-global-tmp_dbg_san/sql/temporary_tables.cc", line=958, function=0x6462953781a0 <__PRETTY_FUNCTION__._ZN3THD32mark_tmp_table_as_free_for_reuseEP5TABLE> "void THD::mark_tmp_table_as_free_for_reuse(TABLE *)")at ./assert/assert.c:103
      #12 0x0000646297a9c45c in THD::mark_tmp_table_as_free_for_reuse (this=this@entry=0x7e19af193218, table=table@entry=0x7cf9af085e98)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/temporary_tables.cc:958
      #13 0x0000646297a9b621 in THD::mark_tmp_tables_as_free_for_reuse (this=0x7e19af193218)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/temporary_tables.cc:906
      #14 0x000064629691b4d5 in close_thread_tables (thd=0x7e19af193218)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_base.cc:960
      #15 0x0000646296e3b4c2 in mysql_execute_command (thd=0x7e19af193218, is_called_from_prepared_stmt=<optimized out>)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:5954
      #16 0x0000646296e14099 in mysql_parse (thd=thd@entry=0x7e19af193218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7b68bfb997c0)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:7895
      #17 0x0000646296e0d85d in dispatch_command (command=<optimized out>, thd=0x7e19af193218, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:1882
      #18 0x0000646296e164cb in do_command (thd=thd@entry=0x7e19af193218, blocking=<optimized out>)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:1421
      #19 0x000064629761b80d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x7be9af029638, put_in_cache=<optimized out>)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_connect.cc:1414
      #20 0x000064629761b316 in handle_one_connection (arg=0x7be9af029638)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_connect.cc:1326
      #21 0x0000646295dd41bb in asan_thread_start(void*) ()
      #22 0x00007f69b029ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #23 0x00007f69b0329c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      


      Noticed the slightly different stack on the UBASAN build.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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