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

InnoDB: Failing assertion: prebuilt->magic_n == ROW_PREBUILT_ALLOCATED, SIGSEGV in mark_used_tables_as_free_for_reuse, Assertion `m_lock_type == 2'

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (a INT);
      CREATE TABLE t2 (b INT);
      CREATE TRIGGER tr BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT * FROM vt;
      CREATE VIEW vt AS SELECT 1 AS x;
      INSERT INTO t1 VALUES (1);
      DROP VIEW IF EXISTS vt;
      CREATE TABLE vt (f INT);
      INSERT INTO t1 VALUES (2);
       
      # Cleanup
      DROP TABLE vt, t1, t2;
      

      On debug builds, regardless the default engine:

      10.2 4ac8fa00 debug

      mysqld: /data/src/10.2/sql/handler.cc:4424: void handler::ha_drop_table(const char*): Assertion `m_lock_type == 2' failed.
      190415 15:49:17 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f3907a43ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x00005652a68f9184 in handler::ha_drop_table (this=0x7f38f004a648, name=0x7f38f0047198 "./test/vt") at /data/src/10.2/sql/handler.cc:4424
      #9  0x00005652a66e184a in free_tmp_table (thd=0x7f38f0000b00, entry=0x7f38f0049a40) at /data/src/10.2/sql/sql_select.cc:18071
      #10 0x00005652a65fd77c in close_thread_tables (thd=0x7f38f0000b00) at /data/src/10.2/sql/sql_base.cc:770
      #11 0x00005652a667b9e9 in mysql_execute_command (thd=0x7f38f0000b00) at /data/src/10.2/sql/sql_parse.cc:6305
      #12 0x00005652a6a71938 in sp_instr_stmt::exec_core (this=0x7f38f006b0d0, thd=0x7f38f0000b00, nextp=0x7f3901d1dd54) at /data/src/10.2/sql/sp_head.cc:3247
      #13 0x00005652a6a70fa3 in sp_lex_keeper::reset_lex_and_exec_core (this=0x7f38f006b110, thd=0x7f38f0000b00, nextp=0x7f3901d1dd54, open_tables=false, instr=0x7f38f006b0d0) at /data/src/10.2/sql/sp_head.cc:3010
      #14 0x00005652a6a715e3 in sp_instr_stmt::execute (this=0x7f38f006b0d0, thd=0x7f38f0000b00, nextp=0x7f3901d1dd54) at /data/src/10.2/sql/sp_head.cc:3163
      #15 0x00005652a6a6c7a7 in sp_head::execute (this=0x7f38f0069688, thd=0x7f38f0000b00, merge_da_on_success=false) at /data/src/10.2/sql/sp_head.cc:1328
      #16 0x00005652a6a6d39e in sp_head::execute_trigger (this=0x7f38f0069688, thd=0x7f38f0000b00, db_name=0x7f38f0092958, table_name=0x7f38f0092968, grant_info=0x7f38f006b7b8) at /data/src/10.2/sql/sp_head.cc:1657
      #17 0x00005652a6755d79 in Table_triggers_list::process_triggers (this=0x7f38f007fc58, thd=0x7f38f0000b00, event=TRG_EVENT_INSERT, time_type=TRG_ACTION_BEFORE, old_row_is_record1=true) at /data/src/10.2/sql/sql_trigger.cc:2199
      #18 0x00005652a660dd86 in fill_record_n_invoke_before_triggers (thd=0x7f38f0000b00, table=0x7f38f007c1c0, ptr=0x7f38f000c200, values=..., ignore_errors=false, event=TRG_EVENT_INSERT) at /data/src/10.2/sql/sql_base.cc:8349
      #19 0x00005652a664d50e in mysql_insert (thd=0x7f38f0000b00, table_list=0x7f38f0012538, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.2/sql/sql_insert.cc:1002
      #20 0x00005652a66750aa in mysql_execute_command (thd=0x7f38f0000b00) at /data/src/10.2/sql/sql_parse.cc:4438
      #21 0x00005652a6680565 in mysql_parse (thd=0x7f38f0000b00, rawbuf=0x7f38f0012458 "INSERT INTO t1 VALUES (2)", length=25, parser_state=0x7f3901d1f200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:8013
      #22 0x00005652a666e062 in dispatch_command (command=COM_QUERY, thd=0x7f38f0000b00, packet=0x7f38f008ddb1 "INSERT INTO t1 VALUES (2)", packet_length=25, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1832
      #23 0x00005652a666c97f in do_command (thd=0x7f38f0000b00) at /data/src/10.2/sql/sql_parse.cc:1386
      #24 0x00005652a67c0069 in do_handle_one_connection (connect=0x5652a92a6d90) at /data/src/10.2/sql/sql_connect.cc:1335
      #25 0x00005652a67bfdf6 in handle_one_connection (arg=0x5652a92a6d90) at /data/src/10.2/sql/sql_connect.cc:1241
      #26 0x00005652a6be80fa in pfs_spawn_thread (arg=0x5652a92acba0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #27 0x00007f3909b38494 in start_thread (arg=0x7f3901d20700) at pthread_create.c:333
      #28 0x00007f3907b0093f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      When executed on a non-debug build with MyISAM for a default engine:

      10.2 4ac8fa00 non-debug, default storage engine MyISAM

      #2  <signal handler called>
      #3  mi_set_index_cond_func (info=0x0, func=0x0, func_arg=0x0) at /data/src/10.2/storage/myisam/mi_extra.c:419
      #4  0x000055dae5cb7f14 in ha_myisam::reset (this=0x7fb1840b1900) at /data/src/10.2/storage/myisam/ha_myisam.cc:2047
      #5  0x000055dae566536d in mark_used_tables_as_free_for_reuse (table=0x7fb184071ca8, thd=0x7fb1840009a8) at /data/src/10.2/sql/sql_base.cc:605
      #6  close_thread_tables (thd=0x7fb1840009a8) at /data/src/10.2/sql/sql_base.cc:801
      #7  0x000055dae56a934f in mysql_execute_command (thd=0x7fb1840009a8) at /data/src/10.2/sql/sql_parse.cc:6305
      #8  0x000055dae5951dd4 in sp_instr_stmt::exec_core (this=0x7fb1840a6c08, thd=<optimized out>, nextp=0x7fb1a0177344) at /data/src/10.2/sql/sp_head.cc:3247
      #9  0x000055dae5958873 in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x7fb1840a6c48, thd=thd@entry=0x7fb1840009a8, nextp=nextp@entry=0x7fb1a0177344, open_tables=open_tables@entry=false, instr=instr@entry=0x7fb1840a6c08) at /data/src/10.2/sql/sp_head.cc:3010
      #10 0x000055dae5958eac in sp_instr_stmt::execute (this=0x7fb1840a6c08, thd=0x7fb1840009a8, nextp=0x7fb1a0177344) at /data/src/10.2/sql/sp_head.cc:3163
      #11 0x000055dae5954b3b in sp_head::execute (this=this@entry=0x7fb1840a51c0, thd=thd@entry=0x7fb1840009a8, merge_da_on_success=merge_da_on_success@entry=false) at /data/src/10.2/sql/sp_head.cc:1328
      #12 0x000055dae5955030 in sp_head::execute_trigger (this=0x7fb1840a51c0, thd=thd@entry=0x7fb1840009a8, db_name=<optimized out>, table_name=<optimized out>, grant_info=grant_info@entry=0x7fb184092c40) at /data/src/10.2/sql/sp_head.cc:1657
      #13 0x000055dae573c2cc in Table_triggers_list::process_triggers (this=this@entry=0x7fb1840926a0, thd=thd@entry=0x7fb1840009a8, event=event@entry=TRG_EVENT_INSERT, time_type=time_type@entry=TRG_ACTION_BEFORE, old_row_is_record1=old_row_is_record1@entry=true) at /data/src/10.2/sql/sql_trigger.cc:2199
      #14 0x000055dae566ea59 in fill_record_n_invoke_before_triggers (thd=thd@entry=0x7fb1840009a8, table=table@entry=0x7fb184090ff8, ptr=0x7fb1840aa728, values=..., ignore_errors=ignore_errors@entry=false, event=event@entry=TRG_EVENT_INSERT) at /data/src/10.2/sql/sql_base.cc:8349
      #15 0x000055dae569536c in mysql_insert (thd=0x7fb1840009a8, table_list=<optimized out>, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.2/sql/sql_insert.cc:1002
      #16 0x000055dae56aa821 in mysql_execute_command (thd=0x7fb1840009a8) at /data/src/10.2/sql/sql_parse.cc:4438
      #17 0x000055dae56b0b09 in mysql_parse (thd=0x7fb1840009a8, rawbuf=<optimized out>, length=25, parser_state=0x7fb1a0179240, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.2/sql/sql_parse.cc:8013
      #18 0x000055dae56b3a5e in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fb1840009a8, packet=packet@entry=0x7fb184006cf9 "INSERT INTO t1 VALUES (2)", packet_length=packet_length@entry=25, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:1832
      #19 0x000055dae56b42a8 in do_command (thd=0x7fb1840009a8) at /data/src/10.2/sql/sql_parse.cc:1386
      #20 0x000055dae577f204 in do_handle_one_connection (connect=connect@entry=0x55dae861a478) at /data/src/10.2/sql/sql_connect.cc:1335
      #21 0x000055dae577f3a4 in handle_one_connection (arg=arg@entry=0x55dae861a478) at /data/src/10.2/sql/sql_connect.cc:1241
      #22 0x000055dae5a450e4 in pfs_spawn_thread (arg=0x55dae85cb358) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #23 0x00007fb1a76c3494 in start_thread (arg=0x7fb1a017a700) at pthread_create.c:333
      #24 0x00007fb1a568b93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      When executed on a non-debug build with Aria for a default engine:

      10.2 4ac8fa00 non-debug, default storage engine Aria

      #2  <signal handler called>
      #3  ma_set_index_cond_func (info=0x0, func=0x0, func_arg=0x0) at /data/src/10.2/storage/maria/ma_extra.c:501
      #4  0x00005636bd06d884 in ha_maria::reset (this=0x7f544402fc30) at /data/src/10.2/storage/maria/ha_maria.cc:2621
      #5  0x00005636bcd1d36d in mark_used_tables_as_free_for_reuse (table=0x7f544402eca8, thd=0x7f54440009a8) at /data/src/10.2/sql/sql_base.cc:605
      #6  close_thread_tables (thd=0x7f54440009a8) at /data/src/10.2/sql/sql_base.cc:801
      #7  0x00005636bcd6134f in mysql_execute_command (thd=0x7f54440009a8) at /data/src/10.2/sql/sql_parse.cc:6305
      #8  0x00005636bd009dd4 in sp_instr_stmt::exec_core (this=0x7f5444070ab8, thd=<optimized out>, nextp=0x7f5460681344) at /data/src/10.2/sql/sp_head.cc:3247
      #9  0x00005636bd010873 in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x7f5444070af8, thd=thd@entry=0x7f54440009a8, nextp=nextp@entry=0x7f5460681344, open_tables=open_tables@entry=false, instr=instr@entry=0x7f5444070ab8) at /data/src/10.2/sql/sp_head.cc:3010
      #10 0x00005636bd010eac in sp_instr_stmt::execute (this=0x7f5444070ab8, thd=0x7f54440009a8, nextp=0x7f5460681344) at /data/src/10.2/sql/sp_head.cc:3163
      #11 0x00005636bd00cb3b in sp_head::execute (this=this@entry=0x7f544406f070, thd=thd@entry=0x7f54440009a8, merge_da_on_success=merge_da_on_success@entry=false) at /data/src/10.2/sql/sp_head.cc:1328
      #12 0x00005636bd00d030 in sp_head::execute_trigger (this=0x7f544406f070, thd=thd@entry=0x7f54440009a8, db_name=<optimized out>, table_name=<optimized out>, grant_info=grant_info@entry=0x7f5444071130) at /data/src/10.2/sql/sp_head.cc:1657
      #13 0x00005636bcdf42cc in Table_triggers_list::process_triggers (this=this@entry=0x7f54440a71d0, thd=thd@entry=0x7f54440009a8, event=event@entry=TRG_EVENT_INSERT, time_type=time_type@entry=TRG_ACTION_BEFORE, old_row_is_record1=old_row_is_record1@entry=true) at /data/src/10.2/sql/sql_trigger.cc:2199
      #14 0x00005636bcd26a59 in fill_record_n_invoke_before_triggers (thd=thd@entry=0x7f54440009a8, table=table@entry=0x7f54440aa218, ptr=0x7f54440b1a08, values=..., ignore_errors=ignore_errors@entry=false, event=event@entry=TRG_EVENT_INSERT) at /data/src/10.2/sql/sql_base.cc:8349
      #15 0x00005636bcd4d36c in mysql_insert (thd=0x7f54440009a8, table_list=<optimized out>, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.2/sql/sql_insert.cc:1002
      #16 0x00005636bcd62821 in mysql_execute_command (thd=0x7f54440009a8) at /data/src/10.2/sql/sql_parse.cc:4438
      #17 0x00005636bcd68b09 in mysql_parse (thd=0x7f54440009a8, rawbuf=<optimized out>, length=25, parser_state=0x7f5460683240, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.2/sql/sql_parse.cc:8013
      #18 0x00005636bcd6ba5e in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f54440009a8, packet=packet@entry=0x7f5444006cf9 "INSERT INTO t1 VALUES (2)", packet_length=packet_length@entry=25, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:1832
      #19 0x00005636bcd6c2a8 in do_command (thd=0x7f54440009a8) at /data/src/10.2/sql/sql_parse.cc:1386
      #20 0x00005636bce37204 in do_handle_one_connection (connect=connect@entry=0x5636bfda8478) at /data/src/10.2/sql/sql_connect.cc:1335
      #21 0x00005636bce373a4 in handle_one_connection (arg=arg@entry=0x5636bfda8478) at /data/src/10.2/sql/sql_connect.cc:1241
      #22 0x00005636bd0fd0e4 in pfs_spawn_thread (arg=0x5636bfd59358) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #23 0x00007f5467c9d494 in start_thread (arg=0x7f5460684700) at pthread_create.c:333
      #24 0x00007f5465c6593f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      10.2 4ac8fa00 non-debug, default storage engine InnoDB

      2019-04-15 15:53:12 0x7ffb140f2700  InnoDB: Assertion failure in file /data/src/10.2/storage/innobase/row/row0mysql.cc line 1055
      InnoDB: Failing assertion: prebuilt->magic_n == ROW_PREBUILT_ALLOCATED
       
      #4  0x00007ffb1c45d3fa in abort () from /lib/x86_64-linux-gnu/libc.so.6
      #5  0x000056170a69bca9 in ut_dbg_assertion_failed (expr=expr@entry=0x56170aee9cd0 "prebuilt->magic_n == ROW_PREBUILT_ALLOCATED", file=file@entry=0x56170aee9830 "/data/src/10.2/storage/innobase/row/row0mysql.cc", line=line@entry=1055) at /data/src/10.2/storage/innobase/ut/ut0dbg.cc:60
      #6  0x000056170abb73b8 in row_update_prebuilt_trx (prebuilt=<optimized out>, trx=trx@entry=0x7ffb163c4098) at /data/src/10.2/storage/innobase/row/row0mysql.cc:1055
      #7  0x000056170ab05e89 in update_thd (this=0x7ffacc0a1e40, this=0x7ffacc0a1e40, thd=0x7ffacc0009a8) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:3045
      #8  ha_innobase::external_lock (this=0x7ffacc0a1e40, thd=0x7ffacc0009a8, lock_type=2) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:15770
      #9  0x000056170a8e737c in handler::ha_external_lock (this=0x7ffacc0a1e40, thd=thd@entry=0x7ffacc0009a8, lock_type=lock_type@entry=2) at /data/src/10.2/sql/handler.cc:5969
      #10 0x000056170a9b0d18 in unlock_external (thd=thd@entry=0x7ffacc0009a8, table=0x7ffacc010818, count=<optimized out>) at /data/src/10.2/sql/lock.cc:703
      #11 0x000056170a9b0f0c in mysql_unlock_tables (thd=thd@entry=0x7ffacc0009a8, sql_lock=0x7ffacc0107f8, free_lock=<optimized out>) at /data/src/10.2/sql/lock.cc:429
      #12 0x000056170a9b1463 in mysql_unlock_tables (thd=thd@entry=0x7ffacc0009a8, sql_lock=<optimized out>) at /data/src/10.2/sql/lock.cc:418
      #13 0x000056170a7022d1 in close_thread_tables (thd=0x7ffacc0009a8) at /data/src/10.2/sql/sql_base.cc:843
      #14 0x000056170a74634f in mysql_execute_command (thd=0x7ffacc0009a8) at /data/src/10.2/sql/sql_parse.cc:6305
      #15 0x000056170a74db09 in mysql_parse (thd=0x7ffacc0009a8, rawbuf=<optimized out>, length=25, parser_state=0x7ffb140f1240, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.2/sql/sql_parse.cc:8013
      #16 0x000056170a750a5e in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7ffacc0009a8, packet=packet@entry=0x7ffacc006cf9 "INSERT INTO t1 VALUES (2)", packet_length=packet_length@entry=25, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:1832
      #17 0x000056170a7512a8 in do_command (thd=0x7ffacc0009a8) at /data/src/10.2/sql/sql_parse.cc:1386
      #18 0x000056170a81c204 in do_handle_one_connection (connect=connect@entry=0x56170ce8bfb8) at /data/src/10.2/sql/sql_connect.cc:1335
      #19 0x000056170a81c3a4 in handle_one_connection (arg=arg@entry=0x56170ce8bfb8) at /data/src/10.2/sql/sql_connect.cc:1241
      #20 0x000056170aae20e4 in pfs_spawn_thread (arg=0x56170ce24148) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #21 0x00007ffb1e549494 in start_thread (arg=0x7ffb140f2700) at pthread_create.c:333
      #22 0x00007ffb1c51193f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Not reproducible on 10.1.

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              elenst Elena Stepanova
              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.