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

Assertion `inited == NONE || table->open_by_handler' failed in int handler::ha_external_lock(THD *, int)

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      INSTALL SONAME 'ha_mroonga';
      CREATE TEMPORARY TABLE t1 (c INT AUTO_INCREMENT KEY,c2 INT) ENGINE=Mroonga;
      INSERT INTO t1 SET c=1,c2=1 ON DUPLICATE KEY UPDATE c2=c2;
      

      Leads to:

      CS 10.11.19 0617cf2ab5fc37f49b25c22524c909f26069bd44 (Debug, Clang 18.1.3-11) Build 10/07/2026

      mariadbd: /test/10.11_dbg/sql/handler.cc:7295: int handler::ha_external_lock(THD *, int): Assertion `inited == NONE || table->open_by_handler' failed.
      

      CS 10.11.19 0617cf2ab5fc37f49b25c22524c909f26069bd44 (Debug, Clang 18.1.3-11) Build 10/07/2026

      Core was generated by `/test/MD100726-mariadb-10.11.19-linux-x86_64-dbg/bin/mariadbd --no-defaults --l'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 272085)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x0000756d54a4527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x0000756d54a288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x0000756d54a2881b in __assert_fail_base (fmt=0x756d54bd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5f94c612f6ce "inited == NONE || table->open_by_handler", file=file@entry=0x5f94c612d5d3 "/test/10.11_dbg/sql/handler.cc", line=line@entry=7295, function=function@entry=0x5f94c612f5cc "int handler::ha_external_lock(THD *, int)") at ./assert/assert.c:96
      #6  0x0000756d54a3b517 in __assert_fail (assertion=0x5f94c612f6ce "inited == NONE || table->open_by_handler", file=0x5f94c612d5d3 "/test/10.11_dbg/sql/handler.cc", line=7295, function=0x5f94c612f5cc "int handler::ha_external_lock(THD *, int)")at ./assert/assert.c:105
      #7  0x00005f94c54a24be in handler::ha_external_lock (this=0x6d56256a65f8, thd=0x6d5624000d58, lock_type=0) at /test/10.11_dbg/sql/handler.cc:7295
      #8  0x00006d659ef0ded1 in mrn::ExternalLock::ExternalLock (this=0x75697765fd48, thd=0x6d5624000d58, handler=0x6d56256a65f8, lock_type=0)at /test/10.11_dbg/storage/mroonga/lib/mrn_external_lock.cpp:28
      #9  0x00006d659eec685c in ha_mroonga::storage_info (this=0x6d56256a65f8, flag=64) at /test/10.11_dbg/storage/mroonga/ha_mroonga.cpp:5318
      #10 0x00006d659eecca18 in ha_mroonga::storage_write_row (this=0x6d56256a65f8, buf=0x6d56256a7cb0 "\375\001")at /test/10.11_dbg/storage/mroonga/ha_mroonga.cpp:6234
      #11 0x00006d659eece4da in ha_mroonga::write_row (this=0x6d56256a65f8, buf=0x6d56256a7cb0 "\375\001")at /test/10.11_dbg/storage/mroonga/ha_mroonga.cpp:6485
      #12 0x00005f94c54af1cd in handler::ha_write_row (this=0x6d56256a65f8, buf=0x6d56256a7cb0 "\375\001") at /test/10.11_dbg/sql/handler.cc:7808
      #13 0x00005f94c5063241 in Write_record::insert_on_duplicate_update (this=0x7569776641c0, inserted=0x756977663ea0, updated=0x756977663e98)at /test/10.11_dbg/sql/sql_insert.cc:2174
      #14 0x00005f94c50618ae in Write_record::write_record (this=0x7569776641c0)at /test/10.11_dbg/sql/sql_insert.cc:2364
      #15 0x00005f94c505eff7 in mysql_insert (thd=0x6d5624000d58, table_list=0x6d56240135a8, fields=@0x6d5624005f70: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x6d5624013e90, last = 0x6d5624014050, elements = 2}, <No data fields>}, values_list=@0x6d5624005fb8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x6d5624013ce0, last = 0x6d5624013ce0, elements = 1}, <No data fields>}, update_fields=@0x6d5624005fa0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x6d56240142b0, last = 0x6d56240142b0, elements = 1}, <No data fields>}, update_values=@0x6d5624005f88: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x6d56240142c0, last = 0x6d56240142c0, elements = 1}, <No data fields>}, duplic=DUP_UPDATE, ignore=false, result=0x0)at /test/10.11_dbg/sql/sql_insert.cc:1216
      #16 0x00005f94c50bcf95 in mysql_execute_command (thd=0x6d5624000d58, is_called_from_prepared_stmt=false)at /test/10.11_dbg/sql/sql_parse.cc:4660
      #17 0x00005f94c50b2414 in mysql_parse (thd=0x6d5624000d58, rawbuf=0x6d5624013480 "INSERT INTO t4 SET c=+1,c2=1 ON DUPLICATE KEY UPDATE c2=c2", length=58, parser_state=0x756977665a20)at /test/10.11_dbg/sql/sql_parse.cc:8219
      #18 0x00005f94c50af869 in dispatch_command (command=COM_QUERY, thd=0x6d5624000d58, packet=0x6d562400af09 "INSERT INTO t4 SET c=+1,c2=1 ON DUPLICATE KEY UPDATE c2=c2", packet_length=58, blocking=true)at /test/10.11_dbg/sql/sql_parse.cc:1924
      #19 0x00005f94c50b2fc3 in do_command (thd=0x6d5624000d58, blocking=true)at /test/10.11_dbg/sql/sql_parse.cc:1434
      #20 0x00005f94c52919e9 in do_handle_one_connection (connect=0x5f94fdf21218, put_in_cache=true) at /test/10.11_dbg/sql/sql_connect.cc:1482
      #21 0x00005f94c5291782 in handle_one_connection (arg=0x5f94fe0070f8)at /test/10.11_dbg/sql/sql_connect.cc:1394
      #22 0x0000756d54a9caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #23 0x0000756d54b29c6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed
      CS  10.11  dbg  100726  0617cf2ab5fc37f49b25c22524c909f26069bd44  inited == NONE || table->open_by_handler|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      CS  10.11  opt  100726  0617cf2ab5fc37f49b25c22524c909f26069bd44  No bug found
      CS  11.4   dbg  100726  1fff140f0c25f6a5b2f6fd0b5ef6b6c50d60e913  inited == NONE || table->open_by_handler|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      CS  11.4   opt  100726  1fff140f0c25f6a5b2f6fd0b5ef6b6c50d60e913  No bug found
      CS  11.8   dbg  130726  666b2aca09cb84d59b4ece2185a9200d745cb287  inited == NONE || table->open_by_handler|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      CS  11.8   opt  130726  666b2aca09cb84d59b4ece2185a9200d745cb287  No bug found
      CS  12.3   dbg  130726  27df5668c2e3eef406a5357672d3d8e89d25ff48  inited == NONE || table->open_by_handler|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      CS  12.3   opt  130726  27df5668c2e3eef406a5357672d3d8e89d25ff48  No bug found
      CS  13.0   dbg  130726  84c246ca5387c0611f75097136ff4f4bea092aa3  inited == NONE || table->open_by_handler|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      CS  13.0   opt  130726  84c246ca5387c0611f75097136ff4f4bea092aa3  No bug found
      CS  13.1   dbg  130726  0350ad8cb0540e0f57f930b1f6e5dc225bff41bb  inited == NONE || table->open_by_handler|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      CS  13.1   opt  130726  0350ad8cb0540e0f57f930b1f6e5dc225bff41bb  No bug found
      ES  10.6   dbg  040825  9b794f34b48fb7eee490b6da44edc0f33a947447  inited == NONE || table->open_by_handler|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      ES  10.6   opt  040825  9b794f34b48fb7eee490b6da44edc0f33a947447  No bug found
      ES  11.4   dbg  040825  a1c03ccd54b582e75506687ee19b273ca897f261  inited == NONE || table->open_by_handler|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      ES  11.4   opt  040825  a1c03ccd54b582e75506687ee19b273ca897f261  No bug found
      ES  11.8   dbg  151025  780565c207e9ce0ebf7d8e3d59f223801447b619  inited == NONE || table->open_by_handler|SIGABRT|handler::ha_external_lock|mrn::ExternalLock::ExternalLock|ha_mroonga::storage_info|ha_mroonga::storage_write_row
      ES  11.8   opt  151025  780565c207e9ce0ebf7d8e3d59f223801447b619  No bug found
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 0.5h
                0.5h

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.