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

SIGSEGV in spider_db_ping on INSERT

    XMLWordPrintable

Details

    Description

      Whilst the bug here comes close to MDEV-29583, there are some differences, so logging as a separate issue.
      Possibly also related/similar to MDEV-28683.

      SET sql_mode='';
      INSTALL PLUGIN Spider SONAME 'ha_spider.so';
      CREATE USER Spider@localhost IDENTIFIED BY 'PWD0';
      CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET '../socket.sock',DATABASE 'test',user 'Spider',PASSWORD 'PWD0');
      CREATE TABLE t (a INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
      SET GLOBAL init_connect='dummy';
      CREATE TABLE t0 (a INT) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
      XA START 'a';
      INSERT INTO t VALUES (1);
      SHOW CREATE TABLE t0;
      SELECT * FROM t0 JOIN t0 a ON a=a;
      INSERT INTO t0 VALUES (1);
      

      Leads to:

      10.11.0 6ebdd3013a18b01dbecec76b870810329eb76586 (Debug)

      Core was generated by `/test/MD190922-mariadb-10.11.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x00001489425226ca in spider_db_ping (spider=0x1488f40df140, 
          conn=conn@entry=0x1488f408b3b8, link_idx=0)
          at /test/10.11_dbg/storage/spider/spd_db_conn.cc:230
      [Current thread is 1 (Thread 0x148942675700 (LWP 1672792))]
      (gdb) bt
      #0  0x00001489425226ca in spider_db_ping (spider=0x1488f40df140, conn=conn@entry=0x1488f408b3b8, link_idx=0) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:230
      #1  0x000014894252292b in spider_db_conn_queue_action (conn=conn@entry=0x1488f408b3b8) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:277
      #2  0x000014894252afa5 in spider_db_before_query (conn=conn@entry=0x1488f408b3b8, need_mon=need_mon@entry=0x1488f40d2590) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:586
      #3  0x000014894252b701 in spider_db_set_names_internal (trx=0x1488f404c6c8, share=0x1488f40ae048, conn=conn@entry=0x1488f408b3b8, all_link_idx=0, need_mon=0x1488f40d2590) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:813
      #4  0x000014894252ba5d in spider_db_set_names (spider=spider@entry=0x1488f40ad500, conn=conn@entry=0x1488f408b3b8, link_idx=link_idx@entry=0) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:857
      #5  0x0000148942532cfd in spider_db_bulk_insert (spider=spider@entry=0x1488f40ad500, table=0x1488f40acce8, copy_info=copy_info@entry=0x1488f40ad8f0, bulk_end=bulk_end@entry=false) at /test/10.11_dbg/storage/spider/spd_db_conn.cc:5505
      #6  0x00001489425abfb4 in ha_spider::write_row (this=0x1488f40ad500, buf=0x1488f40ad0e8 "\375\001") at /test/10.11_dbg/storage/spider/ha_spider.cc:7997
      #7  0x00005557c1dfd2ff in handler::ha_write_row (this=0x1488f40ad500, buf=0x1488f40ad0e8 "\375\001") at /test/10.11_dbg/sql/handler.cc:7576
      #8  0x00005557c1ab924a in write_record (thd=thd@entry=0x1488f4000d48, table=table@entry=0x1488f40acce8, info=info@entry=0x148942673b20, sink=sink@entry=0x0) at /test/10.11_dbg/sql/sql_insert.cc:2191
      #9  0x00005557c1ac4885 in mysql_insert (thd=thd@entry=0x1488f4000d48, table_list=<optimized out>, fields=@0x1488f4005e38: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5557c30d0be0 <end_of_list>, last = 0x1488f4005e38, elements = 0}, <No data fields>}, values_list=@0x1488f4005e80: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1488f4013ee8, last = 0x1488f4013ee8, elements = 1}, <No data fields>}, update_fields=@0x1488f4005e68: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5557c30d0be0 <end_of_list>, last = 0x1488f4005e68, elements = 0}, <No data fields>}, update_values=@0x1488f4005e50: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5557c30d0be0 <end_of_list>, last = 0x1488f4005e50, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0) at /test/10.11_dbg/sql/sql_insert.cc:1146
      #10 0x00005557c1b07aa0 in mysql_execute_command (thd=thd@entry=0x1488f4000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:4563
      #11 0x00005557c1af403c in mysql_parse (thd=thd@entry=0x1488f4000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x148942674330) at /test/10.11_dbg/sql/sql_parse.cc:8037
      #12 0x00005557c1b0166d in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1488f4000d48, packet=packet@entry=0x1488f400aed9 "INSERT INTO t0 VALUES (1)", packet_length=packet_length@entry=25, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1345
      #13 0x00005557c1b03d97 in do_command (thd=0x1488f4000d48, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
      #14 0x00005557c1c67fb9 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5557c49a7fa8, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1416
      #15 0x00005557c1c684c3 in handle_one_connection (arg=0x5557c49a7fa8) at /test/10.11_dbg/sql/sql_connect.cc:1318
      #16 0x000014895f157609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #17 0x000014895ed43133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

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

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.27 (opt), 10.5.18 (opt), 10.6.10 (opt), 10.7.6 (opt), 10.8.5 (opt), 10.9.3 (opt), 10.10.2 (opt), 10.11.0 (opt)
      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

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.