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

Various SIGSEGV crashes on optimized builds which may be masked, or fixed, by recent changes related to max_sort_length

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.1, 10.2, 10.3, 10.4, 10.5
    • N/A
    • Optimizer
    • None

    Description

      I found various other testcases, related to small max_sort_length settings, which crash older optimized builds, but not the most recent ones. This is likely due to the changes in this area. I just want to make sure that these bugs are not 'masked' somehow by changes while they are still present underneath (even if masked), and could then potentially be triggered in other ways. Please use the older revisions as listed to reproduce if required. We can discuss further online. Feel free to close if it is certain these are fixed by the recent changes also.

      USE test;
      SET SQL_MODE='';
      CREATE TABLE t (c1 DECIMAL UNSIGNED ZEROFILL,c2 DECIMAL(65) UNSIGNED,c3 VARCHAR(255) BINARY CHARACTER SET 'latin1' COLLATE 'latin1_bin') ENGINE=MEMORY;
      INSERT INTO t VALUES ('a','a','a');
      set max_sort_length=5;
      INSERT INTO t VALUES (29,5,NULL);
      INSERT INTO t SELECT * FROM t;
      SELECT * FROM t WHERE c1 >= '00:00:00' ORDER BY c1,c2 LIMIT 2;
      

      Leads to:

      10.5.4 6877ef9a7c9c7ee55d67e4baaf4e8f7b874c9f89

      Core was generated by `/test/MD060620-mariadb-10.5.4-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 0x14bd2af14700 (LWP 2493781))]
      (gdb) bt
      (gdb) (gdb) #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000055a5f3a44927 in my_write_core (sig=sig@entry=11) at /test/10.5_opt/mysys/stacktrace.c:518
      #2  0x000055a5f341033a in handle_fatal_signal (sig=11) at /test/10.5_opt/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  0x000055a5f371f98b in heap_rrnd (info=0x14bd064a1318, record=0x14bd0645f038 "\377\200", pos=0x14bd05000000 <error: Cannot access memory at address 0x14bd05000000>) at /test/10.5_opt/storage/heap/hp_rrnd.c:40
      #5  0x000055a5f3415922 in handler::ha_rnd_pos (this=0x14bd0646ea30, buf=0x14bd0645f038 "\377\200", pos=0x14bd06450328 "") at /test/10.5_opt/sql/handler.cc:3021
      #6  0x000055a5f3544ae8 in rr_from_pointers (info=0x14bd0644b000) at /test/10.5_opt/sql/records.cc:607
      #7  0x000055a5f3255e07 in sub_select (join=0x14bd06448ee8, join_tab=0x14bd0644af38, end_of_records=false) at /test/10.5_opt/sql/sql_select.cc:20626
      #8  0x000055a5f32774ee in do_select (procedure=<optimized out>, join=0x14bd06448ee8) at /test/10.5_opt/sql/sql_select.cc:20163
      #9  JOIN::exec_inner (this=this@entry=0x14bd06448ee8) at /test/10.5_opt/sql/sql_select.cc:4475
      #10 0x000055a5f3277927 in JOIN::exec (this=this@entry=0x14bd06448ee8) at /test/10.5_opt/sql/sql_select.cc:4256
      #11 0x000055a5f3275c72 in mysql_select (thd=thd@entry=0x14bd06412018, tables=0x14bd06447708, fields=@0x14bd06447260: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14bd064476c0, last = 0x14bd06449888, elements = 3}, <No data fields>}, conds=0x14bd06447ff0, og_num=<optimized out>, order=0x14bd06448ba8, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14bd06448ec0, unit=0x14bd06415e70, select_lex=0x14bd06447110) at /test/10.5_opt/sql/sql_select.cc:4680
      #12 0x000055a5f3276631 in handle_select (thd=thd@entry=0x14bd06412018, lex=lex@entry=0x14bd06415da8, result=result@entry=0x14bd06448ec0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_opt/sql/sql_select.cc:417
      #13 0x000055a5f321d081 in execute_sqlcom_select (thd=thd@entry=0x14bd06412018, all_tables=0x14bd06447708) at /test/10.5_opt/sql/sql_parse.cc:6208
      #14 0x000055a5f32197b1 in mysql_execute_command (thd=thd@entry=0x14bd06412018) at /test/10.5_opt/sql/sql_parse.cc:3939
      #15 0x000055a5f322019c in mysql_parse (thd=0x14bd06412018, rawbuf=<optimized out>, length=61, parser_state=0x14bd2af13430, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /test/10.5_opt/sql/sql_parse.cc:7992
      #16 0x000055a5f3215485 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14bd06412018, packet=packet@entry=0x14bd0643a019 "", packet_length=packet_length@entry=61, 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:1874
      #17 0x000055a5f3213874 in do_command (thd=0x14bd06412018) at /test/10.5_opt/sql/sql_parse.cc:1355
      #18 0x000055a5f3308e51 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14bd27c33958, put_in_cache=put_in_cache@entry=true) at /test/10.5_opt/sql/sql_connect.cc:1411
      #19 0x000055a5f33091b4 in handle_one_connection (arg=arg@entry=0x14bd27c33958) at /test/10.5_opt/sql/sql_connect.cc:1313
      #20 0x000055a5f36768ca in pfs_spawn_thread (arg=0x14bd27c4e818) at /test/10.5_opt/storage/perfschema/pfs.cc:2201
      #21 0x000014bd29e8d6db in start_thread (arg=0x14bd2af14700) at pthread_create.c:463
      #22 0x000014bd2928b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.1.46 (dbg), 10.1.46 (opt), 10.2.33 (dbg), 10.2.33 (opt), 10.3.24 (dbg), 10.3.24 (opt), 10.4.14 (dbg), 10.4.14 (opt), 10.5.4 (dbg), 10.5.4 (opt)

      Bug confirmed not present in:
      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)

      Does not reproduce on 10.5.4 07d1c8567cbfe94398a9857c47fb9919cad42651

      Attachments

        Issue Links

          Activity

            People

              varun Varun Gupta (Inactive)
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.