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

Assertion `m_next_rec_ptr >= m_rawmem' failed in Filesort_buffer::spaceleft | SIGSEGV in __memmove_avx_unaligned_erms from my_b_write

    XMLWordPrintable

    Details

      Description

      SET @@SESSION.tmp_table_size=1048576;
      SET @@SESSION.max_sort_length=5;
      SET @@SESSION.sort_buffer_size=1024;
      SET @@SESSION.max_length_for_sort_data=66556;
      SELECT * FROM information_schema.session_variables ORDER BY variable_name;
      

      Leads to:

      10.5.3 98003440c2f8d20164a191ced1b7d92b283bb68f

      mysqld: /test/10.5_dbg/sql/filesort_utils.h:139: size_t Filesort_buffer::spaceleft() const: Assertion `m_next_rec_ptr >= m_rawmem' failed.
      

      10.5.3 98003440c2f8d20164a191ced1b7d92b283bb68f

      Core was generated by `/test/MD210420-mariadb-10.5.3-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      [Current thread is 1 (Thread 0x7fea995b2700 (LWP 768694))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x0000561f1603e03d in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
      #2  0x0000561f157e3d7b in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:329
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x00007fea97cf6801 in __GI_abort () at abort.c:79
      #6  0x00007fea97ce639a in __assert_fail_base (fmt=0x7fea97e6d7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x561f163447a6 "m_next_rec_ptr >= m_rawmem", file=file@entry=0x561f16344d48 "/test/10.5_dbg/sql/filesort_utils.h", line=line@entry=139, function=function@entry=0x561f163457c0 <Filesort_buffer::spaceleft() const::__PRETTY_FUNCTION__> "size_t Filesort_buffer::spaceleft() const") at assert.c:92
      #7  0x00007fea97ce6412 in __GI___assert_fail (assertion=assertion@entry=0x561f163447a6 "m_next_rec_ptr >= m_rawmem", file=file@entry=0x561f16344d48 "/test/10.5_dbg/sql/filesort_utils.h", line=line@entry=139, function=function@entry=0x561f163457c0 <Filesort_buffer::spaceleft() const::__PRETTY_FUNCTION__> "size_t Filesort_buffer::spaceleft() const") at assert.c:101
      #8  0x0000561f157e24c8 in Filesort_buffer::spaceleft (this=0x7fea6c1a1200) at /test/10.5_dbg/sql/filesort_utils.h:139
      #9  Filesort_buffer::isfull (this=0x7fea6c1a1200) at /test/10.5_dbg/sql/filesort_utils.h:153
      #10 SORT_INFO::isfull (this=0x7fea6c1a1200) at /test/10.5_dbg/sql/filesort.h:166
      #11 find_all_keys (found_rows=0x7fea6c1a13f0, pq=0x0, tempfile=0x7fea995afc80, buffpek_pointers=0x7fea995afdf0, fs_info=0x7fea6c1a1200, select=0x7fea6c077a58, param=0x7fea995afbe0, thd=0x7fea6c015088) at /test/10.5_dbg/sql/filesort.cc:943
      #12 filesort (thd=thd@entry=0x7fea6c015088, table=table@entry=0x7fea6c0800a0, filesort=filesort@entry=0x7fea6c077c28, tracker=0x7fea6c078318, join=join@entry=0x7fea6c075b38, first_table_bit=<optimized out>) at /test/10.5_dbg/sql/filesort.cc:356
      #13 0x0000561f1558f009 in create_sort_index (thd=0x7fea6c015088, join=0x7fea6c075b38, tab=tab@entry=0x7fea6c077118, fsort=0x7fea6c077c28, fsort@entry=0x0) at /test/10.5_dbg/sql/sql_select.cc:23861
      #14 0x0000561f1558f338 in st_join_table::sort_table (this=this@entry=0x7fea6c077118) at /test/10.5_dbg/sql/sql_select.cc:21590
      #15 0x0000561f1558f46c in join_init_read_record (tab=0x7fea6c077118) at /test/10.5_dbg/sql/sql_select.cc:21529
      #16 0x0000561f1557fd97 in sub_select (join=0x7fea6c075b38, join_tab=0x7fea6c077118, end_of_records=<optimized out>) at /test/10.5_dbg/sql/sql_select.cc:20603
      #17 0x0000561f155b7b28 in do_select (procedure=0x0, join=0x7fea6c075b38) at /test/10.5_dbg/sql/sql_select.cc:20140
      #18 JOIN::exec_inner (this=this@entry=0x7fea6c075b38) at /test/10.5_dbg/sql/sql_select.cc:4464
      #19 0x0000561f155b8143 in JOIN::exec (this=this@entry=0x7fea6c075b38) at /test/10.5_dbg/sql/sql_select.cc:4245
      #20 0x0000561f155b6458 in mysql_select (thd=thd@entry=0x7fea6c015088, tables=<optimized out>, fields=..., conds=0x0, og_num=1, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x7fea6c075b10, unit=0x7fea6c019098, select_lex=0x7fea6c074198) at /test/10.5_dbg/sql/sql_select.cc:4669
      #21 0x0000561f155b6787 in handle_select (thd=thd@entry=0x7fea6c015088, lex=lex@entry=0x7fea6c018fd0, result=result@entry=0x7fea6c075b10, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
      #22 0x0000561f15540ef4 in execute_sqlcom_select (thd=thd@entry=0x7fea6c015088, all_tables=0x7fea6c0747c8) at /test/10.5_dbg/sql/sql_parse.cc:6172
      #23 0x0000561f15539919 in mysql_execute_command (thd=thd@entry=0x7fea6c015088) at /test/10.5_dbg/sql/sql_parse.cc:3901
      #24 0x0000561f15546f2b in mysql_parse (thd=thd@entry=0x7fea6c015088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7fea995b1450, 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:7957
      #25 0x0000561f15532c45 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fea6c015088, packet=packet@entry=0x7fea6c067089 "", packet_length=packet_length@entry=73, 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:1839
      #26 0x0000561f1553149b in do_command (thd=0x7fea6c015088) at /test/10.5_dbg/sql/sql_parse.cc:1358
      #27 0x0000561f1568c415 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x7fea777c53a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1422
      #28 0x0000561f1568c744 in handle_one_connection (arg=arg@entry=0x7fea777c53a8) at /test/10.5_dbg/sql/sql_connect.cc:1319
      #29 0x0000561f15aecfb0 in pfs_spawn_thread (arg=0x7fea97045b08) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #30 0x00007fea989d96db in start_thread (arg=0x7fea995b2700) at pthread_create.c:463
      #31 0x00007fea97dd788f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.1.45 (dbg), 10.2.32 (dbg), 10.2.32 (opt), 10.3.23 (dbg), 10.4.13 (dbg), 10.5.2 (dbg), 10.5.3 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.1.45 (opt), 10.3.23 (opt), 10.4.13 (opt), 10.5.2 (opt), 10.5.3 (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)

        Attachments

          Activity

            People

            Assignee:
            varun Varun Gupta
            Reporter:
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: