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

SAFE_MUTEX and DBUG corrupt memory | SIGABRT in __libc_message

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Confirmed (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.6, 10.7, 10.8, 10.9
    • Fix Version/s: 10.6, 10.7, 10.8, 10.9
    • Component/s: Debug
    • Labels:
      None

      Description

      Testcase

      sysbench /usr/share/sysbench/oltp_insert.lua  --mysql-storage-engine=innodb --table-size=10000000 --tables=30 --threads=30 --mysql-db=test --mysql-user=root --db-driver=mysql --mysql-socket=/test/mtest/GAL_MD220322-mariadb-10.9.0-linux-x86_64-dbg/node1/node1_socket.sock prepare
      

      Leads to

      10.9.0 ab1a7925714727743e5dd7bb1b83014044fc5660 (Debug)

       
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x0000564d01ecc7cd in my_write_core (sig=sig@entry=6) at /test/mtest/10.9_dbg/mysys/stacktrace.c:424
      #2  0x0000564d016af0a5 in handle_fatal_signal (sig=6) at /test/mtest/10.9_dbg/sql/signal_handler.cc:345
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x0000152e5633b859 in __GI_abort () at abort.c:79
      #6  0x0000152e563a63ee in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x152e564d0285 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
      #7  0x0000152e563ae47c in malloc_printerr (str=str@entry=0x152e564ce4ae "free(): invalid pointer") at malloc.c:5347
      #8  0x0000152e563afcac in _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:4173
      #9  0x0000564d01ee7b44 in DBUGCloseFile (cs=cs@entry=0x152ddc000ce0, new_value=new_value@entry=0x0) at /test/mtest/10.9_dbg/dbug/dbug.c:2015
      #10 0x0000564d01ee7c3c in FreeState (cs=cs@entry=0x152ddc000ce0, free_state=free_state@entry=1) at /test/mtest/10.9_dbg/dbug/dbug.c:1637
      #11 0x0000564d01ee84fa in _db_pop_ () at /test/mtest/10.9_dbg/dbug/dbug.c:935
      #12 0x0000564d01ed0bd1 in safe_mutex_lock (mp=mp@entry=0x564d032d08e0 <fil_system+32>, my_flags=my_flags@entry=0, file=file@entry=0x564d0235cef8 "/test/mtest/10.9_dbg/storage/innobase/fil/fil0fil.cc", 
          line=line@entry=247) at /test/mtest/10.9_dbg/mysys/thr_mutex.c:400
      #13 0x0000564d01dbf08d in inline_mysql_mutex_lock (src_line=247, src_file=0x564d0235cef8 "/test/mtest/10.9_dbg/storage/innobase/fil/fil0fil.cc", that=0x564d032d08e0 <fil_system+32>)
          at /test/mtest/10.9_dbg/include/mysql/psi/mysql_thread.h:750
      #14 fil_space_get (id=18) at /test/mtest/10.9_dbg/storage/innobase/fil/fil0fil.cc:247
      #15 0x0000564d01d3030b in buf_page_get_low (page_id=page_id@entry=..., zip_size=zip_size@entry=0, rw_latch=rw_latch@entry=2, guess=guess@entry=0x0, mode=mode@entry=10, mtr=mtr@entry=0x152e0873ff80, 
          err=0x152e0873eb64, allow_ibuf_merge=false) at /test/mtest/10.9_dbg/storage/innobase/include/buf0types.h:126
      #16 0x0000564d01d321ad in buf_page_get_gen (page_id=page_id@entry=..., zip_size=zip_size@entry=0, rw_latch=rw_latch@entry=2, guess=guess@entry=0x0, mode=mode@entry=10, mtr=mtr@entry=0x152e0873ff80, 
          err=0x152e0873eb64, allow_ibuf_merge=false) at /test/mtest/10.9_dbg/storage/innobase/buf/buf0buf.cc:3015
      #17 0x0000564d01cf9770 in btr_cur_search_to_nth_level_func (index=index@entry=0x152ddc037f68, level=<optimized out>, tuple=tuple@entry=0x152ddc1ba7e8, mode=mode@entry=PAGE_CUR_LE, latch_mode=<optimized out>, 
          latch_mode@entry=2, cursor=cursor@entry=0x152e0873f9d0, ahi_latch=<optimized out>, mtr=<optimized out>, autoinc=<optimized out>) at /test/mtest/10.9_dbg/storage/innobase/include/dict0mem.h:1167
      #18 0x0000564d01bc3d30 in btr_pcur_open_low (index=index@entry=0x152ddc037f68, level=<optimized out>, level@entry=0, tuple=tuple@entry=0x152ddc1ba7e8, mode=mode@entry=PAGE_CUR_LE, latch_mode=latch_mode@entry=2, 
          cursor=cursor@entry=0x152e0873f9d0, autoinc=5397547, mtr=0x152e0873ff80) at /test/mtest/10.9_dbg/storage/innobase/include/btr0pcur.inl:369
      #19 0x0000564d01bc95aa in row_ins_clust_index_entry_low (flags=flags@entry=0, mode=mode@entry=2, index=index@entry=0x152ddc037f68, n_uniq=n_uniq@entry=1, entry=entry@entry=0x152ddc1ba7e8, n_ext=n_ext@entry=0, 
          thr=0x152ddc1b9b38) at /test/mtest/10.9_dbg/storage/innobase/row/row0ins.cc:2609
      #20 0x0000564d01bcc17e in row_ins_clust_index_entry (index=index@entry=0x152ddc037f68, entry=entry@entry=0x152ddc1ba7e8, thr=thr@entry=0x152ddc1b9b38, n_ext=n_ext@entry=0)
          at /test/mtest/10.9_dbg/storage/innobase/row/row0ins.cc:3251
      #21 0x0000564d01bd0f7f in row_ins_index_entry (thr=0x152ddc1b9b38, entry=0x152ddc1ba7e8, index=0x152ddc037f68) at /test/mtest/10.9_dbg/storage/innobase/row/row0ins.cc:3388
      #22 row_ins_index_entry_step (thr=0x152ddc1b9b38, node=0x152ddc1b9820) at /test/mtest/10.9_dbg/storage/innobase/row/row0ins.cc:3556
      #23 row_ins (thr=0x152ddc1b9b38, node=0x152ddc1b9820) at /test/mtest/10.9_dbg/storage/innobase/row/row0ins.cc:3702
      #24 row_ins_step (thr=thr@entry=0x152ddc1b9b38) at /test/mtest/10.9_dbg/storage/innobase/row/row0ins.cc:3848
      #25 0x0000564d01bf5191 in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x152ddc1b8120 "\377+\\R", prebuilt=0x152ddc1b9298, ins_mode=ROW_INS_NORMAL)
          at /test/mtest/10.9_dbg/storage/innobase/row/row0mysql.cc:1318
      #26 0x0000564d01a6eaa9 in ha_innobase::write_row (this=0x152ddc1b85a0, record=0x152ddc1b8120 "\377+\\R") at /test/mtest/10.9_dbg/storage/innobase/handler/ha_innodb.cc:7800
      #27 0x0000564d016c3be0 in handler::ha_write_row (this=0x152ddc1b85a0, buf=0x152ddc1b8120 "\377+\\R") at /test/mtest/10.9_dbg/sql/handler.cc:7527
      #28 0x0000564d018581a6 in Rows_log_event::write_row (this=this@entry=0x152ddc022ae8, rgi=rgi@entry=0x152ddc021640, overwrite=false) at /test/mtest/10.9_dbg/sql/log_event_server.cc:7677
      #29 0x0000564d018583a5 in Write_rows_log_event::do_exec_row (this=0x152ddc022ae8, rgi=0x152ddc021640) at /test/mtest/10.9_dbg/sql/log_event_server.cc:7905
      #30 0x0000564d018480bf in Rows_log_event::do_apply_event (this=0x152ddc022ae8, rgi=0x152ddc021640) at /test/mtest/10.9_dbg/sql/log_event_server.cc:6067
      #31 0x0000564d01a2c6c0 in Log_event::apply_event (rgi=0x152ddc021640, this=0x152ddc022ae8) at /test/mtest/10.9_dbg/sql/log_event.h:1566
      #32 wsrep_apply_events (thd=thd@entry=0x152ddc000ff8, rli=<optimized out>, events_buf=<optimized out>, buf_len=368561) at /test/mtest/10.9_dbg/sql/wsrep_applier.cc:208
      #33 0x0000564d01a0eee1 in apply_events (thd=thd@entry=0x152ddc000ff8, rli=<optimized out>, data=..., err=...) at /test/mtest/10.9_dbg/wsrep-lib/include/wsrep/buffer.hpp:48
      #34 0x0000564d01a0faee in Wsrep_applier_service::apply_write_set (this=0x152e08742d10, ws_meta=..., data=..., err=...) at /test/mtest/10.9_dbg/sql/wsrep_high_priority_service.cc:577
      #35 0x0000564d0203294c in apply_write_set (server_state=..., high_priority_service=..., ws_handle=..., ws_meta=..., data=...) at /test/mtest/10.9_dbg/wsrep-lib/src/server_state.cpp:331
      #36 0x0000564d02033899 in wsrep::server_state::on_apply (this=<optimized out>, high_priority_service=..., ws_handle=..., ws_meta=..., data=...) at /test/mtest/10.9_dbg/wsrep-lib/src/server_state.cpp:1118
      #37 0x0000564d02043b9c in wsrep::high_priority_service::apply (data=..., ws_meta=..., ws_handle=..., this=0x152e08742d10) at /test/mtest/10.9_dbg/wsrep-lib/include/wsrep/high_priority_service.hpp:47
      --Type <RET> for more, q to quit, c to continue without paging--
      #38 (anonymous namespace)::apply_cb (ctx=ctx@entry=0x152e08742d10, wsh=wsh@entry=0x152e08741d20, flags=flags@entry=65, buf=buf@entry=0x152e08741d30, meta=meta@entry=0x152e08741fe0, 
          exit_loop=exit_loop@entry=0x152e08741f9f) at /test/mtest/10.9_dbg/wsrep-lib/src/wsrep_provider_v26.cpp:507
      #39 0x0000152e55d9b9a5 in galera::TrxHandleSlave::apply (this=this@entry=0x152e317080d0, recv_ctx=recv_ctx@entry=0x152e08742d10, 
          apply_cb=0x564d02043a19 <(anonymous namespace)::apply_cb(void*, wsrep_ws_handle_t const*, uint32_t, wsrep_buf_t const*, wsrep_trx_meta_t const*, wsrep_bool_t*)>, meta=..., 
          exit_loop=exit_loop@entry=@0x152e08741f9f: false) at /test/mtest/10.9_galera_dbg/galera/src/trx_handle.cpp:396
      #40 0x0000152e55db214e in galera::ReplicatorSMM::apply_trx (this=0x564d0449b4b0, recv_ctx=0x152e08742d10, ts=...) at /test/mtest/10.9_galera_dbg/galera/src/replicator_smm.cpp:516
      #41 0x0000152e55db6368 in galera::ReplicatorSMM::process_trx (this=0x564d0449b4b0, recv_ctx=0x152e08742d10, ts_ptr=...) at /test/mtest/10.9_galera_dbg/galera/src/replicator_smm.cpp:2136
      #42 0x0000152e55de7e79 in galera::GcsActionSource::process_writeset (this=0x564d04494040, recv_ctx=0x152e08742d10, act=..., exit_loop=@0x152e0874291f: false)
          at /test/mtest/10.9_galera_dbg/galera/src/gcs_action_source.cpp:62
      #43 0x0000152e55de88d3 in galera::GcsActionSource::dispatch (this=0x564d04494040, recv_ctx=0x152e08742d10, act=..., exit_loop=<optimized out>) at /test/mtest/10.9_galera_dbg/galera/src/gcs_action_source.cpp:110
      #44 0x0000152e55de8e92 in galera::GcsActionSource::process (this=0x564d04494040, recv_ctx=0x152e08742d10, exit_loop=@0x152e0874291f: false) at /test/mtest/10.9_galera_dbg/galera/src/gcs_action_source.cpp:186
      #45 0x0000152e55db37f0 in galera::ReplicatorSMM::async_recv (this=0x564d0449b4b0, recv_ctx=0x152e08742d10) at /test/mtest/10.9_galera_dbg/galera/src/replicator_smm.cpp:402
      #46 0x0000152e55d87ea1 in galera_recv (gh=<optimized out>, recv_ctx=<optimized out>) at /test/mtest/10.9_galera_dbg/galera/src/wsrep_provider.cpp:263
      #47 0x0000564d02044874 in wsrep::wsrep_provider_v26::run_applier (this=<optimized out>, applier_ctx=<optimized out>) at /test/mtest/10.9_dbg/wsrep-lib/src/wsrep_provider_v26.cpp:858
      #48 0x0000564d01a2ed0b in wsrep_replication_process (thd=0x152ddc000ff8, arg=<optimized out>) at /test/mtest/10.9_dbg/sql/wsrep_server_state.h:51
      #49 0x0000564d01a1be18 in start_wsrep_THD (arg=arg@entry=0x564d04b32230) at /test/mtest/10.9_dbg/sql/wsrep_mysqld.h:574
      #50 0x0000564d019ac92d in pfs_spawn_thread (arg=0x564d04c213e8) at /test/mtest/10.9_dbg/storage/perfschema/pfs.cc:2201
      #51 0x0000152e5684a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #52 0x0000152e56438293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              ramesh Ramesh Sivaraman
              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.