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

Assertion `status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory' failed after concurrent DML

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
    • 10.4(EOL)
    • Server
    • None

    Description

      Note: It currently fails for me every time, but there is still concurrency in the test, so run with --repeat=N if it doesn't fail right away. Also try to run on disk and not in shm, it might fail slightly more willingly.

      --source include/have_innodb.inc
      --source include/have_sequence.inc
       
      CREATE TABLE t1 (a VARBINARY(32768)) ENGINE=InnoDB;
      INSERT INTO t1 SELECT CONCAT('foo',seq) FROM seq_1_to_400;
      CREATE TABLE t2 (b BIGINT NOT NULL) ENGINE=InnoDB;
      INSERT INTO t2 VALUES (400),(400);
       
      --connect (con1,localhost,root,,test)
      --send
          UPDATE t2 SET b = b WHERE b IN ( SELECT COUNT(*) FROM t1 GROUP BY UpdateXML( NULL, '/a', '<b>' ) WITH ROLLUP );
       
      --connection default
      INSERT INTO t1 SELECT * FROM t1;
       
      --connection con1
      --reap
       
      --connection default
      --enable_reconnect
      --source include/restart_mysqld.inc
       
      DROP TABLE t1, t2;
      

      10.4 a17a327f

      sql/records.cc:601, sql/records.cc:255, sql/sql_select.cc:21277, sql/sql_select.cc:20335, sql/sql_select.cc:19876, sql/sql_select.cc:4452, sql/sql_select.cc:4235, sql/item_subselect.cc:3938
      Memory lost: 229512 bytes in 1998 chunks
      mysqld: /data/src/10.4/sql/sql_class.cc:1733: virtual THD::~THD(): Assertion `status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory' failed.
      200228  2:20:55 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007ffa3f88df12 in __GI___assert_fail (assertion=0x55c9fcab0be0 "status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory", file=0x55c9fcab0880 "/data/src/10.4/sql/sql_class.cc", line=1733, function=0x55c9fcab2770 <THD::~THD()::__PRETTY_FUNCTION__> "virtual THD::~THD()") at assert.c:101
      #8  0x000055c9fbd49d4b in THD::~THD (this=0x7ff9e4000af0, __in_chrg=<optimized out>) at /data/src/10.4/sql/sql_class.cc:1732
      #9  0x000055c9fbd49f7a in THD::~THD (this=0x7ff9e4000af0, __in_chrg=<optimized out>) at /data/src/10.4/sql/sql_class.cc:1738
      #10 0x000055c9fbc7f992 in one_thread_per_connection_end (thd=0x7ff9e4000af0, put_in_cache=true) at /data/src/10.4/sql/mysqld.cc:2775
      #11 0x000055c9fbf439b2 in do_handle_one_connection (connect=0x55c9ffa91250) at /data/src/10.4/sql/sql_connect.cc:1423
      #12 0x000055c9fbf43692 in handle_one_connection (arg=0x55c9ffa91250) at /data/src/10.4/sql/sql_connect.cc:1316
      #13 0x000055c9fc94a585 in pfs_spawn_thread (arg=0x55c9ffdedf90) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #14 0x00007ffa418164a4 in start_thread (arg=0x7ffa38bec700) at pthread_create.c:456
      #15 0x00007ffa3f94ad0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on 10.1-10.5 debug builds.
      ASAN either doesn't show anything at all or fails on the same assertion.
      Valgrind throws endless errors, as it always does after failing on an assertion.

      On 10.1 the assertion failure is

      Warning: 229512 bytes lost at 0x7f25d2126070, allocated by T@4 at sql/records.cc:608, sql/records.cc:255, sql/sql_select.cc:19504, sql/sql_select.cc:18590, sql/sql_select.cc:18248, sql/sql_select.cc:3277, sql/sql_select.cc:2565, sql/item_subselect.cc:3866
      mysqld: /data/src/10.1/sql/sql_class.cc:1611: virtual THD::~THD(): Assertion `status_var.local_memory_used == 0' failed.
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.