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

SIGSEGV in mtr_t::init

    XMLWordPrintable

Details

    Description

      May be related to MDEV-22970. Sporadic. Repeating the TRUNCATE in testcase below increases reproducibility. Repeating the testcase does the same. Seems to be a new regression as I cannot get it to crash in CS 10.4. Did crash in ES 10.5.5-3 7d429789b55bd66be9fb9b2ce29fcd5d9e7e0db8 and does crash CS 10.5.6 also. Debug only. Seems to reproduce better when using SOURCE infile.sql at command line, with this SQL inside a .sql file. May or may not reproduce under MTR.

      DROP DATABASE test;
      CREATE DATABASE test;
      USE test;
      SET GLOBAL innodb_limit_optimistic_insert_debug=2;
      SET GLOBAL innodb_immediate_scrub_data_uncompressed=ON;
      CREATE TABLE t (c INT) ENGINE=InnoDB;
      TRUNCATE t;
      TRUNCATE t;
      TRUNCATE t;
      TRUNCATE t;
      # ... more repetition = higher reproducibility, though usually only about 3-11 TRUNCATE's are needed, or a double run of the testcase at max ...
      TRUNCATE t;
      TRUNCATE t;
      TRUNCATE t;
      TRUNCATE t;
      

      Leads to:

      10.5.6 CS 1c587481966abc7a9ad5309d0a91ca920f7a5657 (Debug)

      Core was generated by `/test/MD110820-mariadb-10.5.6-linux-x86_64-dbg/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 0x14db98e3a700 (LWP 451927))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x0000562b38e1cb86 in my_write_core (sig=sig@entry=11) at /test/10.5_dbg/mysys/stacktrace.c:519
      #2  0x0000562b385d3d7b in handle_fatal_signal (sig=11) at /test/10.5_dbg/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  mtr_t::init (b=0x14db7b61def8, this=0x14db98e35e50) at /test/10.5_dbg/storage/innobase/include/mtr0log.h:516
      #5  fsp_init_file_page (space=space@entry=0x14db95c43f18, block=block@entry=0x14db7b61def8, mtr=mtr@entry=0x14db98e35e50) at /test/10.5_dbg/storage/innobase/include/fsp0fsp.h:585
      #6  0x0000562b38d1ae7d in fsp_page_create (space=space@entry=0x14db95c43f18, offset=<optimized out>, rw_latch=rw_latch@entry=RW_X_LATCH, mtr=mtr@entry=0x14db98e35e50) at /test/10.5_dbg/storage/innobase/fsp/fsp0fsp.cc:1073
      #7  0x0000562b38d1b569 in fsp_alloc_free_page (space=space@entry=0x14db95c43f18, hint=<optimized out>, hint@entry=333, rw_latch=rw_latch@entry=RW_X_LATCH, mtr=mtr@entry=0x14db98e35e50, init_mtr=init_mtr@entry=0x14db98e35e50) at /test/10.5_dbg/storage/innobase/fsp/fsp0fsp.cc:1187
      #8  0x0000562b38d1c271 in fseg_alloc_free_page_low (space=space@entry=0x14db95c43f18, seg_inode=seg_inode@entry=0x14db7b8e8332 "", iblock=0x14db7b5ff2f0, hint=hint@entry=333, direction=direction@entry=111 'o', rw_latch=rw_latch@entry=RW_X_LATCH, has_done_reservation=true, mtr=0x14db98e35e50, init_mtr=0x14db98e35e50) at /test/10.5_dbg/storage/innobase/fsp/fsp0fsp.cc:2114
      #9  0x0000562b38d1e323 in fseg_alloc_free_page_general (seg_header=0x14db7bb24054 "", hint=hint@entry=333, direction=direction@entry=111 'o', has_done_reservation=has_done_reservation@entry=true, mtr=mtr@entry=0x14db98e35e50, init_mtr=init_mtr@entry=0x14db98e35e50) at /test/10.5_dbg/storage/innobase/fsp/fsp0fsp.cc:2244
      #10 0x0000562b38bf93ff in btr_page_alloc_low (init_mtr=0x14db98e35e50, mtr=0x14db98e35e50, level=1, file_direction=111 'o', hint_page_no=333, index=<optimized out>) at /test/10.5_dbg/storage/innobase/btr/btr0btr.cc:538
      #11 btr_page_alloc (index=0x14db95cd0e98, hint_page_no=hint_page_no@entry=333, file_direction=file_direction@entry=111 'o', level=level@entry=1, mtr=mtr@entry=0x14db98e35e50, init_mtr=init_mtr@entry=0x14db98e35e50) at /test/10.5_dbg/storage/innobase/btr/btr0btr.cc:569
      #12 0x0000562b38c01859 in btr_page_split_and_insert (flags=flags@entry=7, cursor=cursor@entry=0x14db98e347f0, offsets=offsets@entry=0x14db98e347b0, heap=heap@entry=0x14db98e347a8, tuple=tuple@entry=0x14db74854e18, n_ext=0, mtr=<optimized out>) at /test/10.5_dbg/storage/innobase/btr/btr0btr.cc:2842
      #13 0x0000562b38c1fce8 in btr_cur_pessimistic_insert (flags=flags@entry=7, cursor=cursor@entry=0x14db98e347f0, offsets=offsets@entry=0x14db98e347b0, heap=heap@entry=0x14db98e347a8, entry=entry@entry=0x14db74854e18, rec=rec@entry=0x14db98e347a0, big_rec=0x14db98e34798, n_ext=<optimized out>, thr=0x0, mtr=0x14db98e35e50) at /test/10.5_dbg/storage/innobase/btr/btr0cur.cc:3746
      #14 0x0000562b38c00976 in btr_insert_on_non_leaf_level_func (flags=flags@entry=0, index=0x14db95cd0e98, level=<optimized out>, level@entry=1, tuple=0x14db74854e18, file=<optimized out>, file@entry=0x562b392a12e8 "/test/10.5_dbg/storage/innobase/btr/btr0btr.cc", line=<optimized out>, line@entry=2704, mtr=0x14db98e35e50) at /test/10.5_dbg/storage/innobase/btr/btr0btr.cc:2411
      #15 0x0000562b38c032a1 in btr_insert_into_right_sibling (mtr=<optimized out>, n_ext=0, tuple=0x14db74854898, heap=<optimized out>, offsets=0x14db98e35758, cursor=0x14db98e35790, flags=0) at /test/10.5_dbg/storage/innobase/btr/btr0btr.cc:2703
      #16 btr_page_split_and_insert (flags=flags@entry=0, cursor=cursor@entry=0x14db98e35790, offsets=offsets@entry=0x14db98e35758, heap=heap@entry=0x14db98e35750, tuple=tuple@entry=0x14db74854898, n_ext=0, mtr=<optimized out>) at /test/10.5_dbg/storage/innobase/btr/btr0btr.cc:2797
      #17 0x0000562b38c1fce8 in btr_cur_pessimistic_insert (flags=flags@entry=0, cursor=cursor@entry=0x14db98e35790, offsets=offsets@entry=0x14db98e35758, heap=heap@entry=0x14db98e35750, entry=entry@entry=0x14db74854898, rec=rec@entry=0x14db98e35bf0, big_rec=0x14db98e35748, n_ext=<optimized out>, thr=0x14db748e7e18, mtr=0x14db98e35e50) at /test/10.5_dbg/storage/innobase/btr/btr0cur.cc:3746
      #18 0x0000562b38aeac23 in row_ins_clust_index_entry_low (flags=flags@entry=0, mode=mode@entry=33, index=index@entry=0x14db95cd0e98, n_uniq=n_uniq@entry=1, entry=entry@entry=0x14db74854898, n_ext=n_ext@entry=0, thr=0x14db748e7e18) at /test/10.5_dbg/storage/innobase/row/row0ins.cc:2739
      #19 0x0000562b38af23cc in row_ins_clust_index_entry (index=index@entry=0x14db95cd0e98, entry=entry@entry=0x14db74854898, thr=thr@entry=0x14db748e7e18, n_ext=n_ext@entry=0) at /test/10.5_dbg/storage/innobase/row/row0ins.cc:3209
      #20 0x0000562b38b679ec in row_upd_clust_rec_by_insert (mtr=0x14db98e37420, foreign=false, referenced=0, thr=0x14db748e7e18, index=0x14db95cd0e98, node=0x14db748e7560) at /test/10.5_dbg/storage/innobase/row/row0upd.cc:2503
      #21 row_upd_clust_step (node=node@entry=0x14db748e7560, thr=thr@entry=0x14db748e7e18) at /test/10.5_dbg/storage/innobase/row/row0upd.cc:2916
      #22 0x0000562b38b6905c in row_upd (thr=0x14db748e7e18, node=0x14db748e7560) at /test/10.5_dbg/storage/innobase/row/row0upd.cc:2995
      #23 row_upd_step (thr=thr@entry=0x14db748e7e18) at /test/10.5_dbg/storage/innobase/row/row0upd.cc:3139
      #24 0x0000562b38aad1a7 in que_thr_step (thr=0x14db748e7e18) at /test/10.5_dbg/storage/innobase/que/que0que.cc:929
      #25 que_run_threads_low (thr=0x14db748e7e18) at /test/10.5_dbg/storage/innobase/que/que0que.cc:1009
      #26 que_run_threads (thr=<optimized out>) at /test/10.5_dbg/storage/innobase/que/que0que.cc:1049
      #27 0x0000562b38aaf398 in que_eval_sql (info=info@entry=0x14db748de998, sql=sql@entry=0x562b3926ccc0 "PROCEDURE RENAME_TABLE () IS\nBEGIN\nUPDATE SYS_TABLES SET NAME = :new_table_name\n WHERE NAME = :old_table_name;\nEND;\n", reserve_dict_mutex=reserve_dict_mutex@entry=false, trx=trx@entry=0x14db83803548) at /test/10.5_dbg/storage/innobase/que/que0que.cc:1126
      #28 0x0000562b38b156ba in row_rename_table_for_mysql (old_name=<optimized out>, old_name@entry=0x14db98e38210 "test/t", new_name=<optimized out>, new_name@entry=0x14db98e38010 "test/#sql-ib22", trx=trx@entry=0x14db83803548, commit=commit@entry=false, use_fk=use_fk@entry=false) at /test/10.5_dbg/storage/innobase/row/row0mysql.cc:4271
      #29 0x0000562b389b3b01 in innobase_rename_table (trx=0x14db83803548, from=0x14db748890b8 "test/t", to=to@entry=0x14db74854398 "test/#sql-ib22", commit=commit@entry=false, use_fk=use_fk@entry=false) at /test/10.5_dbg/storage/innobase/handler/ha_innodb.cc:13477
      #30 0x0000562b389b01e3 in ha_innobase::truncate (this=0x14db7484d4a0) at /test/10.5_dbg/storage/innobase/handler/ha_innodb.cc:13583
      #31 0x0000562b385e2601 in handler::ha_truncate (this=0x14db7484d4a0) at /test/10.5_dbg/sql/handler.cc:4693
      #32 0x0000562b384acdc0 in Sql_cmd_truncate_table::handler_truncate (this=this@entry=0x14db74874830, thd=thd@entry=0x14db74815088, table_ref=table_ref@entry=0x14db74874158, is_tmp_table=is_tmp_table@entry=false) at /test/10.5_dbg/sql/sql_truncate.cc:238
      #33 0x0000562b384ad9ec in Sql_cmd_truncate_table::truncate_table (this=this@entry=0x14db74874830, thd=thd@entry=0x14db74815088, table_ref=table_ref@entry=0x14db74874158) at /test/10.5_dbg/sql/sql_truncate.cc:461
      #34 0x0000562b384adb3e in Sql_cmd_truncate_table::execute (this=0x14db74874830, thd=0x14db74815088) at /test/10.5_dbg/sql/sql_truncate.cc:517
      #35 0x0000562b3832b3da in mysql_execute_command (thd=thd@entry=0x14db74815088) at /test/10.5_dbg/sql/sql_parse.cc:5952
      #36 0x0000562b38332d4e in mysql_parse (thd=thd@entry=0x14db74815088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14db98e39350, 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:7994
      #37 0x0000562b3831f77e in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14db74815088, packet=packet@entry=0x14db74867089 "TRUNCATE t", packet_length=packet_length@entry=10, 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:1867
      #38 0x0000562b3831df58 in do_command (thd=0x14db74815088) at /test/10.5_dbg/sql/sql_parse.cc:1348
      #39 0x0000562b3847abc9 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14db77cd0808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1410
      #40 0x0000562b3847b2e5 in handle_one_connection (arg=arg@entry=0x14db77cd0808) at /test/10.5_dbg/sql/sql_connect.cc:1312
      #41 0x0000562b388e1572 in pfs_spawn_thread (arg=0x14db95c46508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #42 0x000014db97db36db in start_thread (arg=0x14db98e3a700) at pthread_create.c:463
      #43 0x000014db971b1a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB CS: 10.5.6 (dbg) @ 1c587481966abc7a9ad5309d0a91ca920f7a5657
      MariaDB ES: 10.5.5-3 (dbg) @ 7d429789b55bd66be9fb9b2ce29fcd5d9e7e0db8

      Bug confirmed not present in:
      MariaDB: 10.1.47 (dbg), 10.1.47 (opt), 10.2.34 (dbg), 10.2.34 (opt), 10.3.25 (dbg), 10.3.25 (opt), 10.4.15 (dbg), 10.4.15 (opt), 10.5.6 (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

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              Roel Roel Van de Paar
              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.