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

SIGSEGV in in Item_sum_hybrid_simple::clear upon executing complex DELETE

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      CREATE TABLE t (c INT);
      INSERT INTO t (c) VALUES (0);
      DELETE FROM t WHERE c IN (SELECT * FROM t) ORDER BY LAST_VALUE (t) OVER() IS NOT UNKNOWN;
      

      Leads to:

      MDEV-36290 CS 12.2.0 c0bd9cdf131412fe26fa96d65e896c86208a3c8b (Optimized, Clang 18.1.3-11) Build 24/09/2025

      Core was generated by `/test/MDEV-36290-MD240925-mariadb-12.2.0-linux-x86_64-opt/bin/mariadbd --no-def'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x0000637b149e0df0 in Item_sum_hybrid_simple::clear (this=0xff5b801a148)at /test/main-MDEV-36290_opt/sql/item_windowfunc.h:335
      335	    value->clear();
      [Current thread is 1 (LWP 3387055)]
      (gdb) bt
      #0  0x0000637b149e0df0 in Item_sum_hybrid_simple::clear (this=0xff5b801a148)at /test/main-MDEV-36290_opt/sql/item_windowfunc.h:335
      #1  0x0000637b1498bf28 in compute_window_func (thd=thd@entry=0xff5b8000c68, window_functions=@0xff5b8059368: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0xff5b8059388, last = 0xff5b8059388, elements = 1}, <No data fields>}, cursor_managers=@0xff5fc13d868: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0xff5b805a580, last = 0xff5b805a580, elements = 1}, <No data fields>}, tbl=tbl@entry=0xff5b8068c40, filesort_result=filesort_result@entry=0xff5b8271330)at /test/main-MDEV-36290_opt/sql/sql_window.cc:2925
      #2  0x0000637b1498c3aa in Window_func_runner::exec (this=this@entry=0xff5b8059360, thd=thd@entry=0xff5b8000c68, tbl=0xff5b8068c40, filesort_result=0xff5b8271330)at /test/main-MDEV-36290_opt/sql/sql_window.cc:3068
      #3  0x0000637b1498d4b3 in Window_funcs_sort::exec (this=<optimized out>, join=0xff5b801a6c0, keep_filesort_result=<optimized out>)at /test/main-MDEV-36290_opt/sql/sql_window.cc:3096
      #4  Window_funcs_computation::exec (this=0xff5b8059338, join=0xff5b801a6c0, keep_last_filesort_result=<optimized out>)at /test/main-MDEV-36290_opt/sql/sql_window.cc:3225
      #5  0x0000637b148232b3 in AGGR_OP::end_send (this=0xff5b80591f0)at /test/main-MDEV-36290_opt/sql/sql_select.cc:33635
      #6  0x0000637b148036a7 in sub_select_postjoin_aggr (join=0xff5b801a6c0, join_tab=0xff5b8058870, end_of_records=8)at /test/main-MDEV-36290_opt/sql/sql_select.cc:24144
      #7  0x0000637b14807351 in do_select (join=join@entry=0xff5b801a6c0, procedure=<optimized out>)at /test/main-MDEV-36290_opt/sql/sql_select.cc:23979
      #8  0x0000637b14806d8a in JOIN::exec_inner (this=this@entry=0xff5b801a6c0)at /test/main-MDEV-36290_opt/sql/sql_select.cc:5086
      #9  0x0000637b1482d34b in JOIN::exec (this=0xff5b801a6c0)at /test/main-MDEV-36290_opt/sql/sql_select.cc:4874
      #10 Sql_cmd_dml::execute_inner (this=<optimized out>, thd=0xff5b8000c68)at /test/main-MDEV-36290_opt/sql/sql_select.cc:34785
      #11 0x0000637b14770d60 in Sql_cmd_delete::execute_inner (this=0xff5b801a508, thd=0xff5b8000c68) at /test/main-MDEV-36290_opt/sql/sql_delete.cc:2102
      #12 0x0000637b1482d0fb in Sql_cmd_dml::execute (this=0xff5b801a508, thd=0xff5b8000c68) at /test/main-MDEV-36290_opt/sql/sql_select.cc:34719
      #13 0x0000637b147b5625 in mysql_execute_command (thd=thd@entry=0xff5b8000c68, is_called_from_prepared_stmt=false)at /test/main-MDEV-36290_opt/sql/sql_parse.cc:4399
      #14 0x0000637b147b0a21 in mysql_parse (thd=thd@entry=0xff5b8000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0xff5fc13e420)at /test/main-MDEV-36290_opt/sql/sql_parse.cc:7883
      #15 0x0000637b147aef3f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0xff5b8000c68, packet=packet@entry=0xff5b80089f9 "DELETE FROM t WHERE c IN (SELECT * FROM t) ORDER BY LAST_VALUE (t) OVER() IS NOT UNKNOWN", packet_length=packet_length@entry=88, blocking=true)at /test/main-MDEV-36290_opt/sql/sql_parse.cc:1878
      #16 0x0000637b147b0e31 in do_command (thd=thd@entry=0xff5b8000c68, blocking=true) at /test/main-MDEV-36290_opt/sql/sql_parse.cc:1417
      #17 0x0000637b148de76d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x637b55c9d218, put_in_cache=true)at /test/main-MDEV-36290_opt/sql/sql_connect.cc:1414
      #18 0x0000637b148de52f in handle_one_connection (arg=arg@entry=0x637b55c9d218)at /test/main-MDEV-36290_opt/sql/sql_connect.cc:1326
      #19 0x0000637b14c8bdc9 in pfs_spawn_thread (arg=0x637b55c4d338)at /test/main-MDEV-36290_opt/storage/perfschema/pfs.cc:2198
      #20 0x00000ff5fee9caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #21 0x00000ff5fef29c6c 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  240925  e1f12f149c198829e130eacbeddc19dce3f55b3b  No bug found                  
      CS  10.6   opt  240925  e1f12f149c198829e130eacbeddc19dce3f55b3b  No bug found                  
      CS  10.11  dbg  240925  990b44495c6345fa1198d2f7cb61839d1ada97ef  No bug found                  
      CS  10.11  opt  240925  990b44495c6345fa1198d2f7cb61839d1ada97ef  No bug found                  
      CS  11.4   dbg  240925  e8ef8c005545f0163d76077e285c700e2822f533  m_alloced_field_count|SIGABRT|Create_tmp_table::start|create_tmp_table|JOIN::create_postjoin_aggr_table|JOIN::make_aggr_tables_info
      CS  11.4   opt  240925  e8ef8c005545f0163d76077e285c700e2822f533  SIGSEGV|Item_field::Item_field|Window_funcs_sort::setup|Window_funcs_computation::setup|JOIN::make_aggr_tables_info
      CS  11.8   dbg  240925  d203a8a5df95e2c5778a304a885fb7aedfbc095e  item_sum->fixed()|SIGABRT|add_special_frame_cursors|get_window_functions_required_cursors|Window_func_runner::exec|Window_funcs_sort::exec
      CS  11.8   opt  240925  d203a8a5df95e2c5778a304a885fb7aedfbc095e  SIGSEGV|Item_sum_hybrid_simple::clear|compute_window_func|Window_func_runner::exec|Window_funcs_sort::exec
      CS  12.1   dbg  240925  667c5e0b002a24bc595d60955950200a588f4fb7  item_sum->fixed()|SIGABRT|add_special_frame_cursors|get_window_functions_required_cursors|Window_func_runner::exec|Window_funcs_sort::exec
      CS  12.1   opt  240925  667c5e0b002a24bc595d60955950200a588f4fb7  SIGSEGV|Item_sum_hybrid_simple::clear|compute_window_func|Window_func_runner::exec|Window_funcs_sort::exec
      CS  12.2   dbg  240925  b8a77289639a3b10ada64cf892f02b5cecdb1603  item_sum->fixed()|SIGABRT|add_special_frame_cursors|get_window_functions_required_cursors|Window_func_runner::exec|Window_funcs_sort::exec
      CS  12.2   opt  240925  b8a77289639a3b10ada64cf892f02b5cecdb1603  SIGSEGV|Item_sum_hybrid_simple::clear|compute_window_func|Window_func_runner::exec|Window_funcs_sort::exec
      ES  10.6   dbg  240925  ed866636069dda51daa8570497926ae43af8aa24  No bug found                  
      ES  10.6   opt  240925  ed866636069dda51daa8570497926ae43af8aa24  No bug found                  
      ES  11.4   dbg  240925  0ddbffaced6c2b50ef4c6e0d8685b1fa25148875  m_alloced_field_count|SIGABRT|Create_tmp_table::start|create_tmp_table|JOIN::create_postjoin_aggr_table|JOIN::make_aggr_tables_info
      ES  11.4   opt  240925  0ddbffaced6c2b50ef4c6e0d8685b1fa25148875  SIGSEGV|Item_field::Item_field|Window_funcs_sort::setup|Window_funcs_computation::setup|JOIN::make_aggr_tables_info
      ES  11.8   dbg  240925  543157202acd67ac9b0bb50e0b35bf7790e5467d  item_sum->fixed()|SIGABRT|add_special_frame_cursors|get_window_functions_required_cursors|Window_func_runner::exec|Window_funcs_sort::exec
      ES  11.8   opt  240925  543157202acd67ac9b0bb50e0b35bf7790e5467d  SIGSEGV|Item_sum_hybrid_simple::clear|compute_window_func|Window_func_runner::exec|Window_funcs_sort::exec
      MDEV-36290 CS 12.2   dbg  240925  c0bd9cdf131412fe26fa96d65e896c86208a3c8b  item_sum->fixed()|SIGABRT|add_special_frame_cursors|get_window_functions_required_cursors|Window_func_runner::exec|Window_funcs_sort::exec
      MDEV-36290 CS 12.2   opt  240925  c0bd9cdf131412fe26fa96d65e896c86208a3c8b  SIGSEGV|Item_sum_hybrid_simple::clear|compute_window_func|Window_func_runner::exec|Window_funcs_sort::exec
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              susil.behera Susil Behera
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.