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

MariaDB server crash in Field::set_default

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.5, 10.6, 10.7
    • N/A
    • N/A
    • None
    • Linux version 5.13.0-1-MANJARO (builduser@LEGION) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Mon Jun 7 06:16:10 UTC 2021 x86_64

    Description

      PoC:

      CREATE TABLE v0 ( v1 TIMESTAMP ) ;
       SHOW FUNCTION STATUS WHERE 'x' IN ( SELECT DISTINCT ( SYSDATE ( ) ) FROM v0 ORDER BY AVG ( v1 * ( 50741195.000000 - v1 ) ) ) ;
       SELECT v1 , v1 FROM v0 ;
       SELECT DISTINCT AVG ( v1 ) , v1 , GREATEST ( v1 , v1 ) FROM v0 WHERE v1 IS NULL ;
       ALTER TABLE v0 ADD v0 BOOLEAN DEFAULT ( 'x' * QUARTER ( RAND ( - CASE 'x' WHEN - 'x' THEN v1 ELSE + + SYSDATE ( ) END IS NULL ) ) * HOUR ( DEFAULT ( v1 ) ) IS NULL ) ;
      

      Crash Log:

      This could be because you hit a bug. It is also possible that this binary
      or one of the libraries it was linked against is corrupt, improperly built,
      or misconfigured. This error can also be caused by malfunctioning hardware.

      To report this bug, see https://mariadb.com/kb/en/reporting-bugs

      We will try our best to scrape up some info that will hopefully help
      diagnose the problem, but since we have already crashed,
      something is definitely wrong and this may fail.

      Server version: 10.7.0-MariaDB
      key_buffer_size=134217728
      read_buffer_size=131072
      max_used_connections=1
      max_threads=153
      thread_count=1
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467956 K bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.

      Thread pointer: 0x62b0000bd218
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x7f68902a6850 thread_stack 0x5fc00
      sanitizer_common/sanitizer_common_interceptors.inc:4203(__interceptor_backtrace.part.0)[0x7f68afb52c3e]
      mysys/stacktrace.c:213(my_print_stacktrace)[0x55a5c7b34747]
      sql/signal_handler.cc:222(handle_fatal_signal)[0x55a5c6afc120]
      sigaction.c:0(__restore_rt)[0x7f68af53c870]
      sql/field.cc:2591(Field::set_default())[0x55a5c6a7c9eb]
      sql/item.cc:9508(Item_default_value::get_date(THD*, st_mysql_time*, date_mode_t))[0x55a5c6b91ead]
      sql/sql_type.cc:758(Time::make_from_item(THD*, int*, Item*, Time::Options))[0x55a5c68f35b1]
      sql/sql_type.h:1864(Time::is_valid_time() const)[0x55a5c6e4cbb7]
      sql/item_func.cc:745(Item_int_func::val_real())[0x55a5c6c8b582]
      sql/item_func.cc:1370(Item_func_mul::real_op())[0x55a5c6c9f986]
      sql/item_func.h:177(Item_func::is_null())[0x55a5c60f4b00]
      sql/item_cmpfunc.cc:5514(Item_func_isnull::val_int())[0x55a5c6bbea99]
      sql/item.cc:6703(Item::save_int_in_field(Field*, bool))[0x55a5c6b83e90]
      sql/item.cc:6713(Item::save_in_field(Field*, bool))[0x55a5c6b49e71]
      sql/table.cc:8821(TABLE::update_default_fields(bool))[0x55a5c66da34c]
      sql/sql_table.cc:10146(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool, bool))[0x55a5c6621d0b]
      sql/sql_alter.cc:550(Sql_cmd_alter_table::execute(THD*))[0x55a5c6779f9a]
      sql/sql_parse.cc:5997(mysql_execute_command(THD*, bool))[0x55a5c6394180]
      sql/sql_parse.cc:8047(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x55a5c63a15a1]
      sql/sql_parse.cc:1898(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55a5c63a760c]
      sql/sql_parse.cc:1406(do_command(THD*, bool))[0x55a5c63ac73d]
      sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x55a5c6767e57]
      sql/sql_connect.cc:1312(handle_one_connection)[0x55a5c676833d]
      perfschema/pfs.cc:2204(pfs_spawn_thread)[0x55a5c71f8c2c]
      pthread_create.c:0(start_thread)[0x7f68af532259]
      :0(_GI__clone)[0x7f68af0dd5e3]

      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x629000087238): ALTER TABLE v0 ADD v0 BOOLEAN DEFAULT ( 'x' * QUARTER ( RAND ( - CASE 'x' WHEN - 'x' THEN v1 ELSE + + SYSDATE ( ) END IS NULL ) ) * HOUR ( DEFAULT ( v1 ) ) IS NULL )

      Connection ID (thread ID): 4
      Status: NOT_KILLED

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              yaoguang yaoguang
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.