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

Server crash or Assertion `dec_length <= str_length' failed in Item_func_format::val_str_ascii

    XMLWordPrintable

    Details

      Description

      SELECT FORMAT('0', 50, 'de_DE');
      

      10.4 0041dacc1b non-debug

      #3  <signal handler called>
      #4  0x000055bc82c1515c in Item_func_format::val_str_ascii (this=0x7fcfd80105f0, str=0x7fcfea2add60) at /data/src/10.4-rel-bug/sql/item_strfunc.cc:2813
      #5  0x000055bc82c1d75f in Item_func::val_str_from_val_str_ascii (this=0x7fcfd80105f0, str=0x7fcfea2add60, ascii_buffer=<optimized out>) at /data/src/10.4-rel-bug/sql/item_strfunc.cc:103
      #6  0x000055bc82adc0e4 in Type_handler::Item_send_str (this=<optimized out>, item=<optimized out>, protocol=0x7fcfd8000ee8, buf=<optimized out>) at /data/src/10.4-rel-bug/sql/sql_type.cc:6907
      #7  0x000055bc828f74d8 in Protocol::send_result_set_row (this=this@entry=0x7fcfd8000ee8, row_items=row_items@entry=0x7fcfd8010100) at /data/src/10.4-rel-bug/sql/protocol.cc:1035
      #8  0x000055bc8295966a in select_send::send_data (this=0x7fcfd8010ff8, items=...) at /data/src/10.4-rel-bug/sql/sql_class.cc:3012
      #9  0x000055bc829f525e in JOIN::exec_inner (this=this@entry=0x7fcfd8011020) at /data/src/10.4-rel-bug/sql/sql_select.cc:4341
      #10 0x000055bc829f5644 in JOIN::exec (this=this@entry=0x7fcfd8011020) at /data/src/10.4-rel-bug/sql/sql_select.cc:4255
      #11 0x000055bc829f3a80 in mysql_select (thd=thd@entry=0x7fcfd80009a8, tables=0x0, wild_num=0, fields=..., conds=<optimized out>, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fcfd8010ff8, unit=0x7fcfd8004710, select_lex=0x7fcfd800ffb8) at /data/src/10.4-rel-bug/sql/sql_select.cc:4687
      #12 0x000055bc829f440e in handle_select (thd=thd@entry=0x7fcfd80009a8, lex=lex@entry=0x7fcfd8004650, result=result@entry=0x7fcfd8010ff8, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/src/10.4-rel-bug/sql/sql_select.cc:422
      #13 0x000055bc828b5352 in execute_sqlcom_select (thd=thd@entry=0x7fcfd80009a8, all_tables=0x0) at /data/src/10.4-rel-bug/sql/sql_parse.cc:6355
      #14 0x000055bc8299df3d in mysql_execute_command (thd=thd@entry=0x7fcfd80009a8) at /data/src/10.4-rel-bug/sql/sql_parse.cc:3889
      #15 0x000055bc829a4a79 in mysql_parse (thd=thd@entry=0x7fcfd80009a8, rawbuf=<optimized out>, length=31, parser_state=parser_state@entry=0x7fcfea2b05b0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.4-rel-bug/sql/sql_parse.cc:7896
      #16 0x000055bc829a6ca6 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fcfd80009a8, packet=packet@entry=0x7fcfd8007a19 "", packet_length=packet_length@entry=31, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.4-rel-bug/sql/sql_parse.cc:1835
      #17 0x000055bc829a8371 in do_command (thd=0x7fcfd80009a8) at /data/src/10.4-rel-bug/sql/sql_parse.cc:1353
      #18 0x000055bc82a78824 in do_handle_one_connection (connect=connect@entry=0x55bc851157c8) at /data/src/10.4-rel-bug/sql/sql_connect.cc:1412
      #19 0x000055bc82a788d4 in handle_one_connection (arg=arg@entry=0x55bc851157c8) at /data/src/10.4-rel-bug/sql/sql_connect.cc:1316
      #20 0x000055bc8301b584 in pfs_spawn_thread (arg=0x55bc850c12c8) at /data/src/10.4-rel-bug/storage/perfschema/pfs.cc:1869
      #21 0x00007fcff20914a4 in start_thread (arg=0x7fcfea2b1700) at pthread_create.c:456
      #22 0x00007fcff01c5d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      10.4 0041dacc1b debug

      mysqld: /data/src/10.4-bug/sql/item_strfunc.cc:2812: virtual String* Item_func_format::val_str_ascii(String*): Assertion `dec_length <= str_length' failed.
      200806 22:35:08 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fad28980f12 in __GI___assert_fail (assertion=0x560ada8b5c3e "dec_length <= str_length", file=0x560ada8b5aa0 "/data/src/10.4-bug/sql/item_strfunc.cc", line=2812, function=0x560ada8b6e40 <Item_func_format::val_str_ascii(String*)::__PRETTY_FUNCTION__> "virtual String* Item_func_format::val_str_ascii(String*)") at assert.c:101
      #8  0x0000560ad9e12e25 in Item_func_format::val_str_ascii (this=0x7fad100139c8, str=0x7fad22b290f0) at /data/src/10.4-bug/sql/item_strfunc.cc:2812
      #9  0x0000560ad9e07953 in Item_func::val_str_from_val_str_ascii (this=0x7fad100139c8, str=0x7fad22b290f0, ascii_buffer=0x7fad10013a88) at /data/src/10.4-bug/sql/item_strfunc.cc:103
      #10 0x0000560ad9cbad40 in Item_str_ascii_func::val_str (this=0x7fad100139c8, str=0x7fad22b290f0) at /data/src/10.4-bug/sql/item_strfunc.h:88
      #11 0x0000560ad9c132c3 in Type_handler::Item_send_str (this=0x560adb1c3d70 <type_handler_varchar>, item=0x7fad100139c8, protocol=0x7fad100010b8, buf=0x7fad22b290c0) at /data/src/10.4-bug/sql/sql_type.cc:6907
      #12 0x0000560ad9c1fe6e in Type_handler_string_result::Item_send (this=0x560adb1c3d70 <type_handler_varchar>, item=0x7fad100139c8, protocol=0x7fad100010b8, buf=0x7fad22b290c0) at /data/src/10.4-bug/sql/sql_type.h:4752
      #13 0x0000560ad98cbcfc in Item::send (this=0x7fad100139c8, protocol=0x7fad100010b8, buffer=0x7fad22b290c0) at /data/src/10.4-bug/sql/item.h:1038
      #14 0x0000560ad98c5e47 in Protocol::send_result_set_row (this=0x7fad100010b8, row_items=0x7fad100134d8) at /data/src/10.4-bug/sql/protocol.cc:1035
      #15 0x0000560ad997af52 in select_send::send_data (this=0x7fad100143d0, items=...) at /data/src/10.4-bug/sql/sql_class.cc:3012
      #16 0x0000560ad9a40ea9 in JOIN::exec_inner (this=0x7fad100143f8) at /data/src/10.4-bug/sql/sql_select.cc:4341
      #17 0x0000560ad9a40754 in JOIN::exec (this=0x7fad100143f8) at /data/src/10.4-bug/sql/sql_select.cc:4255
      #18 0x0000560ad9a41e69 in mysql_select (thd=0x7fad10000af0, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fad100143d0, unit=0x7fad10004a18, select_lex=0x7fad10013390) at /data/src/10.4-bug/sql/sql_select.cc:4687
      #19 0x0000560ad9a3193c in handle_select (thd=0x7fad10000af0, lex=0x7fad10004958, result=0x7fad100143d0, setup_tables_done_option=0) at /data/src/10.4-bug/sql/sql_select.cc:422
      #20 0x0000560ad99f8166 in execute_sqlcom_select (thd=0x7fad10000af0, all_tables=0x0) at /data/src/10.4-bug/sql/sql_parse.cc:6355
      #21 0x0000560ad99ee79d in mysql_execute_command (thd=0x7fad10000af0) at /data/src/10.4-bug/sql/sql_parse.cc:3889
      #22 0x0000560ad99fc113 in mysql_parse (thd=0x7fad10000af0, rawbuf=0x7fad100132f0 "select FORMAT('0', 50, 'de_DE')", length=31, parser_state=0x7fad22b2a570, is_com_multi=false, is_next_command=false) at /data/src/10.4-bug/sql/sql_parse.cc:7896
      #23 0x0000560ad99e8648 in dispatch_command (command=COM_QUERY, thd=0x7fad10000af0, packet=0x7fad101364d1 "", packet_length=31, is_com_multi=false, is_next_command=false) at /data/src/10.4-bug/sql/sql_parse.cc:1835
      #24 0x0000560ad99e6dea in do_command (thd=0x7fad10000af0) at /data/src/10.4-bug/sql/sql_parse.cc:1353
      #25 0x0000560ad9b70180 in do_handle_one_connection (connect=0x560add0a6c70) at /data/src/10.4-bug/sql/sql_connect.cc:1412
      #26 0x0000560ad9b6fecf in handle_one_connection (arg=0x560add0a6c70) at /data/src/10.4-bug/sql/sql_connect.cc:1316
      #27 0x0000560ada57269f in pfs_spawn_thread (arg=0x560add0c27f0) at /data/src/10.4-bug/storage/perfschema/pfs.cc:1869
      #28 0x00007fad2a9094a4 in start_thread (arg=0x7fad22b2b700) at pthread_create.c:456
      #29 0x00007fad28a3dd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      The failure appeared in 10.4 with this commit

      commit 0041dacc1b8e85e1958355d1cfdc36055b05a884
      Author: Alexander Barkov
      Date:   Wed Aug 5 08:56:12 2020 +0400
       
          MDEV-23118 FORMAT(d1,dec) where dec=0/38 and d1 is DECIMAL(38,38) gives incorrect results
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: