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

Assertion `trn' failed in virtual int ha_maria::start_stmt

    XMLWordPrintable

Details

    Description

      Stack trace from 5.5 commit 4e19aa3864

      Version: '5.5.51-MariaDB-debug'  socket: '/data/bld/5.5/mysql-test/var/tmp/mysqld.1.sock'  port: 16020  Source distribution
      mysqld: /data/src/5.5/storage/maria/ha_maria.cc:2768: virtual int ha_maria::start_stmt(THD*, thr_lock_type): Assertion `trn' failed.
      160714 23:33:13 [ERROR] mysqld got signal 6 ;
       
      #5  0x00007f7bf41cd448 in __GI_abort () at abort.c:89
      #6  0x00007f7bf41c5266 in __assert_fail_base (fmt=0x7f7bf42fe238 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xe46f59 "trn", file=file@entry=0xe46540 "/data/src/5.5/storage/maria/ha_maria.cc", line=line@entry=2768, function=function@entry=0xe47a20 <ha_maria::start_stmt(THD*, thr_lock_type)::__PRETTY_FUNCTION__> "virtual int ha_maria::start_stmt(THD*, thr_lock_type)") at assert.c:92
      #7  0x00007f7bf41c5312 in __GI___assert_fail (assertion=0xe46f59 "trn", file=0xe46540 "/data/src/5.5/storage/maria/ha_maria.cc", line=2768, function=0xe47a20 <ha_maria::start_stmt(THD*, thr_lock_type)::__PRETTY_FUNCTION__> "virtual int ha_maria::start_stmt(THD*, thr_lock_type)") at assert.c:101
      #8  0x0000000000b4bfee in ha_maria::start_stmt (this=0x7f7beec78078, thd=0x7f7befe53060, lock_type=TL_READ_NO_INSERT) at /data/src/5.5/storage/maria/ha_maria.cc:2768
      #9  0x00000000005a67ba in check_lock_and_start_stmt (thd=0x7f7befe53060, prelocking_ctx=0x7f7befe562e8, table_list=0x7f7beed48160) at /data/src/5.5/sql/sql_base.cc:5513
      #10 0x00000000005a76c0 in lock_tables (thd=0x7f7befe53060, tables=0x7f7beed48160, count=1, flags=0) at /data/src/5.5/sql/sql_base.cc:5984
      #11 0x00000000005a6e51 in open_and_lock_tables (thd=0x7f7befe53060, tables=0x7f7beed48160, derived=false, flags=0, prelocking_strategy=0x7f7bf5bc23f0) at /data/src/5.5/sql/sql_base.cc:5732
      #12 0x000000000069ee92 in mysql_alter_table (thd=0x7f7befe53060, new_db=0x7f7beed48730 "test", new_name=0x0, create_info=0x7f7bf5bc26f0, table_list=0x7f7beed48160, alter_info=0x7f7bf5bc2650, order_num=0, order=0x0, ignore=false, require_online=false) at /data/src/5.5/sql/sql_table.cc:6148
      #13 0x0000000000920e56 in Alter_table_statement::execute (this=0x7f7beed487f0, thd=0x7f7befe53060) at /data/src/5.5/sql/sql_alter.cc:106
      #14 0x00000000006059fd in mysql_execute_command (thd=0x7f7befe53060) at /data/src/5.5/sql/sql_parse.cc:4514
      #15 0x0000000000608d40 in mysql_parse (thd=0x7f7befe53060, rawbuf=0x7f7beed48078 "ALTER TABLE t1 ADD KEY (f2)", length=27, parser_state=0x7f7bf5bc3650) at /data/src/5.5/sql/sql_parse.cc:5934
      #16 0x00000000005fca55 in dispatch_command (command=COM_QUERY, thd=0x7f7befe53060, packet=0x7f7bf2b49061 "ALTER TABLE t1 ADD KEY (f2)", packet_length=27) at /data/src/5.5/sql/sql_parse.cc:1079
      #17 0x00000000005fbc0f in do_command (thd=0x7f7befe53060) at /data/src/5.5/sql/sql_parse.cc:793
      #18 0x00000000006fde45 in do_handle_one_connection (thd_arg=0x7f7befe53060) at /data/src/5.5/sql/sql_connect.cc:1270
      #19 0x00000000006fdbd2 in handle_one_connection (arg=0x7f7befe53060) at /data/src/5.5/sql/sql_connect.cc:1186
      #20 0x000000000093dc53 in pfs_spawn_thread (arg=0x7f7bf0bedfc0) at /data/src/5.5/storage/perfschema/pfs.cc:1015
      #21 0x00007f7bf57fc0a4 in start_thread (arg=0x7f7bf5bc4700) at pthread_create.c:309
      #22 0x00007f7bf427f87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      CREATE TABLE t1 (f1 VARCHAR(3), f2 INT, pk INT, PRIMARY KEY (pk)) ENGINE=Aria;
      INSERT INTO t1 VALUES  ('foo',10,1), ('foo',1,2);
      LOCK TABLE t1 WRITE;
      --error ER_DUP_ENTRY
      ALTER TABLE t1 ADD UNIQUE KEY (f1);
      ALTER TABLE t1 ADD KEY (f2);
      

      10.2 is also affected.

      Same test run with valgrind on a non-debug build causes warnings:

      Warnings from 10.2 commit 848d211c5c

      ==29829== Invalid read of size 8
      ==29829==    at 0xA04479: maria_status (ma_info.c:59)
      ==29829==    by 0xA0F105: ha_maria::info(unsigned int) (ha_maria.cc:2484)
      ==29829==    by 0x5CE099: copy_data_between_tables (sql_table.cc:9527)
      ==29829==    by 0x5CE099: mysql_alter_table(THD*, char*, char*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool) (sql_table.cc:9179)
      ==29829==    by 0x60F914: Sql_cmd_alter_table::execute(THD*) (sql_alter.cc:324)
      ==29829==    by 0x54853C: mysql_execute_command(THD*) (sql_parse.cc:6082)
      ==29829==    by 0x5505F3: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:7742)
      ==29829==    by 0x553249: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1790)
      ==29829==    by 0x553A2E: do_command(THD*) (sql_parse.cc:1353)
      ==29829==    by 0x60CD73: do_handle_one_connection(CONNECT*) (sql_connect.cc:1354)
      ==29829==    by 0x60CF33: handle_one_connection (sql_connect.cc:1260)
      ==29829==    by 0x813EB3: pfs_spawn_thread (pfs.cc:1862)
      ==29829==    by 0x4E3D0A3: start_thread (pthread_create.c:309)
      ==29829==    by 0x6CB787C: clone (clone.S:111)
      ==29829==  Address 0xdcae1c8 is 24 bytes inside a block of size 136 free'd
      ==29829==    at 0x4C29F40: free (vg_replace_malloc.c:474)
      ==29829==    by 0xA05DCA: _ma_trnman_end_trans_hook (ma_state.c:546)
      ==29829==    by 0xA14CBE: trnman_end_trn (trnman.c:473)
      ==29829==    by 0xA2E8A6: ma_commit (ma_commit.c:38)
      ==29829==    by 0xA0F613: ha_maria::external_lock(THD*, int) (ha_maria.cc:2755)
      ==29829==    by 0x6C8A23: handler::ha_external_lock(THD*, int) (handler.cc:5818)
      ==29829==    by 0x5CEB42: copy_data_between_tables (sql_table.cc:9767)
      ==29829==    by 0x5CEB42: mysql_alter_table(THD*, char*, char*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool) (sql_table.cc:9179)
      ==29829==    by 0x60F914: Sql_cmd_alter_table::execute(THD*) (sql_alter.cc:324)
      ==29829==    by 0x54853C: mysql_execute_command(THD*) (sql_parse.cc:6082)
      ==29829==    by 0x5505F3: mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) (sql_parse.cc:7742)
      ==29829==    by 0x553249: dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) (sql_parse.cc:1790)
      ==29829==    by 0x553A2E: do_command(THD*) (sql_parse.cc:1353)
      ==29829==    by 0x60CD73: do_handle_one_connection(CONNECT*) (sql_connect.cc:1354)
      ==29829==    by 0x60CF33: handle_one_connection (sql_connect.cc:1260)
      ==29829==    by 0x813EB3: pfs_spawn_thread (pfs.cc:1862)
      ==29829==    by 0x4E3D0A3: start_thread (pthread_create.c:309)
      

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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