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

SIGSEGV in spider_db_open_item_field and SIGSEGV spider_db_print_item_type, on SELECT

    XMLWordPrintable

    Details

      Description

      INSTALL PLUGIN spider SONAME 'ha_spider.so';
      CREATE USER spider@localhost IDENTIFIED BY 'PWD1';
      CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS(SOCKET '../socket.sock',DATABASE 'test',USER 'spider',PASSWORD 'PWD1');
      CREATE TABLE t(c INT);
      CREATE TABLE b(d INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
      SELECT TRIM(LEADING 'c' FROM d) FROM b;
      

      Leads to:

      10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Optimized)

      Core was generated by `/test/MD190822-mariadb-10.11.0-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x0000152265b4ec61 in spider_db_open_item_field (
          item_field=<optimized out>, spider=<optimized out>, str=0x152224062650, 
          alias=<optimized out>, alias_length=<optimized out>, dbton_id=0, 
          use_fields=true, fields=0x1522240078a0)
          at /test/10.11_opt/storage/spider/spd_db_conn.cc:7742
      [Current thread is 1 (Thread 0x152265c47700 (LWP 1308466))]
      (gdb) bt
      #0  0x0000152265b4ec61 in spider_db_open_item_field (item_field=<optimized out>, spider=<optimized out>, str=0x152224062650, alias=<optimized out>, alias_length=<optimized out>, dbton_id=0, use_fields=true, fields=0x1522240078a0) at /test/10.11_opt/storage/spider/spd_db_conn.cc:7742
      #1  0x0000152265bae7ca in spider_db_mbase_util::open_item_func (this=0x152265bfcae0 <spider_db_mysql_utility>, item_func=0x152224010de0, spider=0x15222404b5c0, str=0x152224062650, alias=0x0, alias_length=0, use_fields=true, fields=0x1522240078a0) at /test/10.11_opt/storage/spider/spd_db_mysql.cc:5727
      #2  0x0000152265bc0f47 in spider_mbase_handler::append_list_item_select (this=0x1522240625f0, select=<optimized out>, str=0x152224062650, alias=0x0, alias_length=0, use_fields=true, fields=0x1522240078a0) at /test/10.11_opt/storage/spider/spd_db_mysql.cc:15555
      #3  0x0000152265bc46f8 in spider_group_by_handler::init_scan (this=0x55886577d760) at /test/10.11_opt/storage/spider/spd_group_by_handler.cc:1301
      #4  0x0000558862e2267d in Pushdown_query::execute (this=0x1522240142b8, join=join@entry=0x152224012088) at /test/10.11_opt/sql/group_by_handler.cc:49
      #5  0x0000558862e045d5 in do_select (procedure=<optimized out>, join=0x152224012088) at /test/10.11_opt/sql/sql_select.cc:21206
      #6  JOIN::exec_inner (this=0x152224012088) at /test/10.11_opt/sql/sql_select.cc:4812
      #7  0x0000558862e04f68 in JOIN::exec (this=this@entry=0x152224012088) at /test/10.11_opt/sql/sql_select.cc:4590
      #8  0x0000558862e03171 in mysql_select (thd=0x152224000c58, tables=0x152224010f60, fields=@0x152224010a68: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x152224010ec8, last = 0x152224010ec8, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x152224012060, unit=0x152224004cd0, select_lex=0x1522240107c8) at /test/10.11_opt/sql/sql_select.cc:5070
      #9  0x0000558862e038b7 in handle_select (thd=thd@entry=0x152224000c58, lex=lex@entry=0x152224004bf8, result=result@entry=0x152224012060, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_opt/sql/sql_select.cc:581
      #10 0x0000558862d855b1 in execute_sqlcom_select (thd=0x152224000c58, all_tables=0x152224010f60) at /test/10.11_opt/sql/sql_parse.cc:6261
      #11 0x0000558862d931f8 in mysql_execute_command (thd=0x152224000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:3945
      #12 0x0000558862d807b5 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x152224000c58) at /test/10.11_opt/sql/sql_parse.cc:8035
      #13 mysql_parse (thd=0x152224000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.11_opt/sql/sql_parse.cc:7957
      #14 0x0000558862d8c2ca in dispatch_command (command=COM_QUERY, thd=0x152224000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.11_opt/sql/sql_class.h:1339
      #15 0x0000558862d8e1f2 in do_command (thd=0x152224000c58, blocking=blocking@entry=true) at /test/10.11_opt/sql/sql_parse.cc:1407
      #16 0x0000558862ea646f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x558865a647e8, put_in_cache=put_in_cache@entry=true) at /test/10.11_opt/sql/sql_connect.cc:1418
      #17 0x0000558862ea674d in handle_one_connection (arg=0x558865a647e8) at /test/10.11_opt/sql/sql_connect.cc:1312
      #18 0x000015227ee8a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #19 0x000015227ea76133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Debug)

      Core was generated by `/test/MD190822-mariadb-10.11.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  spider_db_open_item_field (item_field=item_field@entry=0x1456200141e8, 
          spider=spider@entry=0x1456200610f0, str=str@entry=0x14562009b3c0, 
          alias=alias@entry=0x0, alias_length=alias_length@entry=0, 
          dbton_id=dbton_id@entry=0, use_fields=true, fields=0x1456200cd580)
          at /test/10.11_dbg/storage/spider/spd_db_conn.cc:7742
      [Current thread is 1 (Thread 0x1456740ad700 (LWP 1308530))]
      (gdb) bt
      #0  spider_db_open_item_field (item_field=item_field@entry=0x1456200141e8, spider=spider@entry=0x1456200610f0, str=str@entry=0x14562009b3c0, alias=alias@entry=0x0, alias_length=alias_length@entry=0, dbton_id=dbton_id@entry=0, use_fields=true, fields=0x1456200cd580) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:7742
      #1  0x000014566810965a in spider_db_print_item_type (item=item@entry=0x1456200141e8, field=field@entry=0x0, spider=spider@entry=0x1456200610f0, str=str@entry=0x14562009b3c0, alias=alias@entry=0x0, alias_length=alias_length@entry=0, dbton_id=0, use_fields=true, fields=0x1456200cd580) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:7388
      #2  0x0000145668192ed2 in spider_db_mbase_util::open_item_func (this=0x1456681f9150 <spider_db_mysql_utility>, item_func=0x145620014300, spider=0x1456200610f0, str=0x14562009b3c0, alias=0x0, alias_length=0, use_fields=true, fields=0x1456200cd580) at /test/10.11_dbg/storage/spider/spd_db_mysql.cc:5727
      #3  0x0000145668108081 in spider_db_open_item_func (item_func=item_func@entry=0x145620014300, spider=spider@entry=0x1456200610f0, str=str@entry=0x14562009b3c0, alias=alias@entry=0x0, alias_length=alias_length@entry=0, dbton_id=dbton_id@entry=0, use_fields=true, fields=0x1456200cd580) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:7548
      #4  0x00001456681095d9 in spider_db_print_item_type (item=item@entry=0x145620014300, field=field@entry=0x0, spider=0x1456200610f0, str=str@entry=0x14562009b3c0, alias=alias@entry=0x0, alias_length=alias_length@entry=0, dbton_id=0, use_fields=true, fields=0x1456200cd580) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:7379
      #5  0x00001456681acf1d in spider_mbase_handler::append_list_item_select (this=this@entry=0x14562009b360, select=select@entry=0x145620015940, str=str@entry=0x14562009b3c0, alias=alias@entry=0x0, alias_length=alias_length@entry=0, use_fields=use_fields@entry=true, fields=0x1456200cd580) at /test/10.11_dbg/storage/spider/spd_db_mysql.cc:15555
      #6  0x00001456681ad024 in spider_mbase_handler::append_list_item_select_part (this=0x14562009b360, select=0x145620015940, alias=0x0, alias_length=0, use_fields=<optimized out>, fields=0x1456200cd580, sql_type=1) at /test/10.11_dbg/storage/spider/spd_db_mysql.cc:15526
      #7  0x00001456681b2e2c in spider_group_by_handler::init_scan (this=0x1456200e5c00) at /test/10.11_dbg/storage/spider/spd_group_by_handler.cc:1301
      #8  0x0000559c99916685 in Pushdown_query::execute (this=0x1456200178e8, join=join@entry=0x1456200155a8) at /test/10.11_dbg/sql/group_by_handler.cc:49
      #9  0x0000559c998e9399 in do_select (procedure=<optimized out>, join=0x1456200155a8) at /test/10.11_dbg/sql/sql_select.cc:21206
      #10 JOIN::exec_inner (this=this@entry=0x1456200155a8) at /test/10.11_dbg/sql/sql_select.cc:4812
      #11 0x0000559c998e9e28 in JOIN::exec (this=this@entry=0x1456200155a8) at /test/10.11_dbg/sql/sql_select.cc:4590
      #12 0x0000559c998e7bac in mysql_select (thd=thd@entry=0x145620000db8, tables=0x145620014480, fields=@0x145620013f88: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1456200143e8, last = 0x1456200143e8, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0x145620015580, unit=0x145620004ff0, select_lex=0x145620013ce8) at /test/10.11_dbg/sql/sql_select.cc:5070
      #13 0x0000559c998e83a2 in handle_select (thd=thd@entry=0x145620000db8, lex=lex@entry=0x145620004f18, result=result@entry=0x145620015580, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_dbg/sql/sql_select.cc:581
      #14 0x0000559c998525a6 in execute_sqlcom_select (thd=thd@entry=0x145620000db8, all_tables=0x145620014480) at /test/10.11_dbg/sql/sql_parse.cc:6261
      #15 0x0000559c9985e8c7 in mysql_execute_command (thd=thd@entry=0x145620000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:3945
      #16 0x0000559c9984c882 in mysql_parse (thd=thd@entry=0x145620000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1456740ac330) at /test/10.11_dbg/sql/sql_parse.cc:8035
      #17 0x0000559c99859e6a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x145620000db8, packet=packet@entry=0x14562000b6e9 "", packet_length=packet_length@entry=38, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1339
      #18 0x0000559c9985c574 in do_command (thd=0x145620000db8, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
      #19 0x0000559c999be1da in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559c9bbe0038, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1418
      #20 0x0000559c999be6e3 in handle_one_connection (arg=0x559c9bbe0038) at /test/10.11_dbg/sql/sql_connect.cc:1312
      #21 0x000014568d527609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #22 0x000014568d113133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (dbg), 10.5.18 (opt), 10.6.10 (dbg), 10.6.10 (opt), 10.7.6 (dbg), 10.7.6 (opt), 10.8.5 (dbg), 10.8.5 (opt), 10.9.2 (dbg), 10.9.2 (opt), 10.10.2 (dbg), 10.10.2 (opt), 10.11.0 (dbg), 10.11.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)

        Attachments

          Activity

            People

            Assignee:
            nayuta-yanagisawa Nayuta Yanagisawa
            Reporter:
            Roel Roel Van de Paar
            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.