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

Segmentation fault at /mariadb-11.3.0/sql/item.cc:3493

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 11.3.0
    • N/A
    • Optimizer, Server
    • None
    • Ubuntu 20.04

    Description

      Run these queries in release build:

      CREATE TABLE t0 ( c43 DECIMAL ( 37 ) DEFAULT ( -82 ) , c8 SMALLINT ) ;
      INSERT INTO t0 VALUES ( 21 , DEFAULT ) , ( -49 , DEFAULT ) ;
      CREATE INDEX i0 ON t0 ( c8 ) ;
      INSERT INTO t0 VALUES ( 125 , DEFAULT ) , ( 3633398050108073542 , DEFAULT ) ;
      SELECT t2 . c17 AS c30 FROM ( SELECT FIND_IN_SET ( 128 , -124.648318 ) NOT IN ( LOCATE ( -121 , 'VHVbbfMm
      AE=aiL<JxQP5p0$DjlOtq0ixDe(1mli^Q1$ta.Fc9DO(uYY' ) BETWEEN 108 AND -71 IS NOT NULL ) AS c38 FROM t0 ) AS t1 JOIN ( SELECT c8 AS c17 FROM t0 GROUP BY c8 , c43 HAVING DEGREES ( COUNT( DISTINCT t0 . c43 , 4726291360037131425 ) IS NULL = t0 . c8 ) ) AS t2 ON t2 . c17 = t2 . c17 ;

      Will trigger Segmentation fault.
      GDB info:
      Thread 16 "mariadbd" received signal SIGSEGV, Segmentation fault.
      [Switching to Thread 0x7fffd242e300 (LWP 3072)]
      0x0000000001336f4a in Item_field::used_tables (this=0x629000094a38) at /home/wx/mariadb-11.3.0/sql/item.cc:3493
      3493 if (field->table->const_table)
      (gdb) p field
      $30 = (Field *) 0x0

      #0 0x0000000001336f4a in Item_field::used_tables (this=0x629000094a78) at /home/wx/mariadb-11.3.0/sql/item.cc:3493
      #1 0x0000000000c24337 in update_depend_map_for_order (join=0x6290000c8b40, order=0x629000094d98) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:16571
      #2 remove_const (join=<optimized out>, first_order=<optimized out>, cond=<optimized out>, change_list=<optimized out>, simple_order=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:16696
      #3 0x0000000000c14494 in JOIN::optimize_inner (this=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:2603
      #4 0x0000000000bfc156 in JOIN::optimize (this=0x6290000c8b40) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1944
      #5 0x0000000000a54c76 in mysql_derived_optimize (thd=<optimized out>, lex=0x62b0001703c8, derived=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:1037
      #6 0x0000000000a57cc2 in mysql_handle_single_derived (lex=0x62b0001703c8, derived=derived@entry=0x6290000c4950, phases=phases@entry=4) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:200
      #7 0x0000000000c1312d in JOIN::optimize_inner (this=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:2442
      #8 0x0000000000bfc156 in JOIN::optimize (this=this@entry=0x6290000c6738) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1944
      #9 0x0000000000be4fdf in mysql_select (thd=<optimized out>, thd@entry=0x62b00016c218, tables=<optimized out>, fields=..., conds=<optimized out>, og_num=<optimized out>, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x6290000c6708, unit=0x62b0001704a8, select_lex=0x6290000915a0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:5235
      #10 0x0000000000be4596 in handle_select (thd=thd@entry=0x62b00016c218, lex=<optimized out>, lex@entry=0x62b0001703c8, result=<optimized out>, result@entry=0x6290000c6708, setup_tables_done_option=<optimized out>, setup_tables_done_option@entry=0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:628
      #11 0x0000000000b3df18 in execute_sqlcom_select (thd=0x62b00016c218, all_tables=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:6013
      #12 0x0000000000b2cd51 in mysql_execute_command (thd=0x62b00016c218, is_called_from_prepared_stmt=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:3912
      #13 0x0000000000b1fe79 in mysql_parse (thd=thd@entry=0x62b00016c218, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, parser_state@entry=0x7fffd1c15a80) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:7734
      #14 0x0000000000b19069 in dispatch_command (command=<optimized out>, thd=0x62b00016c218, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1893
      #15 0x0000000000b20b71 in do_command (thd=0x62b00016c218, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1406
      #16 0x0000000000f03476 in do_handle_one_connection (connect=<optimized out>, put_in_cache=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1445
      #17 0x0000000000f02eb9 in handle_one_connection (arg=arg@entry=0x6080019745b8) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1347
      #18 0x0000000001a00c1b in pfs_spawn_thread (arg=0x617000005498) at /home/wx/mariadb-11.3.0/storage/perfschema/pfs.cc:2201
      #19 0x00007ffff79f7609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
      #20 0x00007ffff770f133 in clone () from /lib/x86_64-linux-gnu/libc.so.6

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Xin Wen Xin Wen
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.