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

SIGSEGV in ha_myisammrg::set_lock_type | TABLE_LIST::set_lock_type

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      SET max_session_mem_used=8192;
      CREATE TABLE t (a INT);
      CHECK TABLE t,foo;
      CREATE TEMPORARY TABLE t (a INT) ENGINE=MERGE UNION=(foo);
      UPDATE t,t ta SET t.a=1;
       
      #cleanup
      DROP TABLE t;
      DROP TABLE t;
      
      

      Leads to:

      CS 12.2.2 d26a6f44c1f2119377e79a9540886c6d8c01472f (Optimized, Clang 18.1.3-11) Build 11/02/2026

      Core was generated by `/test/MD110226-mariadb-12.2.2-linux-x86_64-opt/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x000064e794250a77 in ha_myisammrg::set_lock_type (this=0x77344002e6a8, lock=TL_READ) at /test/12.2_opt/storage/myisammrg/ha_myisammrg.cc:1715
       
      [Current thread is 1 (LWP 819332)]
      (gdb) bt
      #0  0x000064e794250a77 in ha_myisammrg::set_lock_type (this=0x77344002e6a8, lock=TL_READ) at /test/12.2_opt/storage/myisammrg/ha_myisammrg.cc:1715
      #1  0x000064e793b4e44a in TABLE_LIST::set_lock_type (this=0x773440017f18, thd=0x773440000c68, lock=TL_READ) at /test/12.2_opt/sql/table.cc:10342
      #2  0x000064e793b32b90 in Multiupdate_prelocking_strategy::handle_end (this=0x7734400188a8, thd=0x773440000c68)at /test/12.2_opt/sql/sql_update.cc:1756
      #3  0x000064e7939df28b in open_tables (thd=thd@entry=0x773440000c68, options=@0x77344000669c: {m_options = DDL_options_st::OPT_NONE}, start=start@entry=0x77531c41cd28, counter=counter@entry=0x773440018868, flags=0, prelocking_strategy=0x7734400188a8)at /test/12.2_opt/sql/sql_base.cc:4864
      #4  0x000064e7939e0b0b in open_tables (thd=0x773440000c68, tables=0x77531c41cd28, counter=0x0, flags=1, prelocking_strategy=0x773440017778) at /test/12.2_opt/sql/sql_base.h:275
      #5  open_tables_for_query (thd=0x77344002e6a8, thd@entry=0x773440000c68, tables=0x773440017778, table_count=0x0, table_count@entry=0x773440018868, flags=flags@entry=0, prelocking_strategy=0x773440017778)at /test/12.2_opt/sql/sql_base.cc:5888
      #6  0x000064e793aca284 in Sql_cmd_dml::prepare (this=0x773440018850, thd=0x773440000c68) at /test/12.2_opt/sql/sql_select.cc:34755
      #7  0x000064e793aca37d in Sql_cmd_dml::execute (this=0x773440018850, thd=0x773440000c68) at /test/12.2_opt/sql/sql_select.cc:34818
      #8  0x000064e793a5293a in mysql_execute_command (thd=thd@entry=0x773440000c68, is_called_from_prepared_stmt=false) at /test/12.2_opt/sql/sql_parse.cc:4434
      #9  0x000064e793a4dd11 in mysql_parse (thd=thd@entry=0x773440000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x77531c41d420)at /test/12.2_opt/sql/sql_parse.cc:7925
      #10 0x000064e793a4c18b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x773440000c68, packet=packet@entry=0x773440008a49 "UPDATE t,t ta SET t.a=1", packet_length=packet_length@entry=23, blocking=true)at /test/12.2_opt/sql/sql_parse.cc:1896
      #11 0x000064e793a4e121 in do_command (thd=thd@entry=0x773440000c68, blocking=true) at /test/12.2_opt/sql/sql_parse.cc:1432
      #12 0x000064e793b7a00d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x64e7d46913a8, put_in_cache=true)at /test/12.2_opt/sql/sql_connect.cc:1503
      #13 0x000064e793b79dcf in handle_one_connection (arg=arg@entry=0x64e7d46913a8)at /test/12.2_opt/sql/sql_connect.cc:1415
      #14 0x000064e793f34db9 in pfs_spawn_thread (arg=0x64e7d46bcd98)at /test/12.2_opt/storage/perfschema/pfs.cc:2198
      #15 0x000077531f69caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #16 0x000077531f729c6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed
      CS  10.6   dbg  110226  1758b2578a8cc7e193bb35de0d8dc9a5e517c89c  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      CS  10.6   opt  110226  1758b2578a8cc7e193bb35de0d8dc9a5e517c89c  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      CS  10.11  dbg  110226  67fceadfa45b3f14921114544734455ecbdd480e  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      CS  10.11  opt  110226  67fceadfa45b3f14921114544734455ecbdd480e  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      CS  11.4   dbg  110226  78201a41b5e88b94c27f5ecc16c9e5486e2e50c3  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      CS  11.4   opt  110226  78201a41b5e88b94c27f5ecc16c9e5486e2e50c3  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      CS  11.8   dbg  110226  65ee9a7b4694d1b6f366b5a7a3d1b0549e5a3671  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      CS  11.8   opt  110226  65ee9a7b4694d1b6f366b5a7a3d1b0549e5a3671  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      CS  12.2   dbg  110226  d26a6f44c1f2119377e79a9540886c6d8c01472f  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      CS  12.2   opt  110226  d26a6f44c1f2119377e79a9540886c6d8c01472f  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      CS  12.3   dbg  110226  21a0714a118614982d20bfa504763d7247800091  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      CS  12.3   opt  110226  21a0714a118614982d20bfa504763d7247800091  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      ES  10.5   dbg  040825  70586522eacf09d04d49962072e14325a75d8155  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      ES  10.5   opt  040825  70586522eacf09d04d49962072e14325a75d8155  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      ES  10.6   dbg  040825  9b794f34b48fb7eee490b6da44edc0f33a947447  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      ES  10.6   opt  040825  9b794f34b48fb7eee490b6da44edc0f33a947447  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      ES  11.4   dbg  040825  a1c03ccd54b582e75506687ee19b273ca897f261  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      ES  11.4   opt  040825  a1c03ccd54b582e75506687ee19b273ca897f261  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      ES  11.8   dbg  151025  780565c207e9ce0ebf7d8e3d59f223801447b619  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      ES  11.8   opt  151025  780565c207e9ce0ebf7d8e3d59f223801447b619  SIGSEGV|ha_myisammrg::set_lock_type|TABLE_LIST::set_lock_type|Multiupdate_prelocking_strategy::handle_end|open_tables
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.