Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. 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 upon INSERT to TEMPORARY Aria table, Memory not freed: -50616

Details

    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
      

      Attachments

        Issue Links

          Activity

            Fix confirmed in knielsen_mdev33426_11.4 @ 3285bb0e35df888155bd3848eb29191c997a4142.
            Testing continues. If any more Aria issues are seen, I will test them against the new build also.

            Roel Roel Van de Paar added a comment - Fix confirmed in knielsen_mdev33426_11.4 @ 3285bb0e35df888155bd3848eb29191c997a4142 . Testing continues. If any more Aria issues are seen, I will test them against the new build also.

            After review, Monty wanted a different fix.
            I have (force-)pushed a new patch to knielsen_mdev33426_11.4 to replace the old fix for MDEV-33562 and MDEV-25923.

            knielsen Kristian Nielsen added a comment - After review, Monty wanted a different fix. I have (force-)pushed a new patch to knielsen_mdev33426_11.4 to replace the old fix for MDEV-33562 and MDEV-25923 .

            Ack. Will re-test after I finish the current batch cleanup. Overall, this will have to wait for a while, as some other work is more urgent.

            knielsen In regards 086001e4e9717fb6b269decb714b7d4196f46f45, can you confirm that the single MYF(0) on line 4529 was intentional?

            Roel Roel Van de Paar added a comment - Ack. Will re-test after I finish the current batch cleanup. Overall, this will have to wait for a while, as some other work is more urgent. knielsen In regards 086001e4e9717fb6b269decb714b7d4196f46f45 , can you confirm that the single MYF(0) on line 4529 was intentional?

            Roel: Yes, the single MYF(0) is intentional. (This is in fact the core of the fix, specifying non-zero flag here is what triggers the assertion).
            Thanks for being observant and checking!

            My suggestion is to fix this only from 10.6 (ie. not in 10.4), as the impact of this bug in non-debug builds is very minor. Is that ok, or is the fix urgent to get in 10.4 for testing?

            - Kristian.

            knielsen Kristian Nielsen added a comment - Roel : Yes, the single MYF(0) is intentional. (This is in fact the core of the fix, specifying non-zero flag here is what triggers the assertion). Thanks for being observant and checking! My suggestion is to fix this only from 10.6 (ie. not in 10.4), as the impact of this bug in non-debug builds is very minor. Is that ok, or is the fix urgent to get in 10.4 for testing? - Kristian.

            10.6 Sounds fine for me if no-one has any objections. Also not urgent afaik. Thank you for the clarification too!

            Roel Roel Van de Paar added a comment - 10.6 Sounds fine for me if no-one has any objections. Also not urgent afaik. Thank you for the clarification too!

            People

              Roel Roel Van de Paar
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.