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

Assertion `status_var.memory_used == 0' fails on disconnect after SELECT with materialization+semijoin

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.8
    • Fix Version/s: 10.0.9
    • Component/s: None
    • Labels:
      None

      Description

      The test case is not great, it uses a sleep, but more civilized ways (like count_sessions and such) didn't do the trick reliably – the problem happens anyway, but the server goes down before the assertion failure fully blossoms. The idea of the rough test is to show that the failure actually happens on normal session disconnect, rather than on server shutdown or KILL.

      --connect(con1,localhost,root,,)
      
      SET optimizer_switch = 'materialization=on,semijoin=on';
      
      CREATE TABLE t1 (f1 VARCHAR(3));
      CREATE TABLE t2 (f2 VARCHAR(3), INDEX(f2));
      INSERT INTO t1 VALUES ('foo'),('bar');
      INSERT INTO t2 VALUES ('baz'),('qux');
      
      SELECT * FROM t1 WHERE ( 'abc', 'xyz' ) IN ( 
        SELECT f1, f1 FROM t1 WHERE f1 IN ( SELECT MAX( f2) FROM t2 )
      );
      
      --disconnect con1
      --sleep 2
      
      --connection default
      DROP TABLE t1, t2;
      
      10.0/sql/sql_class.cc:1636: virtual THD::~THD(): Assertion `status_var.memory_used == 0' failed.
      140225 12:45:33 [ERROR] mysqld got signal 6 ;
      
      #6  0x00007f4fca099621 in *__GI___assert_fail (assertion=0xee0df7 "status_var.memory_used == 0", file=<optimized out>, line=1636, function=0xee3430 "virtual THD::~THD()") at assert.c:81
      #7  0x0000000000636516 in THD::~THD (this=0x7f4fc2484070, __in_chrg=<optimized out>) at 10.0/sql/sql_class.cc:1636
      #8  0x000000000063669e in THD::~THD (this=0x7f4fc2484070, __in_chrg=<optimized out>) at 10.0/sql/sql_class.cc:1641
      #9  0x00000000005b7c2f in unlink_thd (thd=0x7f4fc2484070) at 10.0/sql/mysqld.cc:2722
      #10 0x00000000005b7f8f in one_thread_per_connection_end (thd=0x7f4fc2484070, put_in_cache=true) at 10.0/sql/mysqld.cc:2833
      #11 0x0000000000787867 in do_handle_one_connection (thd_arg=0x7f4fc2484070) at 10.0/sql/sql_connect.cc:1390
      #12 0x0000000000787514 in handle_one_connection (arg=0x7f4fc2484070) at 10.0/sql/sql_connect.cc:1293
      #13 0x0000000000a2a921 in pfs_spawn_thread (arg=0x7f4fc367cd50) at 10.0/storage/perfschema/pfs.cc:1853
      #14 0x00007f4fcbc3db50 in start_thread (arg=<optimized out>) at pthread_create.c:304
      #15 0x00007f4fca148a7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
      #16 0x0000000000000000 in ?? ()
      
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x0): 
      Connection ID (thread ID): 4
      Status: KILL_CONNECTION
      

      Stack trace from:

      revision-id: monty@askmonty.org-20140222011156-i1pa6zm2iltb4usv
      revno: 4007
      branch-nick: 10.0
      Build with: 'cmake . -DCMAKE_BUILD_TYPE=Debug && make'
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              elenst Elena Stepanova
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: