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

SIGSEGV's in fil_space_t::zip_size and btr_cur_open_at_index_side on ALTER TABLE

    XMLWordPrintable

    Details

      Description

      CREATE TEMPORARY TABLE t (a INT) ENGINE=InnoDB;
      CREATE TABLE t(a INT,b INT) ENGINE=InnoDB;
      DROP TABLE t;
      ALTER TABLE t DISCARD TABLESPACE;
      SET sql_mode= 'TRADITIONAL';
      ALTER TABLE t ADD c DATE NOT NULL;
      

      Leads to:

      10.7.0 52505bf20de0ce77a5c0b0a74af021051987bb0d (Debug)

      Core was generated by `/test/MD160821-mariadb-10.7.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x0000563f70a9cce8 in fil_space_t::zip_size (this=0x0)
          at /test/10.7_dbg/storage/innobase/include/fil0fil.h:699
      [Current thread is 1 (Thread 0x148dc008d700 (LWP 1292431))]
      (gdb) bt
      #0  0x0000563f70a9cce8 in fil_space_t::zip_size (this=0x0) at /test/10.7_dbg/storage/innobase/include/fil0fil.h:699
      #1  btr_cur_open_at_index_side (from_left=from_left@entry=true, index=index@entry=0x148d780267d8, latch_mode=latch_mode@entry=1, cursor=cursor@entry=0x148dc0088660, level=level@entry=0, mtr=mtr@entry=0x148dc0088750) at /test/10.7_dbg/storage/innobase/btr/btr0cur.cc:2614
      #2  0x0000563f7083538f in btr_pcur_open_at_index_side (mtr=0x148dc0088750, level=0, init_pcur=true, pcur=0x148dc0088660, latch_mode=1, index=0x148d780267d8, from_left=true) at /test/10.7_dbg/storage/innobase/include/btr0pcur.ic:538
      #3  innobase_table_is_empty (table=0x148d78024038) at /test/10.7_dbg/storage/innobase/handler/handler0alter.cc:1929
      #4  0x0000563f7083a971 in ha_innobase::check_if_supported_inplace_alter (this=0x148d7801f020, altered_table=0x148dc0089010, ha_alter_info=0x148dc0088f50) at /test/10.7_dbg/storage/innobase/handler/handler0alter.cc:2207
      #5  0x0000563f70264923 in mysql_alter_table (thd=thd@entry=0x148d78000db8, new_db=new_db@entry=0x148d780059b8, new_name=new_name@entry=0x148d78005dd0, create_info=create_info@entry=0x148dc008b4d0, table_list=<optimized out>, table_list@entry=0x148d78013d68, alter_info=alter_info@entry=0x148dc008b3e0, order_num=<optimized out>, order=<optimized out>, ignore=<optimized out>, if_exists=<optimized out>) at /test/10.7_dbg/sql/sql_table.cc:10159
      #6  0x0000563f702f3dc9 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x148d78000db8) at /test/10.7_dbg/sql/structs.h:568
      #7  0x0000563f7017ce3c in mysql_execute_command (thd=thd@entry=0x148d78000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.7_dbg/sql/sql_parse.cc:5997
      #8  0x0000563f70163ac3 in mysql_parse (thd=thd@entry=0x148d78000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x148dc008c400) at /test/10.7_dbg/sql/sql_parse.cc:8030
      #9  0x0000563f701726c8 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x148d78000db8, packet=packet@entry=0x148d7800b739 "ALTER TABLE t ADD c DATE NOT NULL", packet_length=packet_length@entry=33, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_class.h:1357
      #10 0x0000563f70175ae9 in do_command (thd=0x148d78000db8, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:1404
      #11 0x0000563f702ebdd6 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x563f73ec62f8, put_in_cache=put_in_cache@entry=true) at /test/10.7_dbg/sql/sql_connect.cc:1418
      #12 0x0000563f702ec3db in handle_one_connection (arg=arg@entry=0x563f73ec62f8) at /test/10.7_dbg/sql/sql_connect.cc:1312
      #13 0x0000563f70754ce4 in pfs_spawn_thread (arg=0x563f73def2b8) at /test/10.7_dbg/storage/perfschema/pfs.cc:2201
      #14 0x0000148dc9800609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #15 0x0000148dc93ee293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.7.0 52505bf20de0ce77a5c0b0a74af021051987bb0d (Optimized)

      Core was generated by `/test/MD160821-mariadb-10.7.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x0000559969a0af27 in btr_cur_open_at_index_side (
          from_left=from_left@entry=true, index=index@entry=0x15102c01faa0, 
          latch_mode=<optimized out>, latch_mode@entry=1, 
          cursor=cursor@entry=0x151078a55b00, level=level@entry=0, 
          mtr=mtr@entry=0x151078a55c00)
          at /test/10.7_opt/storage/innobase/btr/btr0cur.cc:2614
      [Current thread is 1 (Thread 0x151078a5a700 (LWP 2820367))]
      (gdb) bt
      #0  0x0000559969a0af27 in btr_cur_open_at_index_side (from_left=from_left@entry=true, index=index@entry=0x15102c01faa0, latch_mode=<optimized out>, latch_mode@entry=1, cursor=cursor@entry=0x151078a55b00, level=level@entry=0, mtr=mtr@entry=0x151078a55c00) at /test/10.7_opt/storage/innobase/btr/btr0cur.cc:2614
      #1  0x00005599698ee536 in btr_pcur_open_at_index_side (mtr=0x151078a55c00, level=0, init_pcur=true, pcur=0x151078a55b00, latch_mode=1, index=0x15102c01faa0, from_left=true) at /test/10.7_opt/storage/innobase/include/btr0pcur.ic:538
      #2  innobase_table_is_empty (table=0x15102c01d2b0) at /test/10.7_opt/storage/innobase/handler/handler0alter.cc:1929
      #3  0x00005599698ef6b5 in ha_innobase::check_if_supported_inplace_alter (this=0x15102c019c20, altered_table=<optimized out>, ha_alter_info=<optimized out>) at /test/10.7_opt/storage/innobase/handler/handler0alter.cc:2279
      #4  0x000055996947aa36 in mysql_alter_table (thd=thd@entry=0x15102c000c58, new_db=new_db@entry=0x15102c005698, new_name=new_name@entry=0x15102c005ab0, create_info=create_info@entry=0x151078a585a0, table_list=<optimized out>, table_list@entry=0x15102c010888, alter_info=alter_info@entry=0x151078a584b0, order_num=0, order=0x0, ignore=false, if_exists=false) at /test/10.7_opt/sql/sql_table.cc:10159
      #5  0x00005599694e27ad in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x15102c000c58) at /test/10.7_opt/sql/structs.h:568
      #6  0x00005599693c3f1e in mysql_execute_command (thd=0x15102c000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:5997
      #7  0x00005599693b4336 in mysql_parse (thd=0x15102c000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:8030
      #8  0x00005599693c0225 in dispatch_command (command=COM_QUERY, thd=0x15102c000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.7_opt/sql/sql_class.h:1357
      #9  0x00005599693c2147 in do_command (thd=0x15102c000c58, blocking=blocking@entry=true) at /test/10.7_opt/sql/sql_parse.cc:1404
      #10 0x00005599694dd967 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.7_opt/sql/sql_connect.cc:1418
      #11 0x00005599694ddcad in handle_one_connection (arg=arg@entry=0x55996b9eadd8) at /test/10.7_opt/sql/sql_connect.cc:1312
      #12 0x0000559969830648 in pfs_spawn_thread (arg=0x55996b616c88) at /test/10.7_opt/storage/perfschema/pfs.cc:2201
      #13 0x0000151084394609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #14 0x0000151083f82293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.3.32 d9526ae60820d8b8d511f94edfff3ea2888766ca (Debug)

      Core was generated by `/test/MD160821-mariadb-10.3.32-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x000055deb6f9227f in btr_cur_open_at_index_side_func (
          from_left=from_left@entry=true, index=index@entry=0x1470500247a0,
          latch_mode=latch_mode@entry=1, cursor=cursor@entry=0x1470b01206f0,
          level=level@entry=0,
          file=file@entry=0x55deb754d7a8 "/test/10.3_dbg/storage/innobase/include/btr0pcur.ic", line=545, mtr=0x1470b01207e0)
          at /test/10.3_dbg/storage/innobase/btr/btr0cur.cc:2512
      [Current thread is 1 (Thread 0x1470b0125700 (LWP 1362779))]
      (gdb) bt
      #0  0x000055deb6f9227f in btr_cur_open_at_index_side_func (from_left=from_left@entry=true, index=index@entry=0x1470500247a0, latch_mode=latch_mode@entry=1, cursor=cursor@entry=0x1470b01206f0, level=level@entry=0, file=file@entry=0x55deb754d7a8 "/test/10.3_dbg/storage/innobase/include/btr0pcur.ic", line=545, mtr=0x1470b01207e0) at /test/10.3_dbg/storage/innobase/btr/btr0cur.cc:2512
      #1  0x000055deb6d0a4d6 in btr_pcur_open_at_index_side (mtr=0x1470b01207e0, level=0, init_pcur=true, pcur=0x1470b01206f0, latch_mode=1, index=0x1470500247a0, from_left=true) at /test/10.3_dbg/storage/innobase/include/btr0pcur.ic:545
      #2  innobase_table_is_empty (table=0x147050023b00) at /test/10.3_dbg/storage/innobase/handler/handler0alter.cc:909
      #3  0x000055deb6d0d404 in ha_innobase::check_if_supported_inplace_alter (this=0x14705001fdc8, altered_table=0x14705002c510, ha_alter_info=0x1470b0120ec0) at /test/10.3_dbg/storage/innobase/handler/handler0alter.cc:1161
      #4  0x000055deb68e672d in mysql_alter_table (thd=thd@entry=0x147050000d90, new_db=new_db@entry=0x147050005470, new_name=new_name@entry=0x147050005858, create_info=create_info@entry=0x1470b0122490, table_list=<optimized out>, table_list@entry=0x147050011660, alter_info=alter_info@entry=0x1470b01223d0, order_num=0, order=0x0, ignore=false) at /test/10.3_dbg/sql/sql_table.cc:10020
      #5  0x000055deb695a60e in Sql_cmd_alter_table::execute (this=0x147050011de0, thd=0x147050000d90) at /test/10.3_dbg/sql/sql_alter.cc:512
      #6  0x000055deb682746b in mysql_execute_command (thd=thd@entry=0x147050000d90) at /test/10.3_dbg/sql/sql_parse.cc:6075
      #7  0x000055deb682946c in mysql_parse (thd=thd@entry=0x147050000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1470b0124530, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.3_dbg/sql/sql_parse.cc:7870
      #8  0x000055deb682bbdd in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147050000d90, packet=packet@entry=0x1470500198f1 "ALTER TABLE t ADD c DATE NOT NULL", packet_length=packet_length@entry=33, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.3_dbg/sql/sql_class.h:1152
      #9  0x000055deb682ed6d in do_command (thd=0x147050000d90) at /test/10.3_dbg/sql/sql_parse.cc:1398
      #10 0x000055deb69565c3 in do_handle_one_connection (connect=connect@entry=0x55debade27e0) at /test/10.3_dbg/sql/sql_connect.cc:1403
      #11 0x000055deb69567fa in handle_one_connection (arg=0x55debade27e0) at /test/10.3_dbg/sql/sql_connect.cc:1308
      #12 0x00001470b10e5609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #13 0x00001470b100c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.7.0 52505bf20de0ce77a5c0b0a74af021051987bb0d (Optimized)

      Core was generated by `/test/MD160821-mariadb-10.7.0-linux-x86_64-opt/bin/mysqld --no-defaults --max_a'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x000055a624c2ff27 in btr_cur_open_at_index_side (
          from_left=from_left@entry=true, index=index@entry=0x14843c3ca3a0, 
          latch_mode=<optimized out>, latch_mode@entry=1, 
          cursor=cursor@entry=0x1484731f3b00, level=level@entry=0, 
          mtr=mtr@entry=0x1484731f3c00)
          at /test/10.7_opt/storage/innobase/btr/btr0cur.cc:2614
      [Current thread is 1 (Thread 0x1484731f8700 (LWP 1479305))]
      (gdb) bt
      #0  0x000055a624c2ff27 in btr_cur_open_at_index_side (from_left=from_left@entry=true, index=index@entry=0x14843c3ca3a0, latch_mode=<optimized out>, latch_mode@entry=1, cursor=cursor@entry=0x1484731f3b00, level=level@entry=0, mtr=mtr@entry=0x1484731f3c00) at /test/10.7_opt/storage/innobase/btr/btr0cur.cc:2614
      #1  0x000055a624b13536 in btr_pcur_open_at_index_side (mtr=0x1484731f3c00, level=0, init_pcur=true, pcur=0x1484731f3b00, latch_mode=1, index=0x14843c3ca3a0, from_left=true) at /test/10.7_opt/storage/innobase/include/btr0pcur.ic:538
      #2  innobase_table_is_empty (table=0x14843c0091b0) at /test/10.7_opt/storage/innobase/handler/handler0alter.cc:1929
      #3  0x000055a624b146b5 in ha_innobase::check_if_supported_inplace_alter (this=0x14843c399ac0, altered_table=<optimized out>, ha_alter_info=<optimized out>) at /test/10.7_opt/storage/innobase/handler/handler0alter.cc:2279
      #4  0x000055a62469fa36 in mysql_alter_table (thd=thd@entry=0x14843c000c58, new_db=new_db@entry=0x14843c005698, new_name=new_name@entry=0x14843c005ab0, create_info=create_info@entry=0x1484731f65a0, table_list=<optimized out>, table_list@entry=0x14843c010930, alter_info=alter_info@entry=0x1484731f64b0, order_num=0, order=0x0, ignore=false, if_exists=false) at /test/10.7_opt/sql/sql_table.cc:10159
      #5  0x000055a6247077ad in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x14843c000c58) at /test/10.7_opt/sql/structs.h:568
      #6  0x000055a6245e8f1e in mysql_execute_command (thd=0x14843c000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:5997
      #7  0x000055a6245d9336 in mysql_parse (thd=0x14843c000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:8030
      #8  0x000055a6245e5225 in dispatch_command (command=COM_QUERY, thd=0x14843c000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.7_opt/sql/sql_class.h:1357
      #9  0x000055a6245e7147 in do_command (thd=0x14843c000c58, blocking=blocking@entry=true) at /test/10.7_opt/sql/sql_parse.cc:1404
      #10 0x000055a624702967 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.7_opt/sql/sql_connect.cc:1418
      #11 0x000055a624702cad in handle_one_connection (arg=arg@entry=0x55a628184908) at /test/10.7_opt/sql/sql_connect.cc:1312
      #12 0x000055a624a55648 in pfs_spawn_thread (arg=0x55a627d251d8) at /test/10.7_opt/storage/perfschema/pfs.cc:2201
      #13 0x00001484a8237609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #14 0x00001484a7e25293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.32 (dbg), 10.3.32 (opt), 10.4.22 (opt), 10.4.22 (dbg), 10.5.13 (dbg), 10.5.13 (opt), 10.6.5 (dbg), 10.6.5 (opt), 10.7.0 (dbg), 10.7.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.41 (dbg), 10.2.41 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.35 (dbg), 5.7.35 (opt), 8.0.26 (dbg), 8.0.26 (opt)

      It is a regression as of 10.3, as 10.2 gives:

      10.2.41 (Optimized+Debug)

      10.2.41>ALTER TABLE t ADD c DATE NOT NULL;
      ERROR 1814 (HY000): Tablespace has been discarded for table `t`
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration