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

SIGSEGV|check_word|extract_oracle_date_time|Item_func_to_date::get_date_common|Func_handler_str_to_date_datetime_sec::get_date

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      SET SESSION lc_time_names=ar_sa;
      SELECT to_date ('Tue','DY');
      

      Leads to:

      CS 12.3.2 2f4743f1515d241ed0c903e376759291c9c41800 (Debug, Clang 18.1.3-11) Build 30/03/2026

      Core was generated by `/test/MD300326-mariadb-12.3.2-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x00005848bc91956c in check_word (cs=0x5848be546a70 <my_charset_utf8mb4_general_ci>, lib=0x5848be342568 <my_locale_typelib_ab_day_names_ar_SA>, val=0x71343000ab38 "Tue", end=0x71343000ab3b "", end_of_word=0x7935409e6b90) at /test/12.3_dbg/sql/strfunc.cc:265
      265	    const char *s= lib->type_names[i], *e= s + lib->type_lengths[i], *v= val;
      [Current thread is 1 (LWP 505493)]
      (gdb) bt
      #0  0x00005848bc91956c in check_word (cs=0x5848be546a70 <my_charset_utf8mb4_general_ci>, lib=0x5848be342568 <my_locale_typelib_ab_day_names_ar_SA>, val=0x71343000ab38 "Tue", end=0x71343000ab3b "", end_of_word=0x7935409e6b90) at /test/12.3_dbg/sql/strfunc.cc:265
      #1  0x00005848bcd77f76 in extract_oracle_date_time (thd=0x713430000d58, format_ptr=0x71343001a93a, val=0x71343000ab38 "Tue", length=3, val_cs=0x5848be546a70 <my_charset_utf8mb4_general_ci>, orig_val_cs=0x5848e2afcfd8, l_time=0x7935409e7248, locale=0x5848be584f30 <my_locale_ar_SA>, date_time_type=0x5848bd94b52e "datetime", fuzzydate={m_mode = date_conv_mode_t::CONV_NONE}, give_error=true)at /test/12.3_dbg/sql/item_timefunc.cc:917
      #2  0x00005848bcd768cd in Item_func_to_date::get_date_common (this=0x71343001a7b8, thd=0x713430000d58, ltime=0x7935409e7248, fuzzydate={m_mode = date_mode_t::FRAC_TRUNCATE}, tstype=MYSQL_TIMESTAMP_DATETIME)at /test/12.3_dbg/sql/item_timefunc.cc:5052
      #3  0x00005848bcd80170 in Func_handler_str_to_date_datetime_sec::get_date (this=0x5848be354698 <func_handler_str_to_date_datetime_sec>, thd=0x713430000d58, item=0x71343001a7b8, to=0x7935409e7248, fuzzy={m_mode = date_mode_t::FRAC_TRUNCATE})at /test/12.3_dbg/sql/item_timefunc.h:2279
      #4  0x00005848bcaa95ea in Item_handled_func::get_date (this=0x71343001a7b8, thd=0x713430000d58, to=0x7935409e7248, fuzzydate={m_mode = date_mode_t::FRAC_TRUNCATE})at /test/12.3_dbg/sql/item_func.h:917
      #5  0x00005848bca8f2e7 in Type_handler::Item_send_datetime (this=0x5848be5a7478 <type_handler_datetime2>, item=0x71343001a7b8, protocol=0x713430001438, buf=0x7935409e7240)at /test/12.3_dbg/sql/sql_type.cc:7683
      #6  0x00005848bc96f4ed in Type_handler_datetime_common::Item_send (this=0x5848be5a7478 <type_handler_datetime2>, item=0x71343001a7b8, protocol=0x713430001438, buf=0x7935409e7240)at /test/12.3_dbg/sql/sql_type.h:6729
      #7  0x00005848bc5cfedd in Item::send (this=0x71343001a7b8, protocol=0x713430001438, buffer=0x7935409e7240)at /test/12.3_dbg/sql/item.h:1242
      #8  0x00005848bc627982 in Protocol::send_result_set_row (this=0x713430001438, row_items=0x71343001a470) at /test/12.3_dbg/sql/protocol.cc:1358
      #9  0x00005848bc6fa1de in select_send::send_data (this=0x71343001b3d8, items=@0x71343001a470: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x71343001aa60, last = 0x71343001aa60, elements = 1}, <No data fields>})at /test/12.3_dbg/sql/sql_class.cc:3411
      #10 0x00005848bc6f9e70 in select_result_sink::send_data_with_check (this=0x71343001b3d8, items=@0x71343001a470: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x71343001aa60, last = 0x71343001aa60, elements = 1}, <No data fields>}, u=0x713430005280, sent=0) at /test/12.3_dbg/sql/sql_class.cc:3309
      #11 0x00005848bc827c9b in JOIN::exec_inner (this=0x71343001b400)at /test/12.3_dbg/sql/sql_select.cc:4996
      #12 0x00005848bc8276b0 in JOIN::exec (this=0x71343001b400)at /test/12.3_dbg/sql/sql_select.cc:4913
      #13 0x00005848bc801ecc in mysql_select (thd=0x713430000d58, tables=0x0, fields=@0x71343001a470: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x71343001aa60, last = 0x71343001aa60, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0x71343001b3d8, unit=0x713430005280, select_lex=0x71343001a1b8) at /test/12.3_dbg/sql/sql_select.cc:5439
      #14 0x00005848bc8019a5 in handle_select (thd=0x713430000d58, lex=0x7134300051a0, result=0x71343001b3d8, setup_tables_done_option=0)at /test/12.3_dbg/sql/sql_select.cc:636
      #15 0x00005848bc7a44e1 in execute_sqlcom_select (thd=0x713430000d58, all_tables=0x0) at /test/12.3_dbg/sql/sql_parse.cc:6216
      #16 0x00005848bc79922c in mysql_execute_command (thd=0x713430000d58, is_called_from_prepared_stmt=false) at /test/12.3_dbg/sql/sql_parse.cc:3989
      #17 0x00005848bc7913d4 in mysql_parse (thd=0x713430000d58, rawbuf=0x71343001a120 "SELECT to_date ('Tue','DY')", length=27, parser_state=0x7935409e99f0) at /test/12.3_dbg/sql/sql_parse.cc:7944
      #18 0x00005848bc78e71d in dispatch_command (command=COM_QUERY, thd=0x713430000d58, packet=0x71343000b4c9 "", packet_length=27, blocking=true) at /test/12.3_dbg/sql/sql_parse.cc:1898
      #19 0x00005848bc791f83 in do_command (thd=0x713430000d58, blocking=true)at /test/12.3_dbg/sql/sql_parse.cc:1432
      #20 0x00005848bc98dc89 in do_handle_one_connection (connect=0x5848e31d3ef8, put_in_cache=true) at /test/12.3_dbg/sql/sql_connect.cc:1503
      #21 0x00005848bc98da2e in handle_one_connection (arg=0x5848e312f338)at /test/12.3_dbg/sql/sql_connect.cc:1415
      #22 0x000079356729caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #23 0x0000793567329c6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  300326  0bbec68242a9fa4c681993a895807cf077991790  No bug found                  
      CS  10.6   opt  300326  0bbec68242a9fa4c681993a895807cf077991790  No bug found                  
      CS  10.11  dbg  300326  0b467c2c128dd226c9a1386f358742797a2b6919  No bug found                  
      CS  10.11  opt  300326  0b467c2c128dd226c9a1386f358742797a2b6919  No bug found                  
      CS  11.4   dbg  300326  4a6663e90c572b14e3628df91810ef707647ba60  No bug found                  
      CS  11.4   opt  300326  4a6663e90c572b14e3628df91810ef707647ba60  No bug found                  
      CS  11.8   dbg  300326  840695801a0f2889abdd26c6c59509f99e15c966  No bug found                  
      CS  11.8   opt  300326  840695801a0f2889abdd26c6c59509f99e15c966  No bug found                  
      CS  12.2   dbg  300326  d26a6f44c1f2119377e79a9540886c6d8c01472f  No bug found                  
      CS  12.2   opt  300326  d26a6f44c1f2119377e79a9540886c6d8c01472f  No bug found                  
      CS  12.3   dbg  300326  2f4743f1515d241ed0c903e376759291c9c41800  SIGSEGV|check_word|extract_oracle_date_time|Item_func_to_date::get_date_common|Func_handler_str_to_date_datetime_sec::get_date
      CS  12.3   opt  300326  2f4743f1515d241ed0c903e376759291c9c41800  SIGSEGV|check_word|extract_oracle_date_time|Item_func_to_date::get_date_common|Type_handler::Item_send_datetime
      CS  13.0   dbg  300326  6660d0bdd7c8bdca9ec4e4e7e0f11df4e22c30f1  SIGSEGV|check_word|extract_oracle_date_time|Item_func_to_date::get_date_common|Func_handler_str_to_date_datetime_sec::get_date
      CS  13.0   opt  300326  6660d0bdd7c8bdca9ec4e4e7e0f11df4e22c30f1  SIGSEGV|check_word|extract_oracle_date_time|Item_func_to_date::get_date_common|Type_handler::Item_send_datetime
      ES  10.6   dbg  300326  84a80c8b38208d362225496da08d86d8d454e453  No bug found                  
      ES  10.6   opt  300326  84a80c8b38208d362225496da08d86d8d454e453  No bug found                  
      ES  11.4   dbg  300326  8b2bf17b733262409422ce7d039a0c021fc47077  No bug found                  
      ES  11.4   opt  300326  8b2bf17b733262409422ce7d039a0c021fc47077  No bug found                  
      ES  11.8   dbg  300326  854cae81f52e477c7777a51db26ba640d8755b81  No bug found                  
      ES  11.8   opt  300326  854cae81f52e477c7777a51db26ba640d8755b81  No bug found                  
      

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            saahil Saahil Alam
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.