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

Server crashes in Column_definition::prepare_stage1 (with different rest of stack) upon creation of stored routine

    XMLWordPrintable

Details

    Description

      SET SQL_MODE= ORACLE;
       
      --delimiter $
      CREATE PROCEDURE p AS
        a ROW (x CHAR COLLATE DEFAULT);
      BEGIN
      END $
      --delimiter ;
      

      10.3 ecc1cd21

      #3  <signal handler called>
      #4  Column_definition::create_length_to_internal_length_string (this=0x7f845c0aa910) at /data/src/10.3/sql/field.h:4423
      #5  0x000055885e03e8d0 in Column_definition::prepare_stage1_string (this=0x7f845c0aa910, thd=0x7f845c000d90, mem_root=0x7f845c0a9ab8, file=0x0, table_flags=16) at /data/src/10.3/sql/sql_table.cc:3208
      #6  0x000055885e16993f in Type_handler_string_result::Column_definition_prepare_stage1 (this=0x55885f3bb9b8 <type_handler_string>, thd=0x7f845c000d90, mem_root=0x7f845c0a9ab8, def=0x7f845c0aa910, file=0x0, table_flags=16) at /data/src/10.3/sql/sql_type.cc:1715
      #7  0x000055885e03eaf5 in Column_definition::prepare_stage1 (this=0x7f845c0aa910, thd=0x7f845c000d90, mem_root=0x7f845c0a9ab8, file=0x0, table_flags=16) at /data/src/10.3/sql/sql_table.cc:3248
      #8  0x000055885e0429d1 in Column_definition::sp_prepare_create_field (this=0x7f845c0aa910, thd=0x7f845c000d90, mem_root=0x7f845c0a9ab8) at /data/src/10.3/sql/sql_table.cc:4507
      #9  0x000055885de8ae29 in sp_head::fill_field_definition (this=0x7f845c0a9a78, thd=0x7f845c000d90, field_def=0x7f845c0aa910) at /data/src/10.3/sql/sp_head.h:662
      #10 0x000055885de8aef3 in sp_head::fill_spvar_definition (this=0x7f845c0a9a78, thd=0x7f845c000d90, def=0x7f845c0aa910) at /data/src/10.3/sql/sp_head.h:684
      #11 0x000055885de8ae9a in sp_head::row_fill_field_definitions (this=0x7f845c0a9a78, thd=0x7f845c000d90, row=0x7f845c0aa9f0) at /data/src/10.3/sql/sp_head.h:674
      #12 0x000055885df3eacf in LEX::sp_variable_declarations_row_finalize (this=0x7f845c09a038, thd=0x7f845c000d90, nvars=1, row=0x7f845c0aa9f0, dflt_value_item=0x0) at /data/src/10.3/sql/sql_lex.cc:5509
      #13 0x000055885e20440d in ORAparse (thd=0x7f845c000d90) at /data/src/10.3/sql/sql_yacc_ora.yy:3339
      #14 0x000055885df7825d in parse_sql (thd=0x7f845c000d90, parser_state=0x7f846cb575c0, creation_ctx=0x0, do_pfs_digest=true) at /data/src/10.3/sql/sql_parse.cc:10153
      #15 0x000055885df72b9d in mysql_parse (thd=0x7f845c000d90, rawbuf=0x7f845c012ad8 "CREATE PROCEDURE p AS\na ROW (x CHAR COLLATE DEFAULT);\nBEGIN\nEND", length=63, parser_state=0x7f846cb575c0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7819
      #16 0x000055885df5f3f0 in dispatch_command (command=COM_QUERY, thd=0x7f845c000d90, packet=0x7f845c008f31 "CREATE PROCEDURE p AS\na ROW (x CHAR COLLATE DEFAULT);\nBEGIN\nEND ", packet_length=64, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1852
      #17 0x000055885df5dd90 in do_command (thd=0x7f845c000d90) at /data/src/10.3/sql/sql_parse.cc:1398
      #18 0x000055885e0dccb9 in do_handle_one_connection (connect=0x558861f686b0) at /data/src/10.3/sql/sql_connect.cc:1403
      #19 0x000055885e0dca15 in handle_one_connection (arg=0x558861f686b0) at /data/src/10.3/sql/sql_connect.cc:1308
      #20 0x000055885eaaafe1 in pfs_spawn_thread (arg=0x55886200d210) at /data/src/10.3/storage/perfschema/pfs.cc:1869
      #21 0x00007f8473043609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #22 0x00007f8472c1d293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Reproducible on 10.3-10.6.
      Reproducible on debug, release and ASAN builds alike.
      Not applicable to 10.2.

      Variations of stack trace with variations of the faulty statement have been observed, e.g.:

      #3  <signal handler called>
      #4  0x0000560b597a4317 in Column_definition::create_interval_from_interval_list (this=0x7f3dc40aae50, mem_root=0x7f3dc40a9dc8, reuse_interval_list_values=false) at /data/src/10.3/sql/field.cc:10311
      #5  0x0000560b597a4b3e in Column_definition::prepare_interval_field (this=0x7f3dc40aae50, mem_root=0x7f3dc40a9dc8, reuse_interval_list_values=false) at /data/src/10.3/sql/field.cc:10411
      #6  0x0000560b5956e734 in Column_definition::prepare_stage1_typelib (this=0x7f3dc40aae50, thd=0x7f3dc4000d90, mem_root=0x7f3dc40a9dc8, file=0x0, table_flags=16) at /data/src/10.3/sql/sql_table.cc:3187
      #7  0x0000560b596998f9 in Type_handler_typelib::Column_definition_prepare_stage1 (this=0x560b5a8eb9b0 <type_handler_set>, thd=0x7f3dc4000d90, mem_root=0x7f3dc40a9dc8, def=0x7f3dc40aae50, file=0x0, table_flags=16) at /data/src/10.3/sql/sql_type.cc:1704
      #8  0x0000560b5956eaf5 in Column_definition::prepare_stage1 (this=0x7f3dc40aae50, thd=0x7f3dc4000d90, mem_root=0x7f3dc40a9dc8, file=0x0, table_flags=16) at /data/src/10.3/sql/sql_table.cc:3248
      #9  0x0000560b595729d1 in Column_definition::sp_prepare_create_field (this=0x7f3dc40aae50, thd=0x7f3dc4000d90, mem_root=0x7f3dc40a9dc8) at /data/src/10.3/sql/sql_table.cc:4507
      #10 0x0000560b593bae29 in sp_head::fill_field_definition (this=0x7f3dc40a9d88, thd=0x7f3dc4000d90, field_def=0x7f3dc40aae50) at /data/src/10.3/sql/sp_head.h:662
      #11 0x0000560b593baef3 in sp_head::fill_spvar_definition (this=0x7f3dc40a9d88, thd=0x7f3dc4000d90, def=0x7f3dc40aae50) at /data/src/10.3/sql/sp_head.h:684
      #12 0x0000560b593bae9a in sp_head::row_fill_field_definitions (this=0x7f3dc40a9d88, thd=0x7f3dc4000d90, row=0x7f3dc40aaf68) at /data/src/10.3/sql/sp_head.h:674
      #13 0x0000560b5946eacf in LEX::sp_variable_declarations_row_finalize (this=0x7f3dc4181868, thd=0x7f3dc4000d90, nvars=2, row=0x7f3dc40aaf68, dflt_value_item=0x0) at /data/src/10.3/sql/sql_lex.cc:5509
      #14 0x0000560b5973440d in ORAparse (thd=0x7f3dc4000d90) at /data/src/10.3/sql/sql_yacc_ora.yy:3339
      #15 0x0000560b594a825d in parse_sql (thd=0x7f3dc4000d90, parser_state=0x7f3ddb7675c0, creation_ctx=0x0, do_pfs_digest=true) at /data/src/10.3/sql/sql_parse.cc:10153
      #16 0x0000560b594a2b9d in mysql_parse (thd=0x7f3dc4000d90, rawbuf=0x7f3dc4012ad8 "DECLARE Tuq4p EXCEPTION ; PRECEDES , E1_569z4 ROW ( LOCAL SET ( 'x' ) COLLATE DEFAULT ) ; BEGIN END", length=99, parser_state=0x7f3ddb7675c0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7819
      #17 0x0000560b5948f3f0 in dispatch_command (command=COM_QUERY, thd=0x7f3dc4000d90, packet=0x7f3dc4008f31 "DECLARE Tuq4p EXCEPTION ; PRECEDES , E1_569z4 ROW ( LOCAL SET ( 'x' ) COLLATE DEFAULT ) ; BEGIN END ", packet_length=100, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1852
      #18 0x0000560b5948dd90 in do_command (thd=0x7f3dc4000d90) at /data/src/10.3/sql/sql_parse.cc:1398
      #19 0x0000560b5960ccb9 in do_handle_one_connection (connect=0x560b5c4586b0) at /data/src/10.3/sql/sql_connect.cc:1403
      #20 0x0000560b5960ca15 in handle_one_connection (arg=0x560b5c4586b0) at /data/src/10.3/sql/sql_connect.cc:1308
      #21 0x0000560b59fdafe1 in pfs_spawn_thread (arg=0x560b5c4fd210) at /data/src/10.3/storage/perfschema/pfs.cc:1869
      #22 0x00007f3de5c9b609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #23 0x00007f3de5875293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Activity

          People

            shulga Dmitry Shulga
            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.