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

SIGSEGV, SIGABRT and SIGILL in typeinfo for Item_func_set_collation (on optimized builds)

    XMLWordPrintable

    Details

      Description

      USE test;
      CREATE TABLE t1(a DATETIME);
      CREATE TABLE t2(a VARCHAR(20));
      SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2);
      

      Leads to:

      10.5.6 1c587481966abc7a9ad5309d0a91ca920f7a5657 (Debug)

      200822 17:22:32 [ERROR] mysqld got signal 4 ;
      

      10.5.6 1c587481966abc7a9ad5309d0a91ca920f7a5657 (Debug)

      Core was generated by `/test/MD110820-mariadb-10.5.6-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      [Current thread is 1 (Thread 0x14d09f455700 (LWP 1619580))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000055690b534b86 in my_write_core (sig=sig@entry=11) at /test/10.5_dbg/mysys/stacktrace.c:519
      #2  0x000055690acebd7b in handle_fatal_signal (sig=11) at /test/10.5_dbg/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  0x000055690c151ef0 in typeinfo for Item_func_set_collation ()
      #5  0x000055690add6a69 in Item_singlerow_subselect::reset (this=0x14d07b475cd0) at /test/10.5_dbg/sql/item_subselect.cc:1167
      #6  0x000055690add6b14 in Item_singlerow_subselect::bring_value (this=0x14d07b475cd0) at /test/10.5_dbg/sql/item_subselect.cc:1350
      #7  0x000055690ad33e41 in Arg_comparator::compare_e_row (this=0x14d07b477840) at /test/10.5_dbg/sql/item_cmpfunc.cc:1112
      #8  0x000055690ad3608f in Arg_comparator::compare (this=0x14d07b477840) at /test/10.5_dbg/sql/item_cmpfunc.h:102
      #9  Item_func_equal::val_int (this=0x14d07b477770) at /test/10.5_dbg/sql/item_cmpfunc.cc:1791
      #10 0x000055690ac27925 in Type_handler::Item_send_long (this=<optimized out>, item=0x14d07b477770, protocol=0x14d07b415650, buf=<optimized out>) at /test/10.5_dbg/sql/sql_type.cc:7330
      #11 0x000055690ac2f10f in Type_handler_long::Item_send (this=<optimized out>, item=<optimized out>, protocol=<optimized out>, buf=<optimized out>) at /test/10.5_dbg/sql/sql_type.h:5494
      #12 0x000055690a94f5c5 in Item::send (this=0x14d07b477770, protocol=0x14d07b415650, buffer=0x14d09f453070) at /test/10.5_dbg/sql/item.h:1060
      #13 0x000055690a94c65f in Protocol::send_result_set_row (this=this@entry=0x14d07b415650, row_items=row_items@entry=0x14d07b4742e0) at /test/10.5_dbg/sql/protocol.cc:1092
      #14 0x000055690a9df59a in select_send::send_data (this=0x14d07b478378, items=@0x14d07b4742e0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d07b4779b0, last = 0x14d07b4779b0, elements = 1}, <No data fields>}) at /test/10.5_dbg/sql/sql_class.cc:3018
      #15 0x000055690aabd36d in select_result_sink::send_data_with_check (sent=0, u=<optimized out>, items=<optimized out>, this=<optimized out>) at /test/10.5_dbg/sql/sql_class.h:5303
      #16 JOIN::exec_inner (this=this@entry=0x14d07b4783a0) at /test/10.5_dbg/sql/sql_select.cc:4318
      #17 0x000055690aabe14d in JOIN::exec (this=this@entry=0x14d07b4783a0) at /test/10.5_dbg/sql/sql_select.cc:4231
      #18 0x000055690aabc449 in mysql_select (thd=thd@entry=0x14d07b415088, tables=<optimized out>, fields=@0x14d07b4742e0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d07b4779b0, last = 0x14d07b4779b0, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14d07b478378, unit=0x14d07b4190a0, select_lex=0x14d07b474190) at /test/10.5_dbg/sql/sql_select.cc:4655
      #19 0x000055690aabc778 in handle_select (thd=thd@entry=0x14d07b415088, lex=lex@entry=0x14d07b418fd8, result=result@entry=0x14d07b478378, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
      #20 0x000055690aa44d72 in execute_sqlcom_select (thd=thd@entry=0x14d07b415088, all_tables=0x14d07b474dd8) at /test/10.5_dbg/sql/sql_parse.cc:6210
      #21 0x000055690aa3de46 in mysql_execute_command (thd=thd@entry=0x14d07b415088) at /test/10.5_dbg/sql/sql_parse.cc:3932
      #22 0x000055690aa4ad4e in mysql_parse (thd=thd@entry=0x14d07b415088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d09f454350, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7994
      #23 0x000055690aa3777e in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d07b415088, packet=packet@entry=0x14d07b467089 "", packet_length=packet_length@entry=68, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1867
      #24 0x000055690aa35f58 in do_command (thd=0x14d07b415088) at /test/10.5_dbg/sql/sql_parse.cc:1348
      #25 0x000055690ab92bc9 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14d07e4d0808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1410
      #26 0x000055690ab932e5 in handle_one_connection (arg=arg@entry=0x14d07e4d0808) at /test/10.5_dbg/sql/sql_connect.cc:1312
      #27 0x000055690aff9572 in pfs_spawn_thread (arg=0x14d09c046508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #28 0x000014d09e3ce6db in start_thread (arg=0x14d09f455700) at pthread_create.c:463
      #29 0x000014d09d7cca3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.5.6 1c587481966abc7a9ad5309d0a91ca920f7a5657 (Optimized)

      Core was generated by `/test/MD110820-mariadb-10.5.6-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      [Current thread is 1 (Thread 0x14631d1ea700 (LWP 1623877))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x0000558683796267 in my_write_core (sig=sig@entry=11) at /test/10.5_opt/mysys/stacktrace.c:519
      #2  0x000055868316514a in handle_fatal_signal (sig=11) at /test/10.5_opt/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  0x00005586841d0c68 in typeinfo for Item_func_set_collation ()
      #5  0x0000558683214243 in Item_singlerow_subselect::reset (this=0x1462f9448c60) at /test/10.5_opt/sql/item_subselect.cc:1167
      #6  Item_singlerow_subselect::bring_value (this=0x1462f9448c60) at /test/10.5_opt/sql/item_subselect.cc:1350
      #7  0x0000558683196c9f in Arg_comparator::compare_e_row (this=0x1462f944a7d0) at /test/10.5_opt/sql/item_cmpfunc.cc:1112
      #8  0x0000558683196e7b in Arg_comparator::compare (this=<optimized out>) at /test/10.5_opt/sql/item_cmpfunc.h:102
      #9  Item_func_equal::val_int (this=<optimized out>) at /test/10.5_opt/sql/item_cmpfunc.cc:1791
      #10 0x00005586830cb869 in Type_handler::Item_send_long (this=<optimized out>, item=0x1462f944a700, protocol=0x1462f9412558, buf=<optimized out>) at /test/10.5_opt/sql/sql_type.cc:7330
      #11 0x0000558682eb5d28 in Protocol::send_result_set_row (this=this@entry=0x1462f9412558, row_items=row_items@entry=0x1462f9447270) at /test/10.5_opt/sql/protocol.cc:1092
      #12 0x0000558682f236f2 in select_send::send_data (this=0x1462f944b308, items=@0x1462f9447270: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1462f944a940, last = 0x1462f944a940, elements = 1}, <No data fields>}) at /test/10.5_opt/sql/sql_class.cc:3018
      #13 0x0000558682fcc6e2 in select_result_sink::send_data_with_check (sent=0, u=<optimized out>, items=<optimized out>, this=<optimized out>) at /test/10.5_opt/sql/sql_class.h:5300
      #14 JOIN::exec_inner (this=this@entry=0x1462f944b330) at /test/10.5_opt/sql/sql_select.cc:4318
      #15 0x0000558682fcc877 in JOIN::exec (this=this@entry=0x1462f944b330) at /test/10.5_opt/sql/sql_select.cc:4231
      #16 0x0000558682fcaba2 in mysql_select (thd=thd@entry=0x1462f9412018, tables=0x0, fields=@0x1462f9447270: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1462f944a940, last = 0x1462f944a940, elements = 1}, <No data fields>}, conds=0x0, og_num=<optimized out>, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x1462f944b308, unit=0x1462f9415e70, select_lex=0x1462f9447120) at /test/10.5_opt/sql/sql_select.cc:4655
      #17 0x0000558682fcb561 in handle_select (thd=thd@entry=0x1462f9412018, lex=lex@entry=0x1462f9415da8, result=result@entry=0x1462f944b308, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_opt/sql/sql_select.cc:417
      #18 0x0000558682f71b81 in execute_sqlcom_select (thd=thd@entry=0x1462f9412018, all_tables=0x1462f9447d68) at /test/10.5_opt/sql/sql_parse.cc:6210
      #19 0x0000558682f6e251 in mysql_execute_command (thd=thd@entry=0x1462f9412018) at /test/10.5_opt/sql/sql_parse.cc:3932
      #20 0x0000558682f74cbc in mysql_parse (thd=0x1462f9412018, rawbuf=<optimized out>, length=68, parser_state=0x14631d1e9430, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /test/10.5_opt/sql/sql_parse.cc:7994
      #21 0x0000558682f69f85 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1462f9412018, packet=packet@entry=0x1462f943a019 "", packet_length=packet_length@entry=68, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_opt/sql/sql_parse.cc:1867
      #22 0x0000558682f682b4 in do_command (thd=0x1462f9412018) at /test/10.5_opt/sql/sql_parse.cc:1348
      #23 0x000055868305e001 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14631a0338f8, put_in_cache=put_in_cache@entry=true) at /test/10.5_opt/sql/sql_connect.cc:1410
      #24 0x000055868305e364 in handle_one_connection (arg=arg@entry=0x14631a0338f8) at /test/10.5_opt/sql/sql_connect.cc:1312
      #25 0x00005586833cf5da in pfs_spawn_thread (arg=0x14631a04f218) at /test/10.5_opt/storage/perfschema/pfs.cc:2201
      #26 0x000014631c1636db in start_thread (arg=0x14631d1ea700) at pthread_create.c:463
      #27 0x000014631b561a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.25 (dbg), 10.3.25 (opt), 10.4.15 (dbg), 10.4.15 (opt), 10.5.6 (dbg), 10.5.6 (opt)

      Bug confirmed not present in:
      MariaDB: 10.1.47 (dbg), 10.1.47 (opt), 10.2.34 (dbg), 10.2.34 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

      10.2.34 (Optimized)

      10.2.34>USE test;
      Database changed
      10.2.34>CREATE TABLE t1(a DATETIME);
      Query OK, 0 rows affected (0.03 sec)
      10.2.34>CREATE TABLE t2(a VARCHAR(20));
      Query OK, 0 rows affected (0.01 sec)
      10.2.34>SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2);
      +---------------------------------------------------------------+
      | (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2) |
      +---------------------------------------------------------------+
      |                                                             1 |
      +---------------------------------------------------------------+
      1 row in set (0.00 sec)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: